astrid-runtime/astrid · error

{launch_error:#}; failed to fully roll back unregistered FUS

Error message

{launch_error:#}; failed to fully roll back unregistered FUSE mount: {rollback_error:#}

What it means

preserve_launch_error combines a FUSE mount launch failure with a subsequent rollback failure. If the launch failed AND unregistering/cleanup also failed, both errors are chained into one message so neither is lost.

Source

Thrown at crates/astrid-storage-provider-fuse/src/rollback.rs:11

//! Fail-closed completion for mounts that never reached the durable registry.

use anyhow::{Result, bail};

pub(crate) fn preserve_launch_error(
    launch_error: anyhow::Error,
    rollback: Result<()>,
) -> anyhow::Error {
    match rollback {
        Ok(()) => launch_error,
        Err(rollback_error) => anyhow::anyhow!(
            "{launch_error:#}; failed to fully roll back unregistered FUSE mount: {rollback_error:#}"
        ),
    }
}

pub(crate) fn finish_cleanup(
    mut failures: Vec<String>,
    detach: Result<()>,
    cleanup: impl FnOnce() -> Result<()>,
) -> Result<()> {
    match detach {
        Ok(()) => {
            if let Err(error) = cleanup() {
                failures.push(format!("remove service artifacts: {error:#}"));
            }
        },
        Err(error) => failures.push(format!("detach mountpoint: {error:#}")),
    }

View on GitHub (pinned to affd8760f4)

Solutions

  1. Read the first segment ({launch_error:#}) for the root cause of the failed mount
  2. Read the second segment ({rollback_error:#}) to clean up leftover state manually (registry record, mountpoint)
  3. Manually unregister the mount record and lazy-unmount the leftover mountpoint
  4. Retry the whole operation once state is clean
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-validate lease before launch to avoid launch+rollback double failure
validate_lease(&lease)?; // checks mount_id, mountpoint, provider fields

Try / catch

match result {
    Err(e) if e.to_string().contains("failed to fully roll back") => {
        // e contains both launch and rollback causes; clean both manually
        manual_unregister(&mount_id);
        let _ = lazy_unmount(&mountpoint);
    }
    r => r,
}

Prevention

When it happens

Trigger: A FUSE mount launch fails (bad lease, spawn error), then the rollback path (unregister from registry, kill daemon, lazy unmount) also errors — e.g. the registry lock cannot be taken or the mountpoint cannot be unmounted.

Common situations: Partial-failure during a crashed prior run: registry record already gone plus mountpoint busy; concurrent operations mutating the registry while rollback runs; unmount needing root while launch failed for an unrelated reason.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09). Data as JSON: /api/errors/f8b30ff43ba519b2. Report an issue: GitHub.