{"record":{"id":"aea0260b162fa163","repo":"astrid-runtime/astrid","slug":"read-fuse-volume-metadata-error","errorCode":null,"errorMessage":"read FUSE volume metadata: {error:?}","messagePattern":"read FUSE volume metadata: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-provider-fuse/src/filesystem.rs","lineNumber":43,"sourceCode":"use volume_info::VolumeInfo;\n\n// Astrid is the authority and may be changed through another principal view or\n// native client. Do not let the kernel serve stale lengths or bytes from an\n// earlier callback result.\nconst ATTRIBUTE_TTL: Duration = Duration::ZERO;\n\n/// Start a real kernel FUSE session for one admitted lease.\npub(crate) type FuseBackgroundSession = fuser::BackgroundSession;\n\n/// Mount the filesystem and return the owner-owned background session.\npub(crate) fn start_session(\n    lease: StorageMountLeaseV1,\n    mountpoint: &Path,\n) -> Result<FuseBackgroundSession> {\n    let access = lease.access;\n    let filesystem = AstridFuseFilesystem::new(lease);\n    let info = VolumeInfo::read(&filesystem.callback)\n        .map_err(|error| anyhow::anyhow!(\"read FUSE volume metadata: {error:?}\"))?;\n    let mount_option = match access {\n        StorageProviderAccessV1::ReadOnly => MountOption::RO,\n        StorageProviderAccessV1::ReadWrite => MountOption::RW,\n    };\n    let mut config = Config::default();\n    config.mount_options = vec![\n        MountOption::FSName(info.volume_name),\n        MountOption::Subtype(\"astrid\".to_owned()),\n        mount_option,\n        MountOption::DefaultPermissions,\n        MountOption::NoDev,\n        MountOption::NoSuid,\n        MountOption::NoExec,\n    ];\n    config.acl = SessionACL::Owner;\n    config.n_threads = Some(1);\n    config.clone_fd = false;\n    let session = Session::new(filesystem, mountpoint, &config)","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-fuse/src/filesystem.rs#L25-L61","documentation":"start_session reads VolumeInfo via the FUSE filesystem callback before mounting; if that metadata read fails the session cannot be configured, and the underlying error is wrapped with this context. It indicates the FUSE callback layer failed to supply volume metadata (name, owner, capacity).","triggerScenarios":"Calling start_session (from linux_native_fuse_mount_supports_all_required_operations) where VolumeInfo::read(&filesystem.callback) returns Err — e.g. the callback's metadata implementation fails or panics internally.","commonSituations":"Bugs or version mismatches in the fuser VolumeInfo plumbing; a lease missing fields the callback needs to synthesize metadata; running an unsupported fuser version on the test host.","solutions":["Inspect the wrapped {error:?} detail to find the underlying VolumeInfo::read failure.","Verify the fuser crate version matches the one the filesystem callback was written against.","Check that StorageMountLeaseV1 carries the fields the metadata callback requires (mount id, access mode, principal)."],"exampleFix":"// before\nlet info = VolumeInfo::read(&filesystem.callback)?;\n// after\nlet info = VolumeInfo::read(&filesystem.callback)\n    .map_err(|e| anyhow::anyhow!(\"read FUSE volume metadata: {e:?}\"))?;","handlingStrategy":"try-catch","validationCode":"// preflight: ensure the lease carries the fields the metadata callback needs\nassert!(!lease.mount_id.is_empty(), \"lease must have a mount id\");","typeGuard":null,"tryCatchPattern":"match start_session(lease, &mountpoint).await {\n    Ok(session) => run(session).await,\n    Err(e) => {\n        // {error:?} includes the underlying VolumeInfo::read cause\n        eprintln!(\"FUSE session failed: {e:#}\");\n        cleanup_partial_mount(&mountpoint);\n    }\n}","preventionTips":["Pin the fuser crate version to match the callback implementation.","Log lease contents before mounting so metadata callback failures are debuggable.","Add a unit test that VolumeInfo::read succeeds for a representative lease."],"tags":["fuse","linux","mount","metadata"],"backgroundTag":"file-read-failed","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"}