Cannot upload file in self hosted storage
I can't seem to upload any kind of file in supabase self hosted storage. I tried from the console and the issue still persist
27 Replies
are you on a mac?
No, windows. But I'm using docker for this. I saw there are similar issues, but I'm not too sure about it
Are you using supabase cli to run supabase locally? What version?
I'm using docker for that, i simply follow the guide on how to host supabase using docker. How do i check the version tho?
The versions for the different services used in the image can be found in https://github.com/supabase/supabase/blob/master/docker/docker-compose.yml since the docs suggest to clone the repo and use those files
GitHub
supabase/docker/docker-compose.yml at master · supabase/supabase
The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications. - supabase/supabase
Do you not see any errors in logs or the UI?
Yes, i clone the repo as the guide says in self hosted section
I haven't checked the log, but on UI it's all normal. Basically it's starting in 0%, stuck there and just says upload failed
Can you try with a small file < 1MB? I've a hunch why this is happening
A moment
No luck
it says like this, but failed to see the response

And you haven't made any changes to the cloned repo?
nothing
Try this https://stackoverflow.com/a/79633771/18954618
After making the change, run this command
docker compose up -d --force-recreate and clear browser local storagea moment
it works. thanks. But, may you help explain why this happened?
Supabase dashboard uploads files in chunks which which are greater than a certain size (Can't remember the threshold).
- By default, it tries to upload these chunks to
/upload/resumable path and right now the api gateway doesn't handle this route.
- When this env var is added, it uploads file chunks to /storage/v1/upload/resumable which is handled by api gateway.
- Have to clear the local storage because tus (library used by dashboard to chunk files and upload) stores entries for failed uploads in browser's storage with the old path
This could have also been solved by adding config for handling /upload/resumable path in volumes/api/kong.yaml but this env var is the easier way.Ah ok, thank you for the explanation. I'll keep that in mind
Also, this method only works when there is no reverse proxy in front of kong gateway (what you're using right now)
In the future if you decide to use nginx or caddy in front of supabase then you'll need to modify config accordingly.
Probably not, because I'm a mobile dev and not a backend. I just want to experiment a bit with self hosted, that's all
But thanks for the tips, maybe it'll be useful for me next time
Then I'd recommend to use supabase cli. Its better suited for dev environment. Also the image versions are more up to date
Does supabase cli different from docker? Sorry I don't quite understand this whole docker and backend stuff
supabase cli also uses docker to run containers. But it allows you to manage all the config with a file
config.toml
cli is updated frequently so you'll be using the latest features supabase has to offer
its the same thing as what you're using right now, just what you're using right now is quite behind and can be hard to manageAh ok, thanks. I'll try to look it up
Hi um, the problem also happened using supabase cli. But I can't seem to fix it since it's not using normal docker.yaml
Try this. Inside the supabase directory, there should be a
.temp folder. Inside this .temp folder, create a file called studio-version(No file extension) and add this text inside file
Now take down the stack and restart againAlr, I'll give it a try. Thanks man
@Gab Sorry to bother you. You mentioned that you're on windows pc. Are you running edge functions locally?
No, i haven't tried on edge function yet. still learning the basic of supabase
If you have some time, can you set one up right now? I just need to know about a behavior on windows