Skip to content

renovate-reproductions/42992-deleted-issue-410

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

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

Why it crashes

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.

Files

  • package.json — one outdated dep (lodash@4.17.20) so Renovate has work to do and creates a Dependency Dashboard issue.
  • renovate.jsonconfig:recommended + dependencyDashboard: true.

Reproduction steps

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-410

Expected on main (bug present)

The 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.

Verifying the fix locally

# 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.

About

Reproduction for renovatebot/renovate#42992 - HTTPError 410 crash when a tracked GitHub issue is deleted between Renovate runs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors