{"record":{"id":"0ba931212babc0a4","repo":"vercel/turborepo","slug":"daemon-socket-path-did-not-have-an-owner-sid","errorCode":null,"errorMessage":"daemon socket path did not have an owner SID","messagePattern":"daemon socket path did not have an owner SID","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"crates/turborepo-daemon/src/endpoint.rs","lineNumber":372,"sourceCode":"            GetNamedSecurityInfoW(\n                path.as_ptr(),\n                SE_FILE_OBJECT,\n                OWNER_SECURITY_INFORMATION,\n                &mut owner,\n                ptr::null_mut(),\n                ptr::null_mut(),\n                ptr::null_mut(),\n                &mut descriptor,\n            )\n        };\n        if result != ERROR_SUCCESS {\n            return Err(std::io::Error::from_raw_os_error(result as i32));\n        }\n        if owner.is_null() {\n            unsafe {\n                LocalFree(descriptor as HLOCAL);\n            }\n            return Err(std::io::Error::new(\n                std::io::ErrorKind::InvalidData,\n                \"daemon socket path did not have an owner SID\",\n            ));\n        }\n\n        Ok(OwnedSid {\n            _descriptor: LocalAllocGuard(descriptor as HLOCAL),\n            sid: owner,\n        })\n    }\n\n    fn sid_to_string(sid: PSID) -> Result<String, std::io::Error> {\n        let mut string_sid = ptr::null_mut();\n        if unsafe { ConvertSidToStringSidW(sid, &mut string_sid) } == 0 {\n            return Err(std::io::Error::last_os_error());\n        }\n        let string_sid = LocalStringSid(string_sid);\n        let len = unsafe {","sourceCodeStart":354,"sourceCodeEnd":390,"githubUrl":"https://github.com/vercel/turborepo/blob/f9245100cf0d31d96628804ead485f6bf226e55a/crates/turborepo-daemon/src/endpoint.rs#L354-L390","documentation":"path_owner_sid (endpoint.rs:372 region) calls GetNamedSecurityInfoW with OWNER_SECURITY_INFORMATION; the call returned ERROR_SUCCESS but wrote a null PSID for the owner. The daemon treats that as InvalidData: the on-disk security descriptor for the socket path claims to have no owner, an inconsistent state Windows should not normally produce.","triggerScenarios":"Daemon startup ownership check hitting a file/dir whose owner SID is missing — orphaned descriptor (owner account deleted and SID unreferenced), corruption, or non-standard filter drivers altering descriptors.","commonSituations":"Machines rejoined to a domain or reimaged with stale descriptors Files restored from backup without security info Very rare on healthy NTFS volumes","solutions":["Delete the daemon directory named in the startup logs so it is recreated with a fresh descriptor","Repair ownership: `icacls <path> /setowner <user>` (may need an elevated shell)","If neither works, report with output of `icacls <path>` "],"exampleFix":"icacls \"%TEMP%\\turborepo\" /setowner %USERNAME% /t /c\nrmdir /s /q \"%TEMP%\\turborepo\"\nturbo daemon start","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// null owner SID is unrecoverable in place: recreate the directory\nif let Err(e) = daemon_start() {\n    if e.to_string().contains(\"owner SID\") {\n        std::fs::remove_dir_all(socket_dir).ok();\n        daemon_start()?; // recreated with a fresh descriptor\n    }\n}","preventionTips":["After domain rejoins or profile restores, clear turborepo daemon dirs","Keep icacls output sane on dirs turbo owns"],"tags":["daemon","windows","security","sid","ownership"],"backgroundTag":"missing-owner-sid","analyzedSha":"f9245100cf0d31d96628804ead485f6bf226e55a","analyzedAt":"2026-08-17T10:46:15.696Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}