-
-
Notifications
You must be signed in to change notification settings - Fork 262
Description
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
The Storage API returns a 500 error with message relation "objects" does not exist when attempting to upload files, even though the storage.objects table exists and is accessible via direct SQL queries. This appears to be a Storage API service configuration issue where the service cannot access the storage schema.
Project Ref: xuopmhatztqhekepnxic
Request ID: 0199c13f-4f3a-7bbc-9861-201565b26709
Timestamp: 2025-10-08T00:36:16Z
## To Reproduce
Steps to reproduce the behavior:
- Create a private storage bucket named source-of-documents
- Configure RLS policies on storage.objects for tenant isolation
- Attempt to upload a file using either:
- Supabase JS client: supabase.storage.from('source-of-documents').upload(path, file)
- Direct curl: curl -X PUT https://xuopmhatztqhekepnxic.supabase.co/storage/v1/object/source-of-documents/5t6e8550-f4rt-41d4-a2123-43gf55441000%2Ftest.txt -H "Authorization: Bearer [JWT]" --data-binary @file.txt
- Observe 500 error
Error Response:
{
"statusCode": "500",
"code": "DatabaseError",
"error": "DatabaseError",
"message": "insert into \"objects\" (\"bucket_id\", \"metadata\", \"name\", \"owner\", \"owner_id\", \"user_metadata\", \"version\") values ($1, DEFAULT, $2, $3, $4, DEFAULT, $5) on conflict (\"name\", \"bucket_id\") do update set \"version\" = $6,\"owner\" = $7,\"owner_id\" = $8 returning * - relation \"objects\" does not exist"
}
What I've verified:
✅ storage.objects table exists (confirmed via SELECT * FROM pg_tables WHERE schemaname = 'storage' AND tablename = 'objects')
✅ Direct SQL INSERT works: INSERT INTO storage.objects (bucket_id, name, owner, metadata) VALUES (...)
✅ Permissions granted to authenticator role
✅ Bucket exists and is properly configured
✅ RLS policies are configured
## Expected behavior
File upload should succeed and return a 200/201 response with the uploaded file metadata.
## Screenshots
Error in browser console:
POST https://xuopmhatztqhekepnxic.supabase.co/storage/v1/object/source-of-documents/... 500 (Internal Server Error)
Upload error: {
statusCode: '500',
code: 'DatabaseError',
error: 'DatabaseError',
message: 'insert into "objects" ... - relation "objects" does not exist'
}
## System information
- OS: Windows
- Browser: Chrome (latest)
- Version of supabase-js: 2.x (using @supabase/supabase-js)
- Version of Node.js: 20.x
- Database: PostgreSQL 17.4
## Additional context
Timeline of failed attempts:
- 2025-10-08T00:36:16Z (curl with user JWT)
- 2025-10-07T19:52:00Z (browser upload)
- 2025-10-07T19:51:41Z (browser upload)
- 2025-10-07T19:44:19Z (browser upload)
Diagnosis: The Storage API service cannot access storage.objects even though the table exists. This suggests:
- Storage service has incorrect database connection configuration
- Storage service search_path doesn't include
storageschema - Storage service is connecting to wrong database
What works:
- Direct SQL queries to
storage.objectswork perfectly - Table ownership and permissions are correct
- Bucket and RLS policies are properly configured
Impact: This is blocking all file uploads in the application. The issue persists even after:
- Restarting the Supabase project
- Resetting role configurations
- Granting explicit permissions to all relevant roles
Please investigate the Storage API service configuration for project xuopmhatztqhekepnxic.