{"record":{"id":"7cae857c5c2c6b3e","repo":"juanfont/headscale","slug":"writing-tls-certificate-to-container-w-7cae85","errorCode":null,"errorMessage":"writing TLS certificate to container: %w","messagePattern":"writing TLS certificate to container: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"integration/tsic/tsic.go","lineNumber":604,"sourceCode":"\t}\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"%s could not start tailscale container (version: %s): %w\",\n\t\t\thostname,\n\t\t\tversion,\n\t\t\terr,\n\t\t)\n\t}\n\n\tlog.Printf(\"Created %s container\\n\", hostname)\n\n\ttsic.container = container\n\n\tfor i, cert := range tsic.caCerts {\n\t\terr = tsic.WriteFile(fmt.Sprintf(\"%s/user-%d.crt\", caCertRoot, i), cert)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"writing TLS certificate to container: %w\", err)\n\t\t}\n\t}\n\n\treturn tsic, nil\n}\n\n// Shutdown stops and cleans up the Tailscale container.\nfunc (t *TailscaleInContainer) Shutdown() (string, string, error) {\n\tstdoutPath, stderrPath, err := t.SaveLog(\"/tmp/control\")\n\tif err != nil {\n\t\tlog.Printf(\n\t\t\t\"saving log from %s: %s\",\n\t\t\tt.hostname,\n\t\t\tfmt.Errorf(\"saving log: %w\", err),\n\t\t)\n\t}\n\n\treturn stdoutPath, stderrPath, t.pool.Purge(t.container)","sourceCodeStart":586,"sourceCodeEnd":622,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/integration/tsic/tsic.go#L586-L622","documentation":"Error \"writing TLS certificate to container: %w\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at integration/tsic/tsic.go:604 when the library encounters an invalid state.","commonSituations":"Writing the TLS certificate into the tailscale container failed. Ensure the container is running and the certificate files were generated.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (writing TLS certificate to container); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (writing TLS certificate to container); retry the operation after fixing the input, configuration, or environment.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"565fd254d06c4c7f9a8cad1714a43445c79ba420","analyzedAt":"2026-08-15T13:12:30.133Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}