Skip to content

fix(cli): keep multiline function env working on restarts (CLI-3131) - #7607

Open
7ttp wants to merge 2 commits into
developfrom
7ttp/cli-3131-cli-supabase-start-fails-with-must-be-a
Open

7ttp wants to merge 2 commits into
developfrom
7ttp/cli-3131-cli-supabase-start-fails-with-must-be-a

Conversation

@7ttp

@7ttp 7ttp commented Nov 12, 2026

Copy link
Copy Markdown
Member

TL;DR

fixes supabase start and functions serve failing on every restart on Docker Desktop when supabase/functions/.env holds a multiline value

what's missing?

a multiline value such as a quoted PEM key was staged under supabase/.temp/start-secrets and bind mounted into the edge runtime.
stop deletes that folder and the next start recreates it, and Docker Desktop then fails the docker cp of the main service with must be a directory, so only the first start in a project ever worked

now fixed by:

the multiline env script and its values now ride in the same docker cp archive as the main service,
so the edge runtime no longer needs that host folder. a multiline-env folder left by an older CLI is removed on the next start

visual rep
flowchart TD
  A["supabase/functions/.env has a multiline value<br/>supabase start, stop, start again on Docker Desktop"]
  A -->|before| B["value staged in .temp/start-secrets/…/multiline-env<br/>and bind mounted into the edge runtime"]
  B --> C["stop deletes that folder, start recreates it"]
  C -.-> D["docker cp fails with must be a directory<br/>first start works, every restart fails"]
  A -->|now| E["script and values ride in the docker cp archive<br/>next to the main service, no host bind"]
  E --> F["every restart and functions serve start<br/>value arrives byte for byte"]
  classDef t fill:transparent
  class A,B,C,D,E,F t
Loading

ref:

@7ttp 7ttp self-assigned this Nov 12, 2026
@7ttp
7ttp requested a review from a team as a code owner November 12, 2026 18:49
@7ttp
7ttp requested a review from Coly010 November 12, 2026 18:49

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

Both independent reviews completed with no findings. Reading the changed code and surrounding implementation confirmed consistent archive paths, copy-before-start ordering, cleanup, and entrypoint behavior. No additional concrete issues or fundamental conflicts with the listed next-branch work were found. Tests were inspected but not run.

Findings

No issues found.

Stats

Claude findings: 0 · Codex findings: 0 · Confirmed: 0 · Refuted: 0 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: auto · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

@github-actions

Copy link
Copy Markdown
Contributor

CLI benchmark (Lightweight Commands): no changes found

Commit 14b6c1f against develop at d8f66a0 · 10 runs each · report only, never blocks merging

Command Workload Before After Change
supabase --version version 178 ms 172 ms no real change
supabase --help help 177 ms 188 ms no real change (+6%, within normal variation)
supabase init init 185 ms 182 ms no real change
supabase migration new bench migration-new 199 ms 189 ms no real change
supabase config convert config-convert 221 ms 221 ms no real change
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 246 ms 251 ms no real change
supabase projects list projects-list 226 ms 220 ms no real change
supabase functions list --project-ref replayfixtureprojref functions-list 237 ms 243 ms no real change

API calls: unchanged for all 8 commands.

Binary size: 134.8 MB, unchanged.

Details: timing ranges, API calls per command, slowest phases

Timing ranges

Command Workload Before range After range Change Verdict
supabase --version version 164-205 ms 165-218 ms -6 ms (-3%) within noise
supabase --help help 168-239 ms 158-232 ms +10 ms (+6%) within noise
supabase init init 166-202 ms 175-198 ms -2 ms (-1%) within noise
supabase migration new bench migration-new 180-237 ms 163-267 ms -9 ms (-5%) within noise
supabase config convert config-convert 204-266 ms 195-306 ms 0 ms (0%) within noise
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 218-295 ms 226-311 ms +5 ms (+2%) within noise
supabase projects list projects-list 208-272 ms 207-300 ms -6 ms (-3%) within noise
supabase functions list --project-ref replayfixtureprojref functions-list 217-252 ms 211-261 ms +6 ms (+2%) within noise

API calls per command

Command Workload Before After Endpoint changes
supabase --version version 0 0
supabase --help help 0 0
supabase init init 0 0
supabase migration new bench migration-new 0 0
supabase config convert config-convert 0 0
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 2 2
supabase projects list projects-list 1 1
supabase functions list --project-ref replayfixtureprojref functions-list 2 2

Slowest phases

No command moved beyond noise, so there are no phase deltas.

Workflow run

Comment /bench to run the lightweight benchmark (this comment) again on the latest commit, or /bench full to also run the integration-heavy benchmark, which posts in its own comment.

This branch has not been deployed

No deployments
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.

CLI: supabase start fails with "must be a directory" when supabase/functions/.env contains a multi-line value

1 participant