Repository navigation
serve restic: return 500 not 404 when delete object lookup fails - fixes #10100 - #10109
Merged
Merged
Conversation
deleteObject() replied 404 for any error from newObject(), while serveObject() in the same file replies 404 only for fs.ErrorObjectNotFound and 500 otherwise. restic treats a 404 on DELETE as final and never retries, so a transient lookup failure while removing a lock left the lock behind and broke the next exclusive operation (eg forget --prune failing with "repository is already locked"). Mirror the serveObject() 404/500 split in deleteObject(). Fixes rclone#10100
3 tasks done
|
Tested your existing change at
Results were consistent across four runs per case. This verifies client retry and lock cleanup beyond the handler-status test. It uses the local backend and a synthetic one-shot lookup fault, not B2; I haven't run the full Rclone suite. No backup data was needed. |
ncw
approved these changes
Oct 18, 2026
ncw
left a comment
Member
There was a problem hiding this comment.
Thank you for the fix @bunnysayzz - very nice :-)
6 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change do?
rclone serve resticreplied404 Not Foundwhen aDELETErequest's object lookup failed with any error other than not-found, while aGETwith the same lookup failure replied500 Internal Server Error(serveObject()in the same file only mapsfs.ErrorObjectNotFoundto 404).restic treats a 404 on delete as final and never retries. So a transient lookup failure while restic removed its lock (seen in production with a Backblaze B2 remote: a temporary B2 error during lock removal) left the lock in the repository, and the next exclusive operation failed with "repository is already locked".
This change makes
deleteObject()use the same 404/500 split asserveObject(): 404 only forfs.ErrorObjectNotFound, 500 for everything else, so restic retries the delete.Linked issue
Fixes #10100
Checklist