jdx/mise · error · eyre::Report
remote action output directory is invalid
Error message
remote action output directory is invalid
What it means
parse_cache_directory validates a fetched output-directory object: it must deserialize as CacheDirectory, carry version==1, and its bytes must equal the canonical JSON re-serialization. Directory objects describe the output DAG of a cached action, so tampered or schema-mismatched bytes are rejected.
Source
Thrown at crates/mise-cache-core/src/agent.rs:1205
}
Ok(path)
}
fn parse_rustc_metadata(path: &Path) -> Result<RustcMetadata> {
let bytes = fs::read(path)?;
let metadata: RustcMetadata = serde_json::from_slice(&bytes)?;
if metadata.version != 1 || metadata.kind != "rustc" || canonical_json(&metadata)? != bytes
{
bail!("remote rustc action metadata is invalid");
}
Ok(metadata)
}
fn parse_cache_directory(path: &Path) -> Result<CacheDirectory> {
let bytes = fs::read(path)?;
let directory: CacheDirectory = serde_json::from_slice(&bytes)?;
if directory.version != 1 || canonical_json(&directory)? != bytes {
bail!("remote action output directory is invalid");
}
Ok(directory)
}
#[cfg(test)]
fn load_cache_directory(&self, digest: &CacheDigest) -> Result<CacheDirectory> {
let path = self
.find_verified_blob(digest)?
.ok_or_else(|| eyre::eyre!("remote action output directory is missing"))?;
Self::parse_cache_directory(&path)
}
fn validate_prefetched_action(
action: &PrefetchedAction,
verified: &BTreeMap<CacheDigest, PathBuf>,
rustc_metadata: &BTreeMap<CacheDigest, RustcMetadata>,
directories: &BTreeMap<CacheDigest, CacheDirectory>,
) -> Result<()> {View on GitHub (pinned to 6f52dcdf99)
Solutions
- Delete/overwrite the invalid directory blob so the owning action is re-executed and re-stored
- Align all writers and readers on the same mise-cache-core version
- Treat repeated failures as a corrupt remote entry: remove the whole action manifest entry for that task
Defensive patterns
Strategy: fallback
Try / catch
if let Err(e) = restore_prefetched(&agent).await {
if e.to_string().contains("remote action output directory is invalid") {
evict_remote_blobs_for_action(&digest).await?;
run_action_locally(&action).await?; // rebuild and re-store
} else { return Err(e); }
} Prevention
- Keep agent versions uniform so CacheDirectory schema (version 1) stays consistent
- Use immutable, digest-addressed uploads so partial writes cannot be observed
- Treat integrity errors as eviction triggers, not as fatal state
When it happens
Trigger: Remote cache serving a directory object from an incompatible writer version, a hand-edited object, or JSON that parses but was not written in canonical form.
Common situations: Shared remote bucket written by mixed agent versions; external tooling reformatting cache objects; interrupted uploads.
Related errors
- remote rustc action metadata is invalid
- task action manifest is not canonical JSON
- invalid task action identity
- invalid action prediction adapter
- local action result is invalid: {}
AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22).
Data as JSON: /api/errors/d914e632aeaed006.
Report an issue: GitHub.