Repository navigation
feat: surface critical dockerd and sysbox output in startup logs - #182
Draft
robo-coderai wants to merge 4 commits into
Draft
robo-coderai wants to merge 4 commits into
robo-coderai wants to merge 4 commits into
Conversation
dockerd and sysbox failures were only written to the envbox container's logs. For example, when dockerd ran out of disk at startup, the workspace startup logs only showed a later, misleading error. Child process lines that match a short list of actionable failures (no space left on device, dockerd and sysbox startup failures, logrus fatal) are now logged at error level and forwarded to the workspace startup logs. Forwarding runs off the output path so it never blocks the child, is deduplicated and capped per process run, and completes before the process exit is reported so the cause appears before envbox's own failure message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Temporary commit so CI exercises the new integration test. The job never sets CODER_TEST_INTEGRATION, so TestDocker and TestDocker_Nvidia skip. Drop before marking the PR ready. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…artupLogs docker.TempfsOptions serializes as "TempfsOptions", but the Docker API expects "TmpfsOptions", so the 64 KiB limit was dropped and dockerd started normally. Add CreateDockerCVMConfig.OuterTmpfs, which sets HostConfig.Tmpfs, and use it for /var/lib/docker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI passed with TestDocker enabled (run 45687984937), so the temporary change is no longer needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
When dockerd or sysbox fails at startup, the cause is only written to the envbox container's logs. In a recent incident dockerd exited with
failed to start daemon: ... mkdir /var/lib/docker/100000.100000/tmp: no space left on device, but the workspace startup logs only showedFailed to create Container-based Virtual Machine: kill cmd: kill proc: os: process already finished, so the cause was only visible throughkubectl logs.Child process output that matches a short list of actionable failures is now logged at error level and sent to the workspace startup logs, prefixed with the process name. The list covers
no space left on device, dockerd'sfailed to start daemon, sysbox-mgr and sysbox-fs startup failures, andlevel=fatal. Other child output still only goes to the container's logs.The misleading
kill proc: os: process already finishedmessage comes from a separate bug:Restartfails on a dockerd that has already exited, so thevfsfallback never runs. That fix will be a follow-up PR.Testing: unit tests in
background/process_test.gouse realshprocesses. A new integration test,TestDocker/CriticalOutputInStartupLogs, gives dockerd a 64 KiB tmpfs data root and checks that theno space left on deviceline reaches a fake Coder before the failure message. It uses a newCreateDockerCVMConfig.OuterTmpfsoption, because dockertest'sTempfsOptionsserializes under the wrong JSON key and Docker ignores its size limit.Note
The CI integration job never sets
CODER_TEST_INTEGRATION, soTestDockerskips in CI today. This branch enabled it temporarily and the full integration suite passed (run), then reverted it. Enabling it permanently is probably worth a separate PR. TheOSV Image Scannerfailure is unrelated: the scanner errors withunknown field "source"and fails onmaintoo.Refs:
https://linear.app/codercom/issue/CORE-423
🤖 Generated with Claude Code