fix(adapters): avoid single-quoted docker daemon probe over SSH exec - #422
Open
santhiprakash wants to merge 1 commit into
Open
fix(adapters): avoid single-quoted docker daemon probe over SSH exec#422santhiprakash wants to merge 1 commit into
santhiprakash wants to merge 1 commit into
Conversation
- Problem: Components tab reported Docker unhealthy on SSH-added servers even when `docker info` worked in the Terminal tab (oblien#408). - Fix: replace the Go-template `docker info --format` probe with a quote-safe `docker info >/dev/null` exit-status check. - Verification: `bun run test src/system/catalog.test.ts` (20 passed).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix Docker health check false negatives on SSH-added external servers by replacing the Go-template
docker info --formatprobe with a quote-safe exit-status check.Motivation
Closes #408.
On SSH-added servers, the Components tab reported Docker as unhealthy ("daemon not running") even though
docker info,docker ps, anddocker --versionall succeeded from the interactive Terminal tab on the same connection.Related issue
Closes #408
Changes
daemonCommandfromdocker info --format '{{.ServerVersion}}'todocker info >/dev/null 2>&1 && echo ok, avoiding single-quoted Go template braces that break when sshd wraps the exec command insh -c '…'.docker infoexit status.Problem
Concrete repro from #408: add an external server over password-auth SSH where Docker is installed and running. Terminal tab commands (
docker info,docker ps) succeed, but the Components tab health check callscheckDocker()→tryExec(executor, recipe.daemonCommand)withdocker info --format '{{.ServerVersion}}'. The inner single quotes terminate the outersh -cquote, the command fails,tryExec()swallows the error, and the UI shows "Docker is installed but the daemon is not running."Triage / Root cause
systemCatalog.checks.docker.daemonCommandembedded single-quoted Go template syntax. Non-interactive SSH exec runs the command through a shell wrapper; the inner'{{.ServerVersion}}'breaks quoting. The interactive Terminal tab uses a PTY shell path (SshExecutor.openShell) which does not hit this quoting issue.Fix
Use
docker info >/dev/null 2>&1 && echo ok— no embedded single quotes, relies on exit status only.checkDocker()already treats any non-emptytryExecresult as "daemon running"; the probe does not need to parse ServerVersion.Verification
Notes / Risks
SshExecutororcheckDocker()control flow.Checklist
bun run test,bun run --cwd <workspace> lint, andbun formatall pass locally