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
D3C0D34D
D3C0D34DOP2mo ago
"ERROR: 42501: must be owner of table objects" if try to set correct RLS it seems too
garyaustin
garyaustin2mo ago
Please provide how you are setting up the bucket.
D3C0D34D
D3C0D34DOP2mo ago
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.
garyaustin
garyaustin2mo ago
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
D3C0D34D
D3C0D34DOP2mo ago
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.
garyaustin
garyaustin2mo ago
And your app is using one of the REST clients to upload (like supabase-js)? Do you see tables?
garyaustin
garyaustin2mo ago
No description
D3C0D34D
D3C0D34DOP2mo ago
yes i see all those, all are X for realitime enabled
garyaustin
garyaustin2mo ago
What is your upload call? Does the dashboard UI allow you to upload?
D3C0D34D
D3C0D34DOP2mo ago
.supabase.co/storage/v1/object/media/ dashboard does work manually entering media yes
garyaustin
garyaustin2mo ago
What does your first line mean? Are you not using a REST client?
D3C0D34D
D3C0D34DOP2mo ago
await supabase.storage .from('media') .upload(fileName, file, { cacheControl: '3600', upsert: false })
garyaustin
garyaustin2mo ago
Check status here:
No description
garyaustin
garyaustin2mo ago
But if the dashboard UI worked....
D3C0D34D
D3C0D34DOP2mo ago
all healthy ya supabase-js is making the REST calls i believe. what i gave you is what im sending
garyaustin
garyaustin2mo ago
Yes. You are. This message is from where?
No description
D3C0D34D
D3C0D34DOP2mo ago
console in browser inspect
garyaustin
garyaustin2mo ago
Do you have any triggers on storage? Do you see the storage call in the Gateway API logs?
D3C0D34D
D3C0D34DOP2mo ago
{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
garyaustin
garyaustin2mo ago
Check here if you added any triggers... https://supabase.com/dashboard/project/_/database/triggers
D3C0D34D
D3C0D34DOP2mo ago
just have one, the standard one i beleive that updates timestamps update_objects_updated_at
objects update_updated_at_column BEFORE UPDATE ROW
garyaustin
garyaustin2mo ago
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.
D3C0D34D
D3C0D34DOP2mo ago
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"

Did you find this page helpful?