App Finishers

Fix guide · updated 2026-11-16

Supabase Storage "Object not found"

{"statusCode":"404","error":"not_found","message":"Object not found","code":"NoSuchKey"}

Downloading a file, creating a signed link or opening a public URL fails with "Object not found". The server answers HTTP 400 with "statusCode":"404" inside, and supabase-js shows StorageApiError: Object not found. Storage found no file at that path that this user may read. We reproduced each cause with the real storage-js client (2.119) and Supabase's Storage server (storage-api 1.95), November 2026.

What the error means

Two different problems give the same answer: there's no file at that exact path in that bucket, or there is one but this user isn't allowed to read it. Storage doesn't tell you which. In our test, a private file asked for by another user, by a visitor who wasn't signed in, or signed for another user all answered "Object not found", exactly like a file that doesn't exist.

Cause 1: the path repeats the bucket name

upload() returns two paths. In our test: {"path":"u1.png","fullPath":"avatars/u1.png"}. The path goes with .from('avatars'). The fullPath already contains the bucket, so .from('avatars').download('avatars/u1.png') looked for avatars/u1.png inside the bucket and got "Object not found".

Cause 2: capital letters

Paths are case-sensitive. In our test, a file uploaded as Photo.PNG wasn't found as photo.png. Phone photos often come as IMG_1234.JPG, and code that lowercases names in one place but not another breaks here.

Cause 3: no read policy for this user

In a private bucket, a user can only read the files that a select policy on storage.objects allows. Our policy allowed each user their own files. Another user, and a visitor, got "Object not found" for the same path that worked for its owner. createSignedUrl() needs that same read access: for another user, it failed with "Object not found" too.

Cause 4: the file isn't there

The upload failed and nobody checked its error, the file was removed, or it's in another bucket. The check below shows which.

Cause 5: a public URL with a wrong path

getPublicUrl() never asks the server, so it never fails. It builds an address from whatever path you give it. The error shows up only when the browser loads it, often as a broken image: in our test, HTTP 400 with {"statusCode":"404","error":"not_found","message":"Object not found","code":"NoSuchKey"} for a missing file and for a path with the wrong capitals.

Not the cause

A leading slash didn't matter: supabase-js removed it, so /lead.png was saved as lead.png, and download('/u1.png') worked. Neither did a space: my file.png downloaded both as 'my file.png' and as 'my%20file.png'.

The quiet ones: no error, nothing done

A signed link that worked, then stopped

Signed links expire after the seconds you gave createSignedUrl(). Then the server answers {"statusCode":"400","error":"InvalidJWT","message":"\"exp\" claim timestamp check failed","code":"InvalidJWT"}. In our test, a 2-second link worked at once and failed 3.5 seconds later. Save the file's path in your table, not the signed link, and create a fresh link when you show the file.

The one-minute check

Find the file and its exact name, bucket and owner in the SQL Editor:

select bucket_id, name, owner_id, created_at
from storage.objects
where name ilike '%u1.png%';

No row: the file isn't there (cause 4). A row with different capitals or a longer name: causes 1 and 2. The row is there exactly as you asked for it: look at the policies (cause 3):

select policyname, cmd, roles, qual
from pg_policies
where schemaname = 'storage' and tablename = 'objects';

Fix 1: save the path upload() gives you

const { data, error } = await supabase.storage.from('avatars').upload(`${user.id}/avatar.png`, file);
if (error) throw error;
await supabase.from('profiles').update({ avatar_path: data.path }).eq('id', user.id);

// later
const { data: blob } = await supabase.storage.from('avatars').download(profile.avatar_path);

Use data.path with the same bucket, never data.fullPath. Build names in your code, such as lowercase with the user's id as the folder, instead of keeping whatever name the file came with.

Fix 2: a read policy that matches who reads

For "each user reads their own files":

create policy "read own avatars" on storage.objects
for select to authenticated
using (bucket_id = 'avatars' and owner_id = (select auth.uid())::text);

If other people must see the files, such as profile pictures on a public page, make the bucket public and use getPublicUrl(), or write a policy for who may read them.

If an AI tool built your app

Give your AI tool this prompt:

Supabase Storage answers "Object not found" in my app. List every storage call (upload, download, createSignedUrl, getPublicUrl, remove) with its bucket and the path it uses. Make sure the code saves data.path from upload() and passes it with the same bucket, never a path that starts with the bucket name, and that paths keep the same capitals everywhere. Store paths in the database, not signed URLs, and create signed URLs when showing a file. Check the select policies on storage.objects for each private bucket. Show me each change before making it.

Not quite your error?

Still stuck?

Download the same path with the service role key in a server script. If that works, the file is there and a policy blocks your user (cause 3). If it fails too, the path or bucket is wrong.

Other Supabase problems? See Supabase fixes.