{"record":{"id":"57fe4b359dd350ca","repo":"astrid-runtime/astrid","slug":"winfsp-failed-to-start-mount-with-status-status","errorCode":null,"errorMessage":"WinFsp failed to start mount with status {status:#x}","messagePattern":"WinFsp failed to start mount with status (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-provider-winfsp/src/win.rs","lineNumber":84,"sourceCode":"    }\n\n    let runtime = Arc::new(\n        tokio::runtime::Builder::new_multi_thread()\n            .enable_all()\n            .build()\n            .context(\"start WinFsp callback runtime\")?,\n    );\n    let callback = CallbackFs::new(lease.clone(), Arc::clone(&runtime))\n        .map_err(|failure| anyhow::anyhow!(\"build WinFsp callback filesystem: {failure:?}\"))?;\n    let control_path = provider_control_path(&lease.mount_id)?;\n    let control_listener = local_transport::bind(&control_path)\n        .with_context(|| format!(\"bind WinFsp control endpoint {}\", control_path.display()))?;\n    initialize_winfsp()?;\n    let mountpoint = U16CString::from_os_str(start.mountpoint.as_os_str())\n        .map_err(|_| anyhow::anyhow!(\"mountpoint is not valid UTF-16\"))?;\n    let filesystem = FileSystem::start(volume_params(lease.access), Some(&mountpoint), callback)\n        .map_err(|status| {\n            anyhow::anyhow!(\"WinFsp failed to start mount with status {status:#x}\")\n        })?;\n    wait_for_mountpoint_ready(&start.mountpoint)?;\n\n    let mut stdout = std::io::stdout().lock();\n    writeln!(stdout, \"READY {0}\", lease.mount_id).context(\"report WinFsp readiness\")?;\n    stdout.flush().context(\"flush WinFsp readiness\")?;\n\n    let result = runtime.block_on(daemon_loop(filesystem, control_listener));\n    if let Err(error) = result {\n        eprintln!(\"{PROVIDER_NAME}: daemon stopped after failure: {error:#}\");\n        return Err(error);\n    }\n    Ok(())\n}\n\nfn wait_for_mountpoint_ready(mountpoint: &Path) -> Result<()> {\n    let started = Instant::now();\n    loop {","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-winfsp/src/win.rs#L66-L102","documentation":"After constructing the callback FS, the daemon calls WinFsp's FileSystem::start with volume parameters and the UTF-16 mountpoint. If the WinFsp API returns a non-zero NTSTATUS, it is formatted as hex and wrapped in this error, meaning the kernel driver refused the mount.","triggerScenarios":"FileSystem::start fails with statuses like STATUS_ACCESS_DENIED (mountpoint busy or unauthorized), STATUS_OBJECT_NAME_COLLISION (mountpoint already used), STATUS_UNSUCCESSFUL (WinFsp driver not loaded), or invalid volume params.","commonSituations":"WinFsp not installed or its driver not running; mountpoint already in use by another mount; running without the privileges WinFsp requires; invalid volume parameters for the access mode.","solutions":["Decode the hex NTSTATUS in the message (e.g. 0xc0000022 = access denied) to identify the cause","Verify WinFsp is installed and the WinFsp driver/service is running (sc query WinFsp.Launcher)","Choose a free, existing mountpoint directory","Check volume_params/access settings against WinFsp requirements and run with sufficient privileges"],"exampleFix":"// before: bare status\n.map_err(|status| anyhow::anyhow!(\"WinFsp failed to start mount with status {status:#x}\"))?;\n// after: add mountpoint context\n.map_err(|status| anyhow::anyhow!(\"WinFsp failed to start mount with status {status:#x}\"))\n    .with_context(|| format!(\"mountpoint: {}\", start.mountpoint.display()))?;","handlingStrategy":"try-catch","validationCode":"// pre-flight checks before FileSystem::start\n// 1. WinFsp installed?\n// 2. driver service running?\nlet ok = std::process::Command::new(\"sc\")\n    .args([\"query\", \"WinFsp.Launcher\"])\n    .output().map(|o| o.status.success()).unwrap_or(false);\nif !ok { return Err(\"WinFsp driver/launcher not running\"); }","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"status 0xc0000022\") => bail!(\"access denied: run elevated or fix mountpoint ACLs\"),\n    Err(e) if e.to_string().contains(\"failed to start mount\") => {\n        // verify WinFsp install, free mountpoint, then retry once\n    }\n    r => r,\n}","preventionTips":["Install WinFsp and confirm the launcher service is running before mounting","Decode the hex NTSTATUS to identify the exact failure","Pick a free, existing mountpoint directory","Keep volume parameters compatible with the lease access mode"],"tags":["winfsp","windows","mount","ntstatus"],"backgroundTag":"http-error-response","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}