{"record":{"id":"fa2d9a793940fd76","repo":"semaphoreui/semaphore","slug":"creating-socket-directory-w","errorCode":null,"errorMessage":"creating socket directory: %w","messagePattern":"creating socket directory: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/ssh/agent.go","lineNumber":63,"sourceCode":"\t\tif len(k.Passphrase) == 0 {\n\t\t\tkey, err = ssh.ParseRawPrivateKey(k.Key)\n\t\t} else {\n\t\t\tkey, err = ssh.ParseRawPrivateKeyWithPassphrase(k.Key, k.Passphrase)\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"parsing private key: %w\", err)\n\t\t}\n\n\t\tif err := keyring.Add(agent.AddedKey{\n\t\t\tPrivateKey: key,\n\t\t}); err != nil {\n\t\t\treturn fmt.Errorf(\"adding private key: %w\", err)\n\t\t}\n\t}\n\n\tif err := os.MkdirAll(path.Dir(a.SocketFile), 0o755); err != nil {\n\t\treturn fmt.Errorf(\"creating socket directory: %w\", err)\n\t}\n\n\tl, err := net.ListenUnix(\n\t\t\"unix\",\n\t\t&net.UnixAddr{\n\t\t\tNet:  \"unix\",\n\t\t\tName: a.SocketFile,\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"listening on socket %q: %w\", a.SocketFile, err)\n\t}\n\n\tl.SetUnlinkOnClose(true)\n\ta.listener = l\n\ta.done = make(chan struct{})\n\n\tgo func() {","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/semaphoreui/semaphore/blob/1774ccb71a0a8b82eb74ea24c23ac9ab713de2fa/pkg/ssh/agent.go#L45-L81","documentation":"Returned by Agent.Listen in pkg/ssh/agent.go when os.MkdirAll fails to create the parent directory of the SSH agent socket path. It fires on ordinary filesystem errors: the directory cannot be created because of permission denial, a path component is a file, the filesystem is read-only, or the TmpPath-derived location is otherwise invalid. The %w wraps the underlying os.PathError with the exact directory and errno.","triggerScenarios":"Thrown at pkg/ssh/agent.go:63 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped PathError for the failing directory and errno (EACCES, ENOTDIR, EROFS)","Ensure the Semaphore process user owns or can write to the configured TmpPath where agent sockets are created","Remove any regular file that occupies a path component of the intended socket directory","If TmpPath points to a read-only or container-mounted volume, point it at a writable scratch directory"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1774ccb71a0a8b82eb74ea24c23ac9ab713de2fa","analyzedAt":"2026-09-07T11:00:33.293Z","contentChangedAt":"2026-09-07T11:00:33.293Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}