[GitLab 19.0.2] setBranchStatus crashes (TypeError: err.body.message.startsWith) → all PR creation stalls #44213
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How are you running Renovate?
Self-hosted Renovate CLI
Which platform you running Renovate on?
GitLab (.com or self-hosted)
Which version of Renovate are you using?
43.242.0
Please tell us more about your question or problem
Describe the proposed change(s) / bug
On self-hosted Renovate against GitLab CE 19.0.2, every repo run aborts each branch during status-check setting:
WARN: Error updating branch (branch=renovate/...)
TypeError: err.body?.message?.startsWith is not a function
at Proxy.setBranchStatus (lib/modules/platform/gitlab/index.ts:1047:26)
at setStatusCheck (lib/workers/repository/update/branch/status-checks.ts:56:5)
at setStability (lib/workers/repository/update/branch/status-checks.ts:109:3)
at setBranchStatusChecks (lib/workers/repository/update/branch/index.ts:64:3)
It throws while setting the internal renovate/stability-days commit status — before PR creation — so no MRs are created at all. Extraction completes (result: "done"), but zero branches/PRs progress: a silent, instance-wide stall.
Environment
Root cause
The error guard at gitlab/index.ts:~1047 calls err.body?.message?.startsWith('Cannot transition...') assuming message is a string. GitLab 19.0.2 returns an error on the commit-status POST whose body.message is non-string (GitLab emits ActiveRecord validation errors as {"message": {...}}), so .startsWith throws.
Independently verified: a fresh POST /statuses/:sha succeeds; transition errors (running→running) return string messages ("Cannot transition status via :run from :running") which the guard handles. The crashing path is a different error with a non-string message.
Suggested fix — type-guard before .startsWith:
const msg = err.body?.message;
if (typeof msg === 'string' && msg.startsWith('Cannot transition status')) { /* ignore */ }
Workaround (confirmed): remove stabilityDays/minimumReleaseAge → no renovate/stability-days status → no setBranchStatus call → PRs flow again.
Note on reproduction: couldn't capture the raw err.body after the fact — the TypeError replaces it in logs and the affected branches have since merged (workaround live). The fix is a defensive type-guard, independent of the exact body.
Logs (if relevant)
Logs
Beta Was this translation helpful? Give feedback.
All reactions