Supabase self-hosted s3 buckets not working.

I'm self-hosting supabase and I using the built in s3 storage with minio. Havent changed anything in the compose files. Startup command: sudo docker compose -f docker-compose.yml -f docker-compose.s3.yml up -d The issue In the supabase dashboard, when i create a bucket and try to upload data (through dashboard ui), the upload never finishes and throws an error: Failed to upload 1 file! It seems to me as if the buckets are not actually being created on the backend. I logged into the minio console and under what seems to be the root bucket "stub", none of my created supabase buckets show up, as a matter of fact, they dont show up anywhere.
25 Replies
breadcrumb
breadcrumbOP6mo ago
UPDATE: I can only NOT upload from the browser (?????), through the api works fine this is so frustrating trying to self-host because the docs are so trash and half the times it works half the time if anyone knows why i cant upload from the browser, let me know
dannyh
dannyh6mo ago
Calling the docs trash for a free product while asking for some free support for it?
garyaustin
garyaustin6mo ago
Usually the browser REST client access requires you meet RLS.
breadcrumb
breadcrumbOP6mo ago
I'll call them whatever I want. Just because you are providing a free service doesn't mean it can't be bad everything I said was true
garyaustin
garyaustin6mo ago
Not sure what you mean by "you" there. This is a user helping user forum and no employees will likely see or help here.
dannyh
dannyh6mo ago
Kind of affects their incentive to help you, doesn't it?
dannyh
dannyh6mo ago
Storage Quickstart | Supabase Docs
Learn how to use Supabase to store and serve files.
breadcrumb
breadcrumbOP6mo ago
I didn't call the service trash, the docs for self-hosting are thats not for self-hosting
garyaustin
garyaustin6mo ago
It is not clear your issue is self-hosting at this point. I asked if you had implemented RLS policies. That link discusses those and can generate the error you are seeing.
breadcrumb
breadcrumbOP6mo ago
Yes I have, yet still the browser upload doesnt seem to work
garyaustin
garyaustin6mo ago
If it works from the dashboard then likely your RLS is wrong or you do not have a user session (or what ever your RLS requires) in your client code.
breadcrumb
breadcrumbOP6mo ago
my policy supposedly grants public access to anyone so idk why it would matter
garyaustin
garyaustin6mo ago
Can you show your policy for insert? And your upload call. I guess you should also say what your error is.
breadcrumb
breadcrumbOP6mo ago
policy for select, insert, update, delete: (bucket_id = 'songs'::text) error is just: 1 file could not be uploaded!
garyaustin
garyaustin6mo ago
That is what you get back in the error object from your upload call?
breadcrumb
breadcrumbOP6mo ago
it just says exactly "Failed to upload 1 file!", nothing else. Uploads work fine through the api though
garyaustin
garyaustin6mo ago
By api do you mean the dashboard?
breadcrumb
breadcrumbOP6mo ago
by api, I mean using supabase through next.js in my case to upload files:
const { data, error } = await supabase.storage
.from("songs")
.upload(filePath, file, {
contentType: "audio/mp3",
});

if (error) {
console.error("Upload error:", error.message);
alert("Failed to upload song.");
return;
}
const { data, error } = await supabase.storage
.from("songs")
.upload(filePath, file, {
contentType: "audio/mp3",
});

if (error) {
console.error("Upload error:", error.message);
alert("Failed to upload song.");
return;
}
this works, manually dragging in files to my bucket through dashboard doesnt
garyaustin
garyaustin6mo ago
Ahh. I thought by browser you meant client code like you show.
breadcrumb
breadcrumbOP6mo ago
no
garyaustin
garyaustin6mo ago
So then it very much is likely something to do with self-hosting. Can you see uploaded files in the dashboard?
garyaustin
garyaustin6mo ago
GitHub
Supabase Upload Problem · supabase · Discussion #35342
Hello everyone, I am using a self-hosted Supabase instance through Coolify, and I have connected my Supabase storage to Cloudflare R2. I connected it using a Docker Compose file, similar to how you...
garyaustin
garyaustin6mo ago
A bit dated but a MinIO user was uploading from the dashboard (see last post). https://github.com/orgs/supabase/discussions/30341
GitHub
Storage Service Unable to Access MinIO in Self-Hosted Supabase Setu...
Environment Supabase Self-Hosted (Docker Compose) - currently testing on my Mac MinIO for S3 Storage Following the setup from Supabase self-hosting guide Issue I can see the bucket in the minio das...
breadcrumb
breadcrumbOP6mo ago
yes I can see them but not upload them

Did you find this page helpful?