S
Supabase2mo ago
R10

Failing to delete folders in storage/buckets.

We created a list of folders in a bucket this week and we attempted to do a big upload, maybe 80+ folders all at once. When we try to delete a few that are no longer needed we get the "Successfully Deleted", but after reloading or refreshing the page the folders are still there. Stuck in this loop of deleting and "succeeding".
40 Replies
garyaustin
garyaustin2mo ago
Delete does not error if it does not work. Is just the folder left or the files in the folder too? Also there is no delete of folders and you have to delete all the files individually.
R10
R10OP2mo ago
Just the folder is left, the files inside are able to be removed.
garyaustin
garyaustin2mo ago
Did you create the folders in the UI?
R10
R10OP2mo ago
Dragged and Dropped them from my PC
garyaustin
garyaustin2mo ago
edited to say folders
R10
R10OP2mo ago
Sorry, I'm confused what you mean by that.
garyaustin
garyaustin2mo ago
Did you create folders in the Storage UI and upload files into them?
R10
R10OP2mo ago
No I dragged the folder with the files already in it into the Storage UI.
garyaustin
garyaustin2mo ago
I just deleted an empty folder from the Dashboard Storage UI, refreshed it and it is gone.
R10
R10OP2mo ago
Would it help if I screen record it?
R10
R10OP2mo ago
Sorry the message got cropped in the top right, but it says "Successfully Deleted __" <- file name.
garyaustin
garyaustin2mo ago
Is the folder empty?
R10
R10OP2mo ago
Originally it wasn't it had files in it. After the first delete it removed them.
garyaustin
garyaustin2mo ago
I just checked and it does not have to be.... It showed a pop alert it was deleting all files and then deleted the folder. I don't use the Storage UI all that much. I've not been able to drag and drop a folder. Where do you drop it?
R10
R10OP2mo ago
just right on the column
No description
garyaustin
garyaustin2mo ago
OK I just dragged in a file folder with 3 files. It created the folder in the bucket and added the files. I then selected the delete option on the folder and it deleted all files and the folder. Do you have sub folders in the folder?
R10
R10OP2mo ago
I did yes, and they all had files in them. it deleted all those sub folders but not the main one itself.
garyaustin
garyaustin2mo ago
So far with just files in the folder it seems to work. I'll try a folder in the folder.
R10
R10OP2mo ago
If the sub folder is empty I think you'll get an error, doesn't let you upload if there is no file in it
garyaustin
garyaustin2mo ago
There was an issue awhile back with subfolders but it appears to be fixed... https://github.com/supabase/supabase/issues/19031
GitHub
Delete storage sub-folders issue · Issue #19031 · supabase/supabase
Deleting a top level folder (with a folder in it, with images in that) only results in the images being deleted, not the 2 parent folders. You have to delete the top level folder again for that to ...
R10
R10OP2mo ago
garyaustin
garyaustin2mo ago
Just dropped a folder with 2 files and a folder with 1 file. All showed up correctly. Then deleted main folder from UI and all files and folders are gone.
R10
R10OP2mo ago
Late last night I created another bucket to try and continue working. I no longer have this issue I'm talking about when trying to delete folders. But for some reason this specific bucket is bugged. I can't even delete the bucket itself, it says "Successful" and after refresh the bucket stil exists.
garyaustin
garyaustin2mo ago
From your video were those sub folders empty already? Or did files get removed with the delete and just folders left behind?
R10
R10OP2mo ago
Files got removed and the folders were left behind.
garyaustin
garyaustin2mo ago
Not at all sure what could cause this as the normal grants on storage.objects allow postgres role which I think is being used there. Unfortunately delete is silent on errors. Either RLS or files not found or matching return no error. Not sure that applies here specifically but not surprising there is no error coming back. Check the storage log? I'd restart the instance, try another browser and if the issue persists contact support or generate an issue in supabase/supabase.
R10
R10OP2mo ago
Do i have to backup any data up before restarting?
garyaustin
garyaustin2mo ago
No. Are you in production?
R10
R10OP2mo ago
yes.
garyaustin
garyaustin2mo ago
Then maybe not. Does not seem that big an issue if just the one bucket to even take a chance on the restart failing.
R10
R10OP2mo ago
... Oops. Well now I have to wait and see.
No description
R10
R10OP2mo ago
Should be fine.
garyaustin
garyaustin2mo ago
I've never had it fail...
R10
R10OP2mo ago
It restarted fine. Thoughts on this?
No description
garyaustin
garyaustin2mo ago
Before you were showing exercise. Did you have another one you were also working with? Never mind, that was a folder.
R10
R10OP2mo ago
Yes.
garyaustin
garyaustin2mo ago
So the bucket shows up in the UI but can't delete?
R10
R10OP2mo ago
Seems that way.
garyaustin
garyaustin2mo ago
See if the storage log has any more detail You don't have any storage trigger functions you may have added?
R10
R10OP2mo ago
I'll check Ah I found it, we have a table that still points to one of the sub folders using an image. So it can't delete it. Got it! The bucket is gone now. Until you said storage logs I had no idea Supabase had any. Thank you for the help!

Did you find this page helpful?