{"record":{"id":"601fd234ba6abec2","repo":"dagger/dagger","slug":"failed-to-create-temporary-known-hosts-file-w","errorCode":null,"errorMessage":"failed to create temporary known_hosts file: %w","messagePattern":"failed to create temporary known_hosts file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/git_remote.go","lineNumber":800,"sourceCode":"\t\t\tgo func() {\n\t\t\t\tselect {\n\t\t\t\tcase <-waitDone:\n\t\t\t\tcase <-time.After(10 * time.Second):\n\t\t\t\t\t_ = unix.Kill(-cmd.Process.Pid, unix.SIGKILL)\n\t\t\t\t}\n\t\t\t}()\n\t\tcase <-waitDone:\n\t\t}\n\t}()\n\terr := cmd.Wait()\n\tclose(waitDone)\n\treturn err\n}\n\nfunc mountKnownHosts(knownHosts string) (string, error) {\n\ttempFile, err := os.CreateTemp(\"\", \"known_hosts\")\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to create temporary known_hosts file: %w\", err)\n\t}\n\n\t_, err = tempFile.WriteString(knownHosts)\n\tif err != nil {\n\t\tos.Remove(tempFile.Name())\n\t\treturn \"\", fmt.Errorf(\"failed to write known_hosts content: %w\", err)\n\t}\n\n\terr = tempFile.Close()\n\tif err != nil {\n\t\tos.Remove(tempFile.Name())\n\t\treturn \"\", fmt.Errorf(\"failed to close temporary known_hosts file: %w\", err)\n\t}\n\n\treturn tempFile.Name(), nil\n}\n\nfunc mountResolv(dns *oci.DNSConfig) (string, error) {","sourceCodeStart":782,"sourceCodeEnd":818,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/git_remote.go#L782-L818","documentation":"mountKnownHosts could not create a temp file for the caller-supplied known_hosts content. A plain os.CreateTemp failure — usually /tmp being unwritable or full inside the engine, or a file-descriptor leak exhausting the process.","triggerScenarios":"Thrown at core/git_remote.go:800 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check /tmp write permissions and free space in the engine container","Look for fd leaks if EMFILE","Retry after the transient condition clears"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"82ba2681dbe30d3547a1dc50ea495900ab5b6047","analyzedAt":"2026-09-05T07:21:37.930Z","contentChangedAt":"2026-09-05T07:21:37.930Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}