Closed mosi-kha closed 6 months ago
I have the same problem. For me everything works using MinIO locally, but when targeting Scaleway's object storage I get the same error.
This could be a regression and I will investigate. Does this error occur for every concatenation request repeatedly or just occasionally?
@Acconut Thank you for following up, it occurs for every concatenation request.
I cannot reproduce this when uploading to AWS S3. What storage provider are you using? It does not look like AWS. What does your client code look like?
It is possible that AWS S3 returns a different error than Scaleway (or @mosi-kha's S3 endpoint) when tusd tries to detect if the multipart upload still exists. The error message does look a bit odd:
api error NoSuchKey: UnknownError
tusd ignores some errors on purpose and it is possible that we need to include the errors from your endpoint in there as well. In the end, this boils down to an incompatibility between the S3 implementations.
Can I help with extending support for those errors somehow? :bulb:
What is the exact error that you are getting, @dargmuesli? Is its message exactly the same as the error reported by @mosi-kha?
You can also try on your own to adjust the error handling in https://github.com/tus/tusd/blob/5d0f1210b1fa6e24d4c3bb6c73a1ad8e8fc5956d/pkg/s3store/s3store.go#L697
A brief background: when tusd concatenates a file, is loads the state of all partial uploads. That includes listing the parts in its corresponding multipart upload to see if the upload is complete or not. If the multipart upload is not found, this is an indication that the upload has been completed. I assume that your S3 endpoint returns a slightly different error, so that our error handling does not recognize this.
I receive the following errors when trying to delete an upload on Scaleway:
2023/10/31 03:53:24.005699 level=INFO event=ResponseOutgoing method=DELETE path=823c95a07bfae1b851df10b616de3856+MGNiM2U1M2YtMTczMS00YjRiLWIyY2EtMzQzNWRkNWI0NTEw requestId="" id=823c95a07bfae1b851df10b616de3856+MGNiM2U1M2YtMTczMS00YjRiLWIyY2EtMzQzNWRkNWI0NTEw status=500 body="ERR_INTERNAL_SERVER_ERROR: Multiple errors occurred:\n\toperation error S3: AbortMultipartUpload, https response error StatusCode: 404, RequestID: txb7d0e76680e24406accd5-0065407a33, HostID: txb7d0e76680e24406accd5-0065407a33, api error NoSuchKey: The specified key does not exist.\n\n"
2023/10/31 03:53:24.004944 level=ERROR event=InternalServerError method=DELETE path=823c95a07bfae1b851df10b616de3856+MGNiM2U1M2YtMTczMS00YjRiLWIyY2EtMzQzNWRkNWI0NTEw requestId="" id=823c95a07bfae1b851df10b616de3856+MGNiM2U1M2YtMTczMS00YjRiLWIyY2EtMzQzNWRkNWI0NTEw message="Multiple errors occurred:\n\toperation error S3: AbortMultipartUpload, https response error StatusCode: 404, RequestID: txb7d0e76680e24406accd5-0065407a33, HostID: txb7d0e76680e24406accd5-0065407a33, api error NoSuchKey: The specified key does not exist.\n"
2023/10/31 03:53:23.719716 level=INFO event=RequestIncoming method=DELETE path=823c95a07bfae1b851df10b616de3856+MGNiM2U1M2YtMTczMS00YjRiLWIyY2EtMzQzNWRkNWI0NTEw requestId=""
The upload is deleted successfull though!
We probably need something like https://github.com/tus/tusd/pull/1019 for the upload termination in https://github.com/tus/tusd/blob/480420942cd831d7261e1c1bd08de88e494cadf7/pkg/s3store/s3store.go#L764 as well.
Maybe it would be a good time to refactor that error logic into a common isAwsNotFoundErr
method that checks for Not Found, NoSuchKey, and Forbidden errors. Then this could be used all throughout the S3 store
Hmm, it seems to be working for me now :thinking:
Alright, maybe their updated their API in the meantime. We depend on help from contributors like you to debug and fix these issues as we don't use S3-compatible service like Scaleway :) I will close this issue then, but feel free to continue here if the problem comes back.
I thought about how I could adjust the error handling, but I'm not experienced in Go enough to make the necessary changes and run the necessary build steps to debug this issue in a reasonable amount of time given the non-urgent priority I personally categorized this issue as :see_no_evil:
Are you still running into this issue? If not, then there is no need to adjust the code and we can close this issue.
I don't, but maybe it's still an issue for @mosi-kha?
Alright, thanks for the response. I will close this for now. @mosi-kha, if you are still running into these issues let us know and I will reopen it.
@Acconut @dargmuesli I tested it now with version 2.2.2 and it seems to be fixed Thank you for following up
Describe the bug in v1 everything is okay but in v2, in concatenation mode, after all chunks are uploaded and after call final url to concat files, tusd server raise below error and return 500 status code:
full logs in my test:
To Reproduce Steps to reproduce the behavior:
Expected behavior upload chunks and finalize concat chunks as a single file.
Setup details Please provide following details, if applicable to your situation:
tusd
?]