vercel/turborepo · error · std::io::Error

daemon socket path did not have an owner SID

Error message

daemon socket path did not have an owner SID

What it means

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.

Solutions

  1. Delete the daemon directory named in the startup logs so it is recreated with a fresh descriptor
  2. Repair ownership: `icacls <path> /setowner <user>` (may need an elevated shell)
  3. If neither works, report with output of `icacls <path>`

Example fix

icacls "%TEMP%\turborepo" /setowner %USERNAME% /t /c
rmdir /s /q "%TEMP%\turborepo"
turbo daemon start
Defensive patterns

Strategy: fallback

Try / catch

// null owner SID is unrecoverable in place: recreate the directory
if let Err(e) = daemon_start() {
    if e.to_string().contains("owner SID") {
        std::fs::remove_dir_all(socket_dir).ok();
        daemon_start()?; // recreated with a fresh descriptor
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: Machines rejoined to a domain or reimaged with stale descriptors Files restored from backup without security info Very rare on healthy NTFS volumes

Related errors


AI-assisted analysis of vercel/turborepo@f9245100cf (2026-08-17). Data as JSON: /api/errors/0ba931212babc0a4. Report an issue: GitHub.

Appendix: source

Thrown at crates/turborepo-daemon/src/endpoint.rs:372

            GetNamedSecurityInfoW(
                path.as_ptr(),
                SE_FILE_OBJECT,
                OWNER_SECURITY_INFORMATION,
                &mut owner,
                ptr::null_mut(),
                ptr::null_mut(),
                ptr::null_mut(),
                &mut descriptor,
            )
        };
        if result != ERROR_SUCCESS {
            return Err(std::io::Error::from_raw_os_error(result as i32));
        }
        if owner.is_null() {
            unsafe {
                LocalFree(descriptor as HLOCAL);
            }
            return Err(std::io::Error::new(
                std::io::ErrorKind::InvalidData,
                "daemon socket path did not have an owner SID",
            ));
        }

        Ok(OwnedSid {
            _descriptor: LocalAllocGuard(descriptor as HLOCAL),
            sid: owner,
        })
    }

    fn sid_to_string(sid: PSID) -> Result<String, std::io::Error> {
        let mut string_sid = ptr::null_mut();
        if unsafe { ConvertSidToStringSidW(sid, &mut string_sid) } == 0 {
            return Err(std::io::Error::last_os_error());
        }
        let string_sid = LocalStringSid(string_sid);
        let len = unsafe {

View on GitHub (pinned to f9245100cf)