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

  1. Delete/overwrite the invalid directory blob so the owning action is re-executed and re-stored
  2. Align all writers and readers on the same mise-cache-core version
  3. 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

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


AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22). Data as JSON: /api/errors/d914e632aeaed006. Report an issue: GitHub.