{"record":{"id":"9f576059a32f212e","repo":"juanfont/headscale","slug":"starting-headscale-container-w-n-nunable-to-get","errorCode":null,"errorMessage":"starting headscale container: %w\\n\\nUnable to get diagnostic build output (command may have failed silently)","messagePattern":"starting headscale container: %w\\\\n\\\\nUnable to get diagnostic build output \\(command may have failed silently\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"integration/hsic/hsic.go","lineNumber":574,"sourceCode":"\t\t\tstartLine := 0\n\t\t\tif len(lines) > maxLines {\n\t\t\t\tstartLine = len(lines) - maxLines\n\t\t\t}\n\n\t\t\trelevantOutput := strings.Join(lines[startLine:], \"\\n\")\n\n\t\t\tif buildErr != nil {\n\t\t\t\t// The diagnostic build also failed - this is the real error\n\t\t\t\treturn nil, fmt.Errorf(\"starting headscale container: %w\\n\\nDocker build failed. Last %d lines of output:\\n%s\", err, maxLines, relevantOutput)\n\t\t\t}\n\n\t\t\tif buildOutput != \"\" {\n\t\t\t\t// Build succeeded on retry but container creation still failed\n\t\t\t\treturn nil, fmt.Errorf(\"starting headscale container: %w\\n\\nDocker build succeeded on retry, but container creation failed. Last %d lines of build output:\\n%s\", err, maxLines, relevantOutput)\n\t\t\t}\n\n\t\t\t// No output at all - diagnostic build command may have failed\n\t\t\treturn nil, fmt.Errorf(\"starting headscale container: %w\\n\\nUnable to get diagnostic build output (command may have failed silently)\", err)\n\t\t}\n\t}\n\n\tlog.Printf(\"Created %s container\\n\", hsic.hostname)\n\n\thsic.container = container\n\n\t// Get the dynamically assigned host port for metrics/pprof\n\thsic.hostMetricsPort = container.GetHostPort(\"9090/tcp\")\n\n\tlog.Printf(\n\t\t\"Headscale %s metrics available at http://localhost:%s/metrics (debug at http://localhost:%s/debug/)\\n\",\n\t\thsic.hostname,\n\t\thsic.hostMetricsPort,\n\t\thsic.hostMetricsPort,\n\t)\n\n\t// Write the CA certificates to the container","sourceCodeStart":556,"sourceCodeEnd":592,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/integration/hsic/hsic.go#L556-L592","documentation":"Last diagnostic branch: the initial container start failed and the diagnostic build produced no output at all (buildOutput == \"\"), so the real cause could not be captured. The message wraps the original error and notes the diagnostic command may have failed silently. This usually indicates the failure happened before/without any build output — e.g. daemon communication issues or a build command that errored immediately.","triggerScenarios":"BuildAndRunWithBuildOptions fails and the retry build invocation itself crashes or writes nothing (exec failure, daemon disconnect, output buffer problem). The original err is the only real signal available.","commonSituations":"Docker daemon restarting or disconnecting mid-operation; disk full so output cannot be written; dockertest build command invocation broken after tool upgrades.","solutions":["Rely on the wrapped original err — the diagnostic produced nothing","Check docker daemon health (docker info) and dmesg/systemd for daemon restarts","Re-run once after the daemon is stable; if reproducible, capture docker build output manually with the same Dockerfile","Check disk space on the Docker data root"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"docker info > /dev/null || echo \"daemon unhealthy — restart before running tests\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify daemon stability (docker info) when diagnostics come back empty","Check disk space on the Docker data root","Re-run once after daemon recovery; treat persistent silence as a daemon-level problem"],"tags":["integration-test","docker-build","diagnostics","docker-daemon"],"backgroundTag":null,"analyzedSha":"565fd254d06c4c7f9a8cad1714a43445c79ba420","analyzedAt":"2026-08-15T13:12:30.133Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}