Setting up Storage Bucket - SOLVED
Having an issue when trying to setup a storage bucket with my application. It keeps saying "relation "objects" does not exist" and ive tried troubleshooting everything. I need help connecting the storage bucket and getting it to work with uploading media from my app to it. Thanks
23 Replies
"ERROR: 42501: must be owner of table objects" if try to set correct RLS it seems too
Please provide how you are setting up the bucket.
i have my media bucket created in the dashboard Storage. my app attempts to upload and the error i get is
❌ Storage upload failed: {statusCode: '500', code: 'DatabaseError', error: 'DatabaseError', message: 'insert into "objects" ("bucket_id", "metadata", "n… DEFAULT, $5) - relation "objects" does not exist'}
This error confirms that the storage.objects table doesn't exist in your Supabase project, which means the storage extension is not properly enabled.
Is this a hosted supabase instance?
What do you see if you go to this dashboard page https://supabase.com/dashboard/project/_/database/tables?schema=storage
shows my projects then when i click project i see the note
Currently viewing tables from a protected schema
The storage schema is managed by Supabase and is read-only through the dashboard.
And your app is using one of the REST clients to upload (like supabase-js)?
Do you see tables?

yes i see all those, all are X for realitime enabled
What is your upload call?
Does the dashboard UI allow you to upload?
.supabase.co/storage/v1/object/media/
dashboard does work manually entering media yes
What does your first line mean?
Are you not using a REST client?
await supabase.storage
.from('media')
.upload(fileName, file, {
cacheControl: '3600',
upsert: false
})
Check status here:

But if the dashboard UI worked....
all healthy ya
supabase-js is making the REST calls i believe. what i gave you is what im sending
Yes. You are.
This message is from where?

console in browser inspect
Do you have any triggers on storage?
Do you see the storage call in the Gateway API logs?
{statusCode: '500', code: 'DatabaseError', error: 'DatabaseError', message: 'insert into "objects" ("bucket_id", "metadata", "n… DEFAULT, $5) - relation "objects" does not exist'}
ya this shows up in api gateway calls
Check here if you added any triggers... https://supabase.com/dashboard/project/_/database/triggers
just have one, the standard one i beleive that updates timestamps
update_objects_updated_at
objects update_updated_at_column BEFORE UPDATE ROW
objects update_updated_at_column BEFORE UPDATE ROW
Otherwise I've got nothing else at the moment. Seems odd the UI is working for upload and the REST API is not. That error does not seem like a role one.
You could contact support but something is strange with the UI working.
If it were a grant issue you would get a permission error. Not found is not using storage.objects or having search path set which I would think would hit both.
i think i found it, search path was wrong. it was missing "storage" just "objects"
its working now! thanks for your help
not sure how that occured, bad setup on me i guess. but running
SHOW search_path;
showed me it was missing "storage"