{"record":{"id":"3f1a37d15e67d3e8","repo":"juanfont/headscale","slug":"unexpected-end-of-container-wait","errorCode":null,"errorMessage":"unexpected end of container wait","messagePattern":"unexpected end of container wait","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/hi/docker.go","lineNumber":30,"sourceCode":"\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/cenkalti/backoff/v5\"\n\t\"github.com/docker/docker/api/types/container\"\n\t\"github.com/docker/docker/api/types/image\"\n\t\"github.com/docker/docker/api/types/mount\"\n\t\"github.com/docker/docker/client\"\n\t\"github.com/docker/docker/pkg/stdcopy\"\n\t\"github.com/juanfont/headscale/integration/dockertestutil\"\n)\n\nconst defaultDirPerm = 0o755\n\nvar (\n\tErrTestFailed              = errors.New(\"test failed\")\n\tErrUnexpectedContainerWait = errors.New(\"unexpected end of container wait\")\n\tErrNoDockerContext         = errors.New(\"no docker context found\")\n\tErrMemoryLimitViolations   = errors.New(\"container(s) exceeded memory limits\")\n)\n\n// runTestContainer executes integration tests in a Docker container.\n//\n//nolint:gocyclo // complex test orchestration function\nfunc runTestContainer(ctx context.Context, config *RunConfig) error {\n\tcli, err := createDockerClient(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"creating Docker client: %w\", err)\n\t}\n\tdefer cli.Close()\n\n\trunID := dockertestutil.GenerateRunID()\n\tcontainerName := \"headscale-test-suite-\" + runID\n\tlogsDir := filepath.Join(config.LogsDir, runID)\n","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/cmd/hi/docker.go#L12-L48","documentation":"Wrapped error from newLoginHTTPClient when newDebugJar() fails to construct the cookie jar used by the OIDC login HTTP client. The hostname prefix identifies which node's login flow failed. cookiejar.New essentially only fails on nil options misconfiguration, so in practice this is near-unreachable.","triggerScenarios":"doLoginURL / OIDC login flow where cookiejar.New(nil) returns an error — only possible if the net/http cookiejar constructor rejects its options, which with nil options it does not in current Go.","commonSituations":"Essentially defensive coding; would only fire after a stdlib behavior change or a very unusual runtime corruption.","solutions":["Treat as non-actionable if seen once; verify Go toolchain version matches the repo's pinned version (go.mod, nix develop).","Re-run the test to rule out transient runtime failure."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil {\n    if strings.Contains(err.Error(), \"creating cookiejar\") {\n        // non-actionable defensive failure; verify toolchain and retry once\n    }\n    return err\n}","preventionTips":["Use the repo's pinned Go toolchain (nix develop) to avoid stdlib drift.","Do not build on this branch of the code; it is defensive only."],"tags":["integration","http","cookiejar","oidc","defensive"],"backgroundTag":null,"analyzedSha":"565fd254d06c4c7f9a8cad1714a43445c79ba420","analyzedAt":"2026-08-15T13:12:30.133Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}