Skip to content

fix: error when Docker is not running for static_files bundle (#5169)#5170

Open
ChrisJr404 wants to merge 1 commit intosupabase:developfrom
ChrisJr404:fix/static-files-docker-required-5169
Open

fix: error when Docker is not running for static_files bundle (#5169)#5170
ChrisJr404 wants to merge 1 commit intosupabase:developfrom
ChrisJr404:fix/static-files-docker-required-5169

Conversation

@ChrisJr404
Copy link
Copy Markdown

Summary

supabase functions deploy defaults to --use-docker (hidden flag, default true). When the Docker daemon is unreachable, the CLI prints WARNING: Docker is not running and silently falls back to the multipart API upload path. That path streams function source but does not produce the eszip bundle the edge runtime needs to interpret static_files, so any templates declared in config.toml are dropped server-side. The function deploys successfully, then fails at runtime when Deno.readTextFile() can't find its template.

This patch detects the case before any upload happens. If any enabled function has static_files configured and Docker is not running, the deploy aborts with:

Docker is not running, but static_files is configured for: send-auth-email.
Start Docker and re-run, or remove static_files from config.toml.

Functions without static_files keep the existing warning + API-fallback behaviour, so this is only stricter for the configurations that would otherwise ship broken.

A hard error is the right response here because the alternative is a silent regression that's only observable at runtime in production. The OP in #5169 explicitly accepts "throw an error" as the expected fix, and #4554 reported the same silent-drop behavior previously.

Closes #5169. Also addresses the silent-drop reported in #4554. Related discussion: https://github.com/orgs/supabase/discussions/45518

Files changed

  • internal/functions/deploy/deploy.go — pre-flight check before constructing the deploy options.
  • internal/functions/deploy/deploy_test.goTestDeployCommand/throws_error_when_static_files_configured_but_Docker_not_running simulates an unreachable Docker daemon (TCP listener bound then closed → IsErrConnectionFailed) and asserts the deploy returns an error mentioning Docker is not running, static_files, and the affected slug.

Test plan

  • go build ./...
  • go vet ./...
  • go test ./internal/functions/deploy/... (8/8 PASS, including the new case)
  • go test ./internal/functions/... (all packages green)

…upabase#5169)

When `supabase functions deploy` runs without `--use-api` and the Docker
daemon is unreachable, the CLI falls through to the multipart API path.
That path uploads function source but does not produce an eszip bundle,
so any `static_files` declared in `config.toml` are dropped server-side
and the deployed function silently ships without its templates.

Detect this case before deploying. If any enabled function has
`static_files` configured and Docker is not running, abort with a clear
error listing the affected slugs and the remediation. Functions without
`static_files` continue to fall back with the existing warning.

Closes supabase#5169. Also addresses the silent-drop reported in supabase#4554.
@ChrisJr404 ChrisJr404 requested a review from a team as a code owner May 5, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

static_files: bundle silently omits files when Docker daemon is not running (no warning, no error)

1 participant