Originally posted by **ronaldvb-k** April 17, 2024
### What would you like help with?
I think I found a bug
### How are you running Renovate?
Self-hosted
### If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.
Gitea, renovate:37.281.4
### Please tell us more about your question or problem
Renovate tries to update a Pull Request which does not exist (anymore) and fails with a 404 (Not Found) error.
The corresponding branch still exists in Gitea.
The pull request exists in the Renovate json prcache, but not in Gitea. It looks like the cache should be invalidated at this point?
Please let me know if you need more information.
### Logs (if relevant)
Select me to see logs
```
{"name":"renovate","hostname":"renovate-bot-manual-gzj8j","pid":8,"level":30,"logContext":"HsCdK6hHht9_rJSjhw4lt","length":1,"repositories":["kss/kss-deploy"],"msg":"Autodiscovered repositories","time":"2024-04-17T06:59:57.921Z","v":0}
{"name":"renovate","hostname":"renovate-bot-manual-gzj8j","pid":8,"level":30,"logContext":"HsCdK6hHht9_rJSjhw4lt","repository":"kss/kss-deploy","renovateVersion":"37.281.4","msg":"Repository started","time":"2024-04-17T07:01:59.522Z","v":0}
{"name":"renovate","hostname":"renovate-bot-manual-gzj8j","pid":8,"level":30,"logContext":"HsCdK6hHht9_rJSjhw4lt","repository":"kss/kss-deploy","baseBranch":"develop","stats":{"managers":{"helmv3":{"fileCount":12,"depCount":12}},"total":{"fileCount":12,"depCount":12}},"msg":"Dependency extraction complete","time":"2024-04-17T07:02:01.667Z","v":0}
{"name":"renovate","hostname":"renovate-bot-manual-gzj8j","pid":8,"level":50,"logContext":"HsCdK6hHht9_rJSjhw4lt","repository":"kss/kss-deploy","branch":"renovate/traefik-1.x","err":{"name":"HTTPError","code":"ERR_NON_2XX_3XX_RESPONSE","timings":{"start":1713337321879,"socket":1713337321880,"lookup":1713337321881,"connect":1713337321883,"secureConnect":1713337321887,"upload":1713337321887,"response":1713337321923,"end":1713337321923,"phases":{"wait":1,"dns":1,"tcp":2,"tls":4,"request":0,"firstByte":36,"download":0,"total":44}},"message":"Response code 404 (Not Found)","stack":"HTTPError: Response code 404 (Not Found)\n at Request. (/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:95:5)","options":{"headers":{"user-agent":"RenovateBot/37.281.4 (https://github.com/renovatebot/renovate)","accept":"application/json","authorization":"***********","content-type":"application/json","content-length":"952","accept-encoding":"gzip, deflate, br"},"url":"https://XXX/api/v1/repos/kss/kss-deploy/pulls/429","hostType":"gitea","username":"","password":"","method":"PATCH","http2":false},"response":{"statusCode":404,"statusMessage":"Not Found","body":{"errors":null,"message":"The target couldn't be found.","url":"https://XXX/api/swagger"},"headers":{"cache-control":"max-age=0, private, must-revalidate, no-transform","content-length":"112","content-type":"application/json;charset=utf-8","date":"Wed, 17 Apr 2024 07:02:01 GMT","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","connection":"close","strict-transport-security":"max-age=31536000; includeSubDomains; preload"},"httpVersion":"1.1","retryCount":0}},"msg":"Failed to ensure PR: Update Helm release traefik to ~1.3.0","time":"2024-04-17T07:02:01.925Z","v":0}
{"name":"renovate","hostname":"renovate-bot-manual-gzj8j","pid":8,"level":30,"logContext":"HsCdK6hHht9_rJSjhw4lt","repository":"kss/kss-deploy","durationMs":1117,"msg":"git fetch completed","time":"2024-04-17T07:02:03.340Z","v":0}
{"name":"renovate","hostname":"renovate-bot-manual-gzj8j","pid":8,"level":30,"logContext":"HsCdK6hHht9_rJSjhw4lt","repository":"kss/kss-deploy","branchName":"renovate/argocd-1.x","prNo":422,"prTitle":"Update Helm release argocd to ~1.9.0","msg":"Autoclosing PR","time":"2024-04-17T07:02:03.358Z","v":0}
{"name":"renovate","hostname":"renovate-bot-manual-gzj8j","pid":8,"level":40,"logContext":"HsCdK6hHht9_rJSjhw4lt","repository":"kss/kss-deploy","err":{"name":"HTTPError","code":"ERR_NON_2XX_3XX_RESPONSE","timings":{"start":1713337323360,"socket":1713337323361,"lookup":1713337323366,"connect":1713337323369,"secureConnect":1713337323371,"upload":1713337323371,"response":1713337323426,"end":1713337323426,"phases":{"wait":1,"dns":5,"tcp":3,"tls":2,"request":0,"firstByte":55,"download":0,"total":66}},"message":"Response code 404 (Not Found)","stack":"HTTPError: Response code 404 (Not Found)\n at Request. (/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:95:5)","options":{"headers":{"user-agent":"RenovateBot/37.281.4 (https://github.com/renovatebot/renovate)","accept":"application/json","authorization":"***********","content-type":"application/json","content-length":"82","accept-encoding":"gzip, deflate, br"},"url":"https://XXX/api/v1/repos/kss/kss-deploy/pulls/422","hostType":"gitea","username":"","password":"","method":"PATCH","http2":false},"response":{"statusCode":404,"statusMessage":"Not Found","body":{"errors":null,"message":"The target couldn't be found.","url":"https://XXX/api/swagger"},"headers":{"cache-control":"max-age=0, private, must-revalidate, no-transform","content-length":"112","content-type":"application/json;charset=utf-8","date":"Wed, 17 Apr 2024 07:02:03 GMT","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","connection":"close","strict-transport-security":"max-age=31536000; includeSubDomains; preload"},"httpVersion":"1.1","retryCount":0}},"branch":"renovate/argocd-1.x","msg":"Error pruning branch","time":"2024-04-17T07:02:03.427Z","v":0}
{"name":"renovate","hostname":"renovate-bot-manual-gzj8j","pid":8,"level":30,"logContext":"HsCdK6hHht9_rJSjhw4lt","repository":"kss/kss-deploy","cloned":true,"durationMs":3906,"msg":"Repository finished","time":"2024-04-17T07:02:03.429Z","v":0}
{"name":"renovate","hostname":"renovate-bot-manual-gzj8j","pid":8,"level":30,"logContext":"HsCdK6hHht9_rJSjhw4lt","msg":"Renovate was run at log level \"info\". Set LOG_LEVEL=debug in environment variables to see extended debug logs.","time":"2024-04-17T07:02:14.523Z","v":0}
{"name":"renovate","hostname":"renovate-bot-manual-gzj8j","pid":8,"level":30,"logContext":"HsCdK6hHht9_rJSjhw4lt","loggerErrors":[{"name":"renovate","level":50,"logContext":"HsCdK6hHht9_rJSjhw4lt","repository":"kss/kss-deploy","branch":"renovate/traefik-1.x","err":{"name":"HTTPError","code":"ERR_NON_2XX_3XX_RESPONSE","timings":{"start":1713337321879,"socket":1713337321880,"lookup":1713337321881,"connect":1713337321883,"secureConnect":1713337321887,"upload":1713337321887,"response":1713337321923,"end":1713337321923,"phases":{"wait":1,"dns":1,"tcp":2,"tls":4,"request":0,"firstByte":36,"download":0,"total":44}},"message":"Response code 404 (Not Found)","stack":"HTTPError: Response code 404 (Not Found)\n at Request. (/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:95:5)","options":{"headers":{"user-agent":"RenovateBot/37.281.4 (https://github.com/renovatebot/renovate)","accept":"application/json","authorization":"***********","content-type":"application/json","content-length":"952","accept-encoding":"gzip, deflate, br"},"url":"https://XXX/api/v1/repos/kss/kss-deploy/pulls/429","hostType":"gitea","username":"","password":"","method":"PATCH","http2":false},"response":{"statusCode":404,"statusMessage":"Not Found","body":{"errors":null,"message":"The target couldn't be found.","url":"https://XXX/api/swagger"},"headers":{"cache-control":"max-age=0, private, must-revalidate, no-transform","content-length":"112","content-type":"application/json;charset=utf-8","date":"Wed, 17 Apr 2024 07:02:01 GMT","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","connection":"close","strict-transport-security":"max-age=31536000; includeSubDomains; preload"},"httpVersion":"1.1","retryCount":0}},"msg":"Failed to ensure PR: Update Helm release traefik to ~1.3.0"}],"msg":"Renovate is exiting with a non-zero code due to the following logged errors","time":"2024-04-17T07:02:14.524Z","v":0}
```
Discussed in https://github.com/renovatebot/renovate/discussions/28466
Select me to see logs
``` {"name":"renovate","hostname":"renovate-bot-manual-gzj8j","pid":8,"level":30,"logContext":"HsCdK6hHht9_rJSjhw4lt","length":1,"repositories":["kss/kss-deploy"],"msg":"Autodiscovered repositories","time":"2024-04-17T06:59:57.921Z","v":0} {"name":"renovate","hostname":"renovate-bot-manual-gzj8j","pid":8,"level":30,"logContext":"HsCdK6hHht9_rJSjhw4lt","repository":"kss/kss-deploy","renovateVersion":"37.281.4","msg":"Repository started","time":"2024-04-17T07:01:59.522Z","v":0} {"name":"renovate","hostname":"renovate-bot-manual-gzj8j","pid":8,"level":30,"logContext":"HsCdK6hHht9_rJSjhw4lt","repository":"kss/kss-deploy","baseBranch":"develop","stats":{"managers":{"helmv3":{"fileCount":12,"depCount":12}},"total":{"fileCount":12,"depCount":12}},"msg":"Dependency extraction complete","time":"2024-04-17T07:02:01.667Z","v":0} {"name":"renovate","hostname":"renovate-bot-manual-gzj8j","pid":8,"level":50,"logContext":"HsCdK6hHht9_rJSjhw4lt","repository":"kss/kss-deploy","branch":"renovate/traefik-1.x","err":{"name":"HTTPError","code":"ERR_NON_2XX_3XX_RESPONSE","timings":{"start":1713337321879,"socket":1713337321880,"lookup":1713337321881,"connect":1713337321883,"secureConnect":1713337321887,"upload":1713337321887,"response":1713337321923,"end":1713337321923,"phases":{"wait":1,"dns":1,"tcp":2,"tls":4,"request":0,"firstByte":36,"download":0,"total":44}},"message":"Response code 404 (Not Found)","stack":"HTTPError: Response code 404 (Not Found)\n at Request.