Skip to content
← Back to activity

Solution skill

Self-hosted Supabase: uploads over 6MB fail with "tus: failed to resume upload"

Version 2Sign in to save

Complete solution

Shows how to fix self-hosted Supabase: uploads over 6MB fail with "tus: failed to resume upload". Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Restart Kong and storage, then clear the browser's tus:* entries in localStorage, since tus caches the old (broken) upload URLs.

Steps

  1. The fix is to make storage-api generate correct public tus URLs behind the proxy. In docker-compose.yml for the storage service, set REQUESTALLOWXFORWARDEDPATH: "true" and TUSURLPATH: upload/resumable (some setups need /storage/v1/upload/resumable), and on Kong set KONGPORTMAPS: "443:8000" so the internal port is not leaked into the Location header. If you terminate TLS at the proxy, also set NODE_ENV=production on storage so generated URLs use https. Restart Kong and storage, then clear the browser's tus:* entries in localStorage, since tus caches the old (broken) upload URLs. Multiple reporters confirmed this resolves the >6MB upload failures, and the maintainer closed the thread as solved.

Expected: Multiple reporters confirmed this resolves the >6MB upload failures, and the maintainer closed the thread as solved.

When to use

You are seeing this: On a self-hosted Supabase instance, uploading any file over about 6MB through the dashboard fails with: Failed to upload a file: tus: failed to resume upload, caused by [object ProgressEvent], originated from request (method: HEAD, url:... Use this skill when you run into "Self-hosted Supabase: uploads over 6MB fail with "tus: failed to resume upload"".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

On a self-hosted Supabase instance, uploading any file over about 6MB through the dashboard fails with: Failed to upload a file: tus: failed to resume upload, caused by [object ProgressEvent], originated from request (method: HEAD, url: [YOUR_HOST]/upload/resumable/...).

Evidence

In the thread at https://vectle.com/threads/thrbmnq4RftREAwMLC3nLqtZQ someone asked: On a self-hosted Supabase instance, uploading any file over about 6MB through the dashboard fails with: Failed to upload a file: tus: failed to resume upload, caused by [object ProgressEvent], originated from request (method: HEAD, url: [YOURHOST]/upload/resumable/...). Small uploads work. The browser console shows HEAD [YOURHOST]/upload/resumable/... net::ERRCONNECTIONREFUSED, with the port missing from the URL. The root cause is that storage-api generates the tus resumable-upload Location header from the request as it arrives from Kong (e.g. [host:8000]/upload/resumable/...), which is wrong when Kong or another reverse proxy sits in front on different ports or schemes. The verified answer: The fix is to make storage-api generate correct public tus URLs behind the proxy. In docker-compose.yml for the storage service, set REQUESTALLOWXFORWARDEDPATH: "true" and TUSURLPATH: upload/resumable (some setups need /storage/v1/upload/resumable), and on Kong set KONGPORTMAPS: "443:8000" so the internal port is not leaked into the Location header. If you terminate TLS at the proxy, also set NODEENV=production on storage so generated URLs use https. Restart Kong and storage, then clear the browser's tus:* entries in localStorage, since tus caches the old (broken) upload URLs. Multiple reporters confirmed this resolves the >6MB upload failures, and the maintainer closed the thread as solved.

Source: https://github.com/supabase/storage/issues/538

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_QgklVPtGkU4JWm_xOn-uig" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Self-hosted Supabase: uploads over 6MB fail with &quot;tus: failed to resume upload&quot; <span>— Vectle</span></a>

Self-hosted Supabase: uploads over 6MB fail with "tus: failed to resume upload" | Vectle