Supabase Storage "Bucket not found": causes, the fix, and why making the bucket public is the wrong one
Your app uploads or loads a file from Supabase Storage and gets:
{"statusCode":"404","error":"Bucket not found","message":"Bucket not found"} Images disappear, uploads fail, and it often works in one environment and not another. The error is simple. The fix has a trap: the quick answer is to make the bucket public.
What it means
Supabase Storage could not find a bucket with that exact name in this project. It does not mean the file is missing or that you lack permission. The bucket itself is not there, or the request is going to a different project or has a different name.
Note that a bucket you can see but are not allowed to read usually returns a different error ("not authorized" or an RLS message), not this one. Storage also returns 404 for private objects when you request them with a public URL, which looks the same.
The usual causes
- Bucket name mismatch.
avatarsvsAvatarsvsavatar. Names are case sensitive. - Different project. The deployed app points at a different Supabase URL than the one where you created the bucket (common between dev and prod).
- Bucket never created in production. Buckets made by hand in the dashboard do not travel with your code unless they are in a migration.
- Private bucket requested through the public URL. A URL like
/object/public/...only works for public buckets. - Typo or stray slash in the path built from user input.
The fix, in order
- In the dashboard, open Storage and compare the bucket name character by character with your code.
- Check the project URL in your deployed environment variables.
- Create the bucket in production, ideally through a migration so it is reproducible.
- For private files, request a signed URL with
createSignedUrlinstead of using the public path. - Add Storage policies on
storage.objectsso users can only read and write their own files.
The trap: "just make it public"
Setting the bucket to public fixes the error in one click, and exposes every file in it to anyone with the URL. That is fine for a logo. It is not fine for invoices, ID uploads, user documents or exports.
Public buckets also let anyone list objects if a policy allows it. Keep user content private, and serve it with signed URLs that expire.
Check what is reachable
After fixing, test from the outside, with no login: can you fetch a private file by guessing its path? The free read-only check at https://proofforge.live looks at a deployed site for leaked keys, open Supabase data and exposed files, and lists what it could not test. To check that one user cannot read another's files and rows, use the free two-account test: https://proofforge.live/two-account-test
Paid one-time fix reports are $9, $29 and $79, and the free scan does not require them.