astrid-runtime/astrid · error
FSKit lease paths must be absolute
Error message
FSKit lease paths must be absolute
What it means
validate_lease requires both resource_path and callback_path on the lease to be absolute paths. Relative paths cannot be safely resolved against the kernel's view of the filesystem, so any relative component causes rejection.
Source
Thrown at crates/astrid-storage-provider-fskit/src/service.rs:154
crate::validate_mountpoint_ancestors(&launch.mountpoint)?;
crate::validate_unmounted_mountpoint(&launch.mountpoint)?;
validate_control_path(&launch.control_path, &launch.lease.resource_path)?;
Ok(())
}
fn validate_lease(lease: &astrid_core::storage_filesystem::StorageMountLeaseV1) -> Result<()> {
if lease.lease_token.len() < 16 || lease.lease_token.len() > 4096 {
bail!("FSKit lease callback token is invalid");
}
let now = SystemTime::now()
.duration_since(UNIX_EPOCH)
.context("read system clock")?
.as_secs();
if lease.expires_at_epoch_secs < now {
bail!("FSKit lease is expired");
}
if !lease.resource_path.is_absolute() || !lease.callback_path.is_absolute() {
bail!("FSKit lease paths must be absolute");
}
#[cfg(target_os = "macos")]
astrid_core::fskit_socket::validate_callback_path(lease.mount_id, &lease.callback_path)
.map_err(anyhow::Error::msg)?;
#[cfg(not(target_os = "macos"))]
if lease.callback_path != lease.resource_path.join("control.sock") {
bail!("FSKit callback path is not the kernel lease endpoint");
}
platform_fs::validate_private_directory(&lease.resource_path)
.context("validate private FSKit lease resource")?;
platform_fs::verify_no_redirects(&lease.resource_path)
.context("reject redirected FSKit lease resource")?;
platform_fs::validate_private_file(&lease.resource_path.join("lease.json"))
.context("validate private FSKit lease manifest")?;
let manifest = std::fs::read(lease.resource_path.join("lease.json"))
.context("read FSKit lease manifest")?;
if manifest.len() > 64 * 1024 {
bail!("FSKit lease manifest exceeds the bounded size");View on GitHub (pinned to affd8760f4)
Solutions
- Make both paths absolute (prefix with '/') in the lease before launch
- Use std::fs::canonicalize or absolute() when constructing the paths
- Regenerate the lease from the provider, which always emits absolute paths
Example fix
// before resource_path: "leases/mount-1".into() // after resource_path: "/var/fskit/leases/mount-1".into()
Defensive patterns
Strategy: validation
Validate before calling
fn paths_absolute(lease: &StorageMountLeaseV1) -> bool {
lease.resource_path.is_absolute() && lease.callback_path.is_absolute()
} Type guard
fn is_absolute(p: &std::path::Path) -> bool { p.is_absolute() } Prevention
- Canonicalize paths (std::fs::canonicalize) before constructing leases
- Store absolute paths in config files; resolve relative paths at load time
- Reject relative paths at config-parse time with a clear message
When it happens
Trigger: validate_lease receives a StorageMountLeaseV1 where resource_path or callback_path lacks a leading '/' (e.g. "leases/abc" or "control.sock").
Common situations: Relative paths from a config file written with CWD assumptions; paths built with PathBuf::from("relative/x") in scripts; serialized leases where leading slashes were stripped.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- FSKit lease callback token is invalid
- FSKit callback path is not the kernel lease endpoint
- FSKit lease manifest exceeds the bounded size
- FSKit service mountpoint overlaps the lease resource
- FSKit lease is expired
AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09).
Data as JSON: /api/errors/3d1bc58abfe80c95.
Report an issue: GitHub.