Fix missing UploadedFile causing silent release failures#50
Conversation
…n retry When a client calls multiupload/finish and the reverse proxy times out (504) before the response reaches the client, the client retries. Each retry would create a duplicate UploadedFile record (causing NotUniqueError) or fail reading already-deleted chunks (FileNotFoundError), both surfacing as 500 errors. This was observed in production as 17 rapid-fire 500s. Check file.done at the top of finish_chunked_upload and return success immediately if the upload was already finalized, avoiding redundant reassembly and the resulting errors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The OK(200) issue I reported is a bug in KNet. It reports the status code on error rather than the error message it was sent. The HTTP status code thing in fsnebula is definitely an issue, however it's not one that can be fixed, as KNet and old-knossos depend on the current behavior to work properly. Fixing the status codes on fsnebula would almost certainly break proper error handling on both clients. |
The multiupload/finish idempotency path returned success without verifying the UploadedFile DB record still exists. If the record was lost (e.g. expired) after the upload completed, the release endpoint would reject the mod with "archive missing" — but clients like KNet never saw the error because create_release() returned HTTP 200 for all error responses. Two fixes: - multiupload/finish now checks for the UploadedFile record when ChunkedUpload.done is True, and re-creates it from the file on disk if missing. If the file is also gone, it resets done=False so the client can retry. - create_release() error responses now return proper HTTP status codes (400/403/500) instead of 200. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d80f406 to
89182be
Compare
|
I followed up with Claude today about the thing I had a question about last night on Discord, about whether there was a risk of it flagging a file still in the temp location as successfully uploaded. Doesn't sound like there is an issue, but it did flag some other things:
|
The multiupload/finish idempotency path returned success without verifying the UploadedFile DB record still exists. If the record was lost (e.g. expired) after the upload completed, the release endpoint would reject the mod with "archive missing" — but clients like KNet never saw the error because create_release() returned HTTP 200 for all error responses.
Two fixes:
Depends on #49; in draft until that is merged