GitHub API - 422: Unprocessable Entity: Review comments is invalid and Review threads is invalid #42272
Replies: 2 comments
-
Thanks for posting in the GitHub Community, @akpay ! We're happy you're here. You are more likely to get a useful response if you are posting your question in the applicable category, the Issues category is solely related to conversations around the GitHub products Issues and Projects. I've gone ahead and moved it for you. Good luck! |
Beta Was this translation helpful? Give feedback.
-
@queenofcorgis It seems to me that the HTTP status 422 is also used for rate limit issues (i.e. the "the endpoint has been spammed" part of the explanation). I searched for "HTTP 422" in the documentation and got this response:
On "Check the error message for clues about missing or invalid fields": Unfortunately, the Searching for "what does HTTP 422 error mean in the GitHub rest api?" results in this response:
This response again refers to the not very helpful I would appreciate if someone from GitHub could comment on this issue and provide some explanation about the cause of HTTP 422, and some guidance on how to deal with it when causes such as an invalid request can be excluded. No offense, but this issue now has been open for 2.5 years... Update: I checked the branch protection settings of the repo, and it turned out that "Restrict pushes that create matching branches" was enabled for the respective branch protection rule, without any users specified. I thought this might be the reason for the 422 error and disabled it, but a test workflow to verify that succeeded in creating a branch, with and without that setting enabled. So the occurrence of the HTTP 422 in this case does not seem to depend on that setting. Log when setting was enabled: https://github.com/zhmcclient/zhmc-log-forwarder/actions/runs/15432877962 Update 2: I opened issue github/rest-api-description#4887 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Bug
Body
Use Case,
I'm using Create review PR API to create PR comments by sending multiple comments as array in single request input field
comments
. It works as expected.Issue,
When I tried to split single request Create review PR API into multiple requests by limiting
comments
input batch array of 20 comments per API call then it succeeds for first batch but second batch request fails with error "422: Unprocessable Entity: Review comments is invalid and Review threads is invalid"Failed response status,
422
Validation failed, or the endpoint has been spammed.
Limitation?
Do we have any maximum number/length/character limitation for
comments
array in single request Create review PR API input fieldcomments
Root Cause?
Why issue happens only for multiple requests to Create review PR API? Is that due to rate limiting/spam issues for endpoint?
Beta Was this translation helpful? Give feedback.
All reactions