Closed lmyslinski closed 8 months ago
Hello @lmyslinski thanks a lot for your feedback! Let's go step by step. Most of the issues are not real issues and how the protocol is supposed to work.
It's impossible to reupload files - I have to rename the files during the upload, as otherwise we get a 409, which I didn't manage to get around with custom policies
This is expected, since uploading a file on the same path (essentially overwriting a file) you are required to provide the x-upsert=true
header, if you don't pass this header storage will not allow you to upload to a path where a file already exists.
However, we do strongly recommend using the pattern of creating a unique name for each of the files like you are doing, since overwriting files on the same path will not bypass the browser cache and the CDN cache takes a little time to propagate the changes
See documentation: https://supabase.com/docs/guides/storage/uploads/resumable-uploads#overwriting-files
if the file name/metadata doesn't match between supabase and uppy, the upload just fails with a 404 - pretty much impossible to debug, I've fixed this with trial & error
Could you explain this further, not sure i understood this correctly
every successful TUS upload involves 404 calls - this should not be a part of a successful data flow
This is how the protocol works, when you start the upload of a file, tus creates a fingerprint and stores it in the local-storage, when you stop the upload and resume it later, TUS will re-use the same upload URL. it first sends a HEAD request to receive back the upload offset so that it can resume where it left-off. In case the upload is successful by default TUS doesn't remove that fingerprint from the local-storage see removeFingerprintOnSuccess, if you delete the file later on, it will try to call the same upload URL but it is now deleted so you'll receive a 404 and it will create a new upload url automatically.
So when I upload a file via Uppy with TUS, Uppy reports that the upload was successful. Yet, when I subsequently try to access the upload file on my backed, the file is not found
This issue is also caused by the flag removeFingerprintOnSuccess if not set to true
it uses the default value false
.
When the upload succeeds the browser still keeps the fingerprint of the file in the local-storage.
Due to a limitation of tus-node-server it is currently advised to set this value to true
, this should solve all the stability problems you are currently having with Resumable upload, since once the browser completes the upload will not be holding that reference in the local-storage for future lookups.
This happens roughly 5-10% of the time. This is a big no-go for me and I'm currently looking for a more stable alternative. I believe this is likely due to TUS implementation issues, I'd appreciate a recommendation for a more stable API
The protocol implementation is a Beta
feature in our current platform so there are currently small perks like the above.
However, we have contributed back to the TUS protocol a lot in the past months and we have improved stability dramatically, as a sneak-peak we will announce TUS to be out of beta very soon, entering a stable release.
We are also working on having TUS uploads embedded in the Supabase SDK so that we can set default values more consistently, (this will come a bit later the stable release)
for example:
await supbase.storage.from('bucket').resumableUpload('path', file, {
onProgress: (uploaded, remaining) => {},
})
the UI for storage is super slow Could you please send a support ticket i would be happy to look into this personally for you
Again, thanks a lot for the feedback.
I Hope with adding removefingerprintonsuccess: true
and the upcoming stable release of TUS you'll have a great experience with Storage
Let me know if you have any more questions
@fenos Thanks for the detailed response. I understand it's in beta - for now I've switched to XHR which works pretty well. I'll soon need to add bulk upload support so I'll give it another shot with removeFingerprintOnSuccess
Awesome! Closing for now, i'll update this issue when we release TUS stable release.
However, feel free to also update me here for anything else. In case we'll just re-open it. Thanks @lmyslinski
@lmyslinski resumable upload is now considered stable! 🎉 All the issues above mentioned are now resolved
@lmyslinski resumable upload is now considered stable! 🎉 All the issues above mentioned are now resolved
Hi im using "@uppy/core": "^3.9.2",
. Im experiencing what lmyslinski explained. uppy is saying the image upload succeeded but the actual image is not being uploaded to supabase. I've noticed this is only happening to some images
Hi im using
"@uppy/core": "^3.9.2",
. Im experiencing what lmyslinski explained. uppy is saying the image upload succeeded but the actual image is not being uploaded to supabase. I've noticed this is only happening to some images
I run in into this issue too, where the upload seems to succeed but nothing gets uploaded to Supabase. Clearing the cache/localstorage seems to fix the issue, for me. But not sure what's the cause exactly.
@lmyslinski resumable upload is now considered stable! 🎉 All the issues above mentioned are now resolved
Hi im using
"@uppy/core": "^3.9.2",
. Im experiencing what lmyslinski explained. uppy is saying the image upload succeeded but the actual image is not being uploaded to supabase. I've noticed this is only happening to some images
Also happens to me with uppy ^3.11.0
Hi im using
"@uppy/core": "^3.9.2",
. Im experiencing what lmyslinski explained. uppy is saying the image upload succeeded but the actual image is not being uploaded to supabase. I've noticed this is only happening to some imagesI run in into this issue too, where the upload seems to succeed but nothing gets uploaded to Supabase. Clearing the cache/localstorage seems to fix the issue, for me. But not sure what's the cause exactly.
I think I found my issue. I'll document it here in case anyone comes across this.
Totally not an expert, so take it with a bit of salt.
I'm using the TUS client in combination with Supabase and React. It seems that Uppy stores some data about the file to upload in localStorage. In my case, the problem was that uploading the same file twice in separate Uppy instances would not create a new localStorage entry. This, in turn, meant that Uppy assumed this File was already uploaded and just returned successfully. This interfered with my application logic, where I actually want to allow uploading the same file twice and treat them as completely separate entities.
The fix, for me, was to overwrite the file.id
for each file added to Uppy to give it a unique ID, which meant that a new localStorage entry would be created every time.
It looks something like this:
new Uppy({
autoProceed: true,
id: uppyId,
debug: false,
onBeforeFileAdded(currentFile) {
const newItemId = crypto.randomUUID();
const modifiedFile = {
...currentFile,
id: `${currentFile.id}-${newItemId}`, // <--- the important part
};
return modifiedFile;
},
})
The entierty of my Upload-Area code can be found below, in case anyone is curious. Be warned, it's a bit wild (and probably wrong)
```tsx
type CustomMeta = {
itemId?: UUID;
bucketName?: string;
objectName?: string;
contentType?: string;
};
export function UploadArea({
dispatch,
tierlistData,
pathname,
}: {
dispatch: (action: tierListActions) => void;
tierlistData: OptimisticTierlist;
pathname: string;
}) {
const supabase = createClient();
// https://github.com/transloadit/uppy/issues/3185
const tierlistDataRef = useRef
Same issue here for Supabase uploads using Tus. Uppy reports succesful upload for some images and videos files but they do not end up in the buckets.
My packages versions:
"@uppy/audio": "^2.0.0",
"@uppy/compressor": "^2.0.0",
"@uppy/core": "^4.0.1",
"@uppy/dashboard": "^4.0.1",
"@uppy/drag-drop": "^4.0.1",
"@uppy/drop-target": "^3.0.1",
"@uppy/file-input": "^4.0.0",
"@uppy/golden-retriever": "^4.0.0",
"@uppy/image-editor": "^3.0.0",
"@uppy/progress-bar": "^4.0.0",
"@uppy/react": "^4.0.1",
"@uppy/screen-capture": "^4.0.0",
"@uppy/tus": "^4.0.0",
"@uppy/webcam": "^4.0.0",
And I'm running locally Supabase 1.187.3.
Thankfully the fix mentioned by @1-Felix helped 🙌! Maybe it's worth reopening the ticket and checking the working solution @fenos.
I'm trying to use Supabase Storage with uploads via Uppy. Roughly 5-10% of my uploads fail, even though Uppy reports that the upload was completed. At this point, I'm actively looking for a more stable alternative. I've spent a couple of hours working around various issues, I'll try to describe everything I've encountered. I've used
https://github.com/supabase/supabase/tree/master/examples/storage/resumable-upload-uppy
as a base.So when I upload a file via Uppy with TUS, Uppy reports that the upload was successful. Yet, when I subsequently try to access the upload file on my backed, the file is not found (resulting in the 500 seen on the screenshot).
API error from the screenshot:
API code:
This happens roughly 5-10% of the time. This is a big no-go for me and I'm currently looking for a more stable alternative. I believe this is likely due to TUS implementation issues, I'd appreciate a recommendation for a more stable API. At this point I'm wondering whether using pre-signed URL's for uploads + XHR uploads from the server will be more stable. There's also more stuff that's problematic:
Here's the upload component: