fix(preflight): detect stopped Docker daemon via exit code on macOS#2516
fix(preflight): detect stopped Docker daemon via exit code on macOS#2516jyanimaulik wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Docker reachability detection in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
When Colima or Docker Desktop is stopped on macOS, running
'docker info --format {{json .}}' with ignoreError:true still
produces non-empty stdout from the Docker CLI client layer.
assessHost() treated any non-empty output as confirmation the
daemon was reachable, setting dockerRunning=true incorrectly.
This caused nemoclaw onboard to report a false 'Docker is
running' at preflight [1/8] and then hang indefinitely at [2/8]
waiting for gateway health with a socket-not-found error.
Replace the stdout-content check with an exit-code check by
running 'docker info' with ignoreError:false first. A throw
indicates the daemon is unreachable; we catch it and set
dockerInfoOutput to an empty string so dockerReachable and
dockerRunning remain false. Only when the daemon responds
successfully do we follow up with the --format call.
Fixes NVIDIA#2348
d784c8d to
5568bfc
Compare
✨ Thanks for submitting this pull request that proposes a way to fix a bug where the Docker daemon status is incorrectly detected on macOS.Related open issues: Related open issues: |
Summary
Fixes #2348
Problem
assessHost() ran 'docker info --format {{json .}}' with ignoreError:true and treated non-empty stdout as proof the daemon was running. On macOS with Colima stopped, the Docker CLI still emits a client-side JSON struct without contacting the daemon, causing dockerRunning=true incorrectly. Onboarding then passed preflight [1/8] with a false positive and hung indefinitely at [2/8] waiting for gateway health.
Fix
Attempt 'docker info' with ignoreError:false first. If the daemon is unreachable it throws — caught and dockerInfoOutput set to empty string so dockerReachable and dockerRunning remain false. Only on success follow up with the --format call for structured JSON output.
Testing
Summary by CodeRabbit