{"record":{"id":"799965b4522521e4","repo":"openai/codex","slug":"alreadyexists-799965","errorCode":"AlreadyExists","errorMessage":"socket directory path exists and is not a directory: {}","messagePattern":"socket directory path exists and is not a directory: (.+?)","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/uds/src/lib.rs","lineNumber":118,"sourceCode":"    const SOCKET_DIR_MODE: u32 = 0o700;\n    const SOCKET_DIR_PERMISSION_BITS: u32 = 0o777;\n\n    pub(super) type Stream = UnixStream;\n\n    pub(super) struct Listener(UnixListener);\n\n    pub(super) async fn prepare_private_socket_directory(socket_dir: &Path) -> IoResult<()> {\n        let mut dir_builder = fs::DirBuilder::new();\n        dir_builder.mode(SOCKET_DIR_MODE);\n        match dir_builder.create(socket_dir).await {\n            Ok(()) => return Ok(()),\n            Err(err) if err.kind() == ErrorKind::AlreadyExists => {}\n            Err(err) => return Err(err),\n        }\n\n        let metadata = fs::symlink_metadata(socket_dir).await?;\n        if !metadata.is_dir() {\n            return Err(io::Error::new(\n                ErrorKind::AlreadyExists,\n                format!(\n                    \"socket directory path exists and is not a directory: {}\",\n                    socket_dir.display()\n                ),\n            ));\n        }\n\n        let permissions = metadata.permissions();\n        // The SSH-over-UDS control socket is reachable by path, so the\n        // rendezvous directory must be owner-traversable while denying\n        // group/other access; exact 0700 fixes insecure modes and unusable\n        // owner-only modes like 0600.\n        if permissions.mode() & SOCKET_DIR_PERMISSION_BITS != SOCKET_DIR_MODE {\n            fs::set_permissions(socket_dir, std::fs::Permissions::from_mode(SOCKET_DIR_MODE))\n                .await?;\n        }\n","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/uds/src/lib.rs#L100-L136","documentation":"Error \"socket directory path exists and is not a directory: {}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/uds/src/lib.rs:118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}