Skip to content

fix: suggest recovery for Docker exec format errors - #5972

Closed
phuphung330 wants to merge 1 commit into
supabase:developfrom
phuphung330:fix/docker-exec-format-diagnostic
Closed

phuphung330 wants to merge 1 commit into
supabase:developfrom
phuphung330:fix/docker-exec-format-diagnostic

Conversation

@phuphung330

Copy link
Copy Markdown

Summary

  • capture bounded tail diagnostics from failed one-shot Docker jobs;
  • detect Docker exec format error output;
  • append a deduplicated, image-specific recovery hint;
  • add mocked regression tests for tail retention, failure-only detection, suggestion preservation/deduplication, and successful-command false-positive suppression.

Why

When an image entrypoint or shell cannot execute, Docker may report only exec format error followed by a generic exit code. The CLI can preserve that useful signal and point users to a narrow, non-automatic recovery path.

Scope

Diagnostic UX only. This change does not assert the CLI corrupts images, does not remove images, and does not change Docker state.

Validation

Targeted Go 1.26 tests and formatting/diff checks pass. Full ./internal/utils is not presented as green because existing mocked pull tests encountered registry-rate-limit failures in the test environment.

@phuphung330
phuphung330 requested a review from a team as a code owner July 28, 2026 11:08
@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for the contribution! This pull request isn't linked to a tracked issue, so it's being closed automatically.

Please open an issue first, wait for a maintainer to add the open-for-contribution label, then open a pull request that links the issue with a closing keyword (e.g. Closes #123).
See CONTRIBUTING.md for the full workflow. Once a maintainer adds the open-for-contribution label to a linked open issue, reopen or open a new pull request and it will be accepted.

@github-actions github-actions Bot closed this Jul 28, 2026
@phuphung330 phuphung330 mentioned this pull request Jul 28, 2026
2 tasks done

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 12d4ebab13

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

var stdoutLogs, stderrLogs boundedLogBuffer
err := DockerRunOnceWithStream(ctx, job.Image, job.Env, job.Cmd, io.MultiWriter(stdout, &stdoutLogs), io.MultiWriter(stderr, &stderrLogs))
if err != nil {
SuggestDockerExecFormat(stdoutLogs.String()+stderrLogs.String(), job.Image)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use the resolved Docker image in the recovery hint

When no INTERNAL_IMAGE_REGISTRY override is set, DockerStart resolves job.Image to the actual cached/pulled image URL (defaulting to public.ecr.aws, then ghcr.io, then Docker Hub) before creating the container, but this hint passes the original job image. If a normal supabase start init job fails with exec format error, the user is told to remove supabase/..., which does not remove the corrupted public.ecr.aws/... or ghcr.io/... image that was actually started, so retrying can keep using the bad image and the suggested recovery does not work.

Useful? React with 👍 / 👎.

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.

1 participant