Skip to content

Unexpected error when GitHub returns 422 #229

Closed

Description

@jeroen

I am seeing this error

Error in do.call(rbind, errors) : second argument must be a list
Calls: <Anonymous> ... gh_make_request -> gh_error -> as.data.frame -> do.call

It originates here:

gh/R/gh.R

Line 359 in e9194ae

errors <- as.data.frame(do.call(rbind, errors))

For this response:

Browse[1]> res
$message
[1] "Validation Failed"

$errors
[1] "Validation failed: This SHA and context has reached the maximum number of statuses."

$documentation_url
[1] "https://docs.github.com/rest/commits/statuses#create-a-commit-status"

$status
[1] "422"

So the problem is that errors is just a string and not a data frame?

Activity

  1. gaborcsardi commented on May 26, 2026

    @gaborcsardi
    Member

    The workflow run is gone now, do you have a way to reproduce this?

  2. jeroen commented on Jun 22, 2026

    @jeroen
    MemberAuthor

    For future reference, the http 422 can be reproduced by posting an invalid state or sha value to the commit status API:

    sha <- gh::gh('/repos/r-lib/gert/commits')[[1]]$sha
    gh::gh('/repos/r-lib/gert/statuses/{sha}', sha = sha, .method = 'POST', state = 'BLABLABLA',
           context = 'test/test', description = 'This is a test')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    reprexneeds a minimal reproducible example

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions