Open saqibameen opened 1 month ago
Hello @saqibameen I cannot reproduce the issue.
Can you provide the code on how you are uploading the file using the signedUploadUrl?
@fenos so the error occurs at createSignedUploadUrl
not while using the the signedUploadUrl to upload a file. The snippet shared above is how I am trying to create a signedUploadUrl
.
@fenos
1.pdf
signedUploadUrl
to get a signedUrl and then createSignedUploadUrl
to upload1.pdf
and now need to overwrite the filesignedUploadUrl
again with same file 1.pdf
and you get an error that The resource already exists
signedUploadUrl
upsert doesn't workOur prod is impacted coz of this.
@thorwebdev has more context. FYI @kiwicopple
@ahmadawais I'm not able to reproduce this either. I tested with this: https://github.com/calcom/platform-starter-kit/blob/main/src/app/api/supabase/storage/route.ts#L18-L20 and it works fine. Can you double check your storage-js
version in your lock
file please?
You can verify that the upsert
param is being sent correctly by checking the storage logs (https://supabase.com/dashboard/project/_/logs/storage-logs) for the /object/upload/sign
request and validate that the "x_upsert": "true"
req header is set correctly. If that isn't the case, something is off with your supabase-js/storage-js versions!
@ahmadawais I'm not able to reproduce this either. I tested with this: https://github.com/calcom/platform-starter-kit/blob/main/src/app/api/supabase/storage/route.ts#L18-L20 and it works fine. Can you double check your
storage-js
version in yourlock
file please?
@thorwebdev the storage-js
version is 2.6.0. - @supabase/storage-js@2.6.0
@thorwebdev, @fenos thank you for checking. It turned out it was local only issue. It worked fine on production. I am now able to successfully generate uploadSignedUrl
with upsert
option.
Locally, I have updated the supabase package to latest and also tried updating the db container. I believe these logs: https://supabase.com/dashboard/project/_/logs/storage-logs are not locally available. Not sure why, any ideas?
Bug report
There is an existing issue, https://github.com/supabase/storage/issues/502 but it is closed without resolution.
Describe the bug
I am unable to create a signedUploadUrl if the file already exists. I am using
upsert: true
but it still gives resource already exists error.To Reproduce
Expected behavior
It should create a new signedUploadUrl.
System information
Additional context
Add any other context about the problem here.