Reproduction: renovatebot/renovate#42992
HTTPError: Request failed with status code 410 (Gone) when Renovate tries to
close an issue that a user has deleted on GitHub between runs.
Original report: discussion #42609 Tracking issue: #42992 Fix PR: #42993
closeIssue (lib/modules/platform/github/index.ts) issues a
PATCH /repos/{owner}/{repo}/issues/{number} to set state: closed. If the
issue was deleted on the platform after Renovate cached it, GitHub responds
410 Gone (or 404 Not Found), the error propagates out of
ensureIssueClosing, and the whole repository run aborts with
Repository has unknown error.
The repository cache (repositoryCache: enabled, the default in self-hosted
runs) keeps the deleted issue's number on disk, so every subsequent run
reproduces the crash until the cache is wiped.
package.json— one outdated dep (lodash@4.17.20) so Renovate has work to do and creates a Dependency Dashboard issue.renovate.json—config:recommended+dependencyDashboard: true.
Requires a self-hosted Renovate checkout (CLI), a GitHub PAT with repo
scope on this repo, and a writable cache dir.
export RENOVATE_TOKEN=<your PAT>
export RENOVATE_CACHE_DIR=/tmp/renovate-42992-cache
export LOG_LEVEL=debug
# 1. First run: creates the Dependency Dashboard issue and persists it to cache.
renovate --platform=github renovate-reproductions/42992-deleted-issue-410
# 2. On github.com, open the "Dependency Dashboard" issue created in step 1
# and DELETE it (Issue → ⋯ menu → Delete issue). Confirm deletion.
# 3. Flip dependencyDashboard to false so Renovate tries to CLOSE the dashboard
# on the next run (this is what calls closeIssue → PATCH → 410).
# Easiest: edit renovate.json on the default branch to set
# "dependencyDashboard": false, commit, push.
# 4. Second run: reads the cached (now-stale) issue list, finds the
# "Dependency Dashboard" entry as open, and PATCHes the deleted issue.
renovate --platform=github renovate-reproductions/42992-deleted-issue-410The second run aborts with:
HTTPError: Request failed with status code 410 (Gone): PATCH https://api.github.com/repos/renovate-reproductions/42992-deleted-issue-410/issues/<N>
…
"msg": "Repository has unknown error"
Exit code is non-zero.
Expected on the fix branch (fix/github-deleted-issue-410, PR #42993)
The second run logs:
Issue #<N> no longer exists on the platform, removing from cache
…and the run finishes cleanly. Exit code 0. The deleted issue is dropped from
GithubIssueCache, so the third run no longer sees it at all.
# In a renovatebot/renovate checkout:
gh pr checkout 42993 # check out the fix branch
pnpm install
pnpm build
# Repeat steps 1–4 above — the second run should succeed.If you still want to reproduce the crash first to confirm the setup is
correct, run steps 1–4 once on main, then git checkout fix/github-deleted-issue-410
and rerun step 4 (without wiping the cache) — the same cached state that
crashed main should now be handled gracefully.