-
-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot upload any file over 6MB to self-hosted supabase storage via dashboard #538
Comments
I'm also having this issue, @fgh-james that your console error is also missing the port used for uploading on local, same as mine (usually it would be http://localhost:54321 rather than just http://localhost). This looks similar to this bug: supabase/supabase#15703 A potential temporary solution might be to downgrade a couple of versions, mine only stopped working after updating to the latest one (CLI version 1.192.5, Storage API 1.11.0) |
@fgh-james so... I fixed this for me. It may be a mismatch between different docker image versions. I deleted then reinstalled all the docker images and it works perfectly again. I hope that works for you! |
Update: After a thorough investigation, I successfully resolved the issue in my case. The problem was traced back to the |
storage is returning an invalid location header request sent to this then causes an error either due to content mismatch (trying to post to http from https or 404 since its trying to send to an invalid port plus missing /storage/v1) i assume the bug is in here? storage/src/http/routes/tus/lifecycle.ts Line 86 in f950fc4
the request comes in from kong which is http.. :8000 and no path prefix of /storage/v1 |
I also have the same problem reported by @djsisson |
I want to clarify: This works fine if you call the storage container directly, however if your containers are behind a proxy (like kong, or even a double proxy, then this method of generating a URL doesn't work) However there is a work around, depending on your current setup this is what needs to be done: if you are behind a proxy, you need to move Kong onto port 80 to prevent the code from appending a port onto the url, so add this to your kong compose: - 'KONG_PROXY_LISTEN=0.0.0.0:80 reuseport backlog=16384, 0.0.0.0:443 http2 ssl reuseport backlog=16384' This is the defaults but moved to 80/443 update the following in the studio section - 'SUPABASE_URL=http://supabase-kong:80' since kong is no longer on 8000 Next add the following to the storage compose section - NODE_ENV=production This will force the url to be https, regardless if the proxy you are using is http or https Lastly you need to add a section to the kong yaml file to filter /uploads to storage as well ## Storage routes: the storage server manages its own auth
- name: storage-tus
_comment: 'Storage: /upload/* -> http://supabase-storage:5000/upload/*'
url: http://supabase-storage:5000/
routes:
- name: storage-tus-all
strip_path: false
paths:
- /upload/
plugins:
- name: cors with this, storage now generates valid location header urls (albeit missing /storage/v1) but that is picked up by the added section in kong.yml |
Thank you @djsisson for your quick reply!!! My situation is as follows: I have the same problem as described above: I make a request on |
I solved it by inserting in my proxy rever configuration 🍾 🍾 🍾 :
|
I spend a full day on this, tried every possible fix I could find. I couldn't get rid of the kong.yml ## Storage routes: the storage server manages its own auth
- name: storage-v1
_comment: 'Storage: /storage/v1/* -> http://storage:5000/*'
url: http://storage:5000/
routes:
- name: storage-v1-all
strip_path: true
paths:
- /storage/v1/
plugins:
- name: cors
- name: request-transformer
config:
add:
headers:
- 'Forwarded: host=\$(headers.host)/storage/v1;proto=https'
## Fix Storage large uploads
- name: storage-fix
_comment: 'Storage: /storage/v1:8000/* -> http://storage:5000/*'
url: http://storage:5000/
routes:
- name: storage-fix-all
strip_path: true
paths:
- /storage/v1:8000/
plugins:
- name: cors It's ugly AF but it works and I can finally go to sleep. P.S. Kong might be a great Enterprise choice but the FOSS version is limited and most people are not familiar with it. I'm pretty sure this bug is left in here on purpose (you can find issues over a year ago!) while the SaaS uses |
Bug report
Describe the bug
When uploading a file greater than 6MB in size to storage via the supabase dashboard in a self-hosted instance I receive the following error:
While the file is uploading, I receive this error multiple times in the browser console
I made sure to pull the latest docker images. This does not resolve the error.
To Reproduce
Expected behavior
Files up to 50MB should be able to be uploaded.
Screenshots
While uploading
Error
System information
Additional information
The text was updated successfully, but these errors were encountered: