PR creation fails, Github API returns "422 Unprocessable entity" (Mend.io-hosted Renovate version 39.107.0) #33761
-
How are you running Renovate?A Mend.io-hosted app If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.No response Please tell us more about your question or problemWe have a repo, which is https://github.com/canonical/identity-platform-admin-ui, and we have a renovate.js at the root of the project. We noticed that for quite a while Renovate is not creating PRs for updating our go project and the react project.
I have reasons to believe the endpoint is not spammed. Find an extract of the DEBUG logs over here. DEBUG: POST https://api.github.com/repos/canonical/identity-platform-admin-ui/git/refs (code=ERR_NON_2XX_3XX_RESPONSE, statusCode=422 retryCount=0, duration=511) (branch="renovate/auto-pre-commit-hooks")
DEBUG: 422 Error thrown from GitHub (branch="renovate/auto-pre-commit-hooks")
{
"err": {
"name": "HTTPError",
"code": "ERR_NON_2XX_3XX_RESPONSE",
"timings": {
"start": 1737558523432,
"socket": 1737558523432,
"lookup": 1737558523432,
"connect": 1737558523432,
"secureConnect": 1737558523432,
"upload": 1737558523433,
"response": 1737558523943,
"end": 1737558523943,
"phases": {
"wait": 0,
"dns": 0,
"tcp": 0,
"tls": 0,
"request": 1,
"firstByte": 510,
"download": 0,
"total": 511
}
},
"message": "Response code 422 (Unprocessable Entity)",
"stack": "HTTPError: Response code 422 (Unprocessable Entity)\n at Request.<anonymous>
(/usr/local/renovate/node_modules/.pnpm/got@11.8.6/node_modules/got/dist/source/as-promise/index.js:118:42)\n at
processTicksAndRejections (node:internal/process/task_queues:105:5)",
"options": {
"headers": {
"user-agent": "RenovateBot/39.107.0 (https://github.com/renovatebot/renovate)",
"accept": "application/json, application/vnd.github.machine-man-preview+json",
"authorization": "***********",
"content-type": "application/json",
"content-length": "100",
"accept-encoding": "gzip, deflate, br"
},
"url": "https://api.github.com/repos/canonical/identity-platform-admin-ui/git/refs",
"hostType": "github",
"username": "",
"password": "",
"method": "POST",
"http2": false
},
"response": {
"statusCode": 422,
"statusMessage": "Unprocessable Entity",
"body": {
"message": "Reference update failed",
"documentation_url": "https://docs.github.com/rest/git/refs#create-a-reference",
"status": "422"
},
"headers": {
"date": "Wed, 22 Jan 2025 15:08:44 GMT",
"content-type": "application/json; charset=utf-8",
"content-length": "131",
"x-github-media-type": "github.v3; param=machine-man-preview",
"x-accepted-github-permissions": "contents=write; contents=write,workflows=write",
"x-github-api-version-selected": "2022-11-28",
"x-ratelimit-limit": "15000",
"x-ratelimit-remaining": "14301",
"x-ratelimit-reset": "1737560811",
"x-ratelimit-used": "699",
"x-ratelimit-resource": "core",
"access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-
Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-
Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
"access-control-allow-origin": "*",
"strict-transport-security": "max-age=31536000; includeSubdomains; preload",
"x-frame-options": "deny",
"x-content-type-options": "nosniff",
"x-xss-protection": "0",
"referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
"content-security-policy": "default-src 'none'",
"vary": "Accept-Encoding, Accept, X-Requested-With",
"x-github-request-id": "9186:1131C2:3C3C15:77E4C6:679109FB",
"server": "github.com"
},
"httpVersion": "1.1",
"retryCount": 0
}
}
} I also attached the full logs to this issue. Thanks everyone. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Can you try forking the repo and installing the app to see if the problem reoccurs? That would mean it's related to the data in the repo itself. |
Beta Was this translation helpful? Give feedback.
-
Here's the relevant parts of the linked log:
And the most important part of that:
@BarcoMasile I'm a bit confused though because when I browse to the repo and view branches, it says that branch was updated 2 hours ago. Did the branch update succeed again? |
Beta Was this translation helpful? Give feedback.
@rarkins Right after I replied to your message a few minutes ago, I refreshed my page and noticed the new PRs are actually present, and that the last few renovate jobs ran successfully. I was taking notes in Jira and trying to assess the situation, it seems that all the PRs expected are now present.
This leads me to think that the issue was in fact endpoint spamming, as I originally suspected.
Yes, the relevant parts are the 422 errors that pushed me to open this issue originally.
So what I will do is lower the frequency with which renovate runs jobs by providing a schedule at the repo level instead of the single package rule.
Would you say that is a good strategy?