zed-industries/zed · error

actions.json not found at {}: {}

Error message

actions.json not found at {}: {}

What it means

The docs preprocessor loads a generated actions.json from its crate manifest dir (via CARGO_MANIFEST_DIR) to validate action documentation. Outside CI a missing file only prints a warning and disables action validation; inside CI (the CI env var is set) it panics with the asset path and the io error. Hitting it means the generation step that produces actions.json was skipped before the docs build ran in CI.

Source

Thrown at crates/docs_preprocessor/src/main.rs:669

#[derive(Debug, serde::Deserialize)]
struct ActionManifest {
    actions: Vec<ActionDef>,
    #[serde(default)]
    schema_definitions: serde_json::Map<String, serde_json::Value>,
}

fn load_all_actions() -> ActionManifest {
    let asset_path = concat!(env!("CARGO_MANIFEST_DIR"), "/actions.json");
    match std::fs::read_to_string(asset_path) {
        Ok(content) => {
            let mut manifest: ActionManifest =
                serde_json::from_str(&content).expect("Failed to parse actions.json");
            manifest.actions.sort_by(|a, b| a.name.cmp(&b.name));
            manifest
        }
        Err(err) => {
            if std::env::var("CI").is_ok() {
                panic!("actions.json not found at {}: {}", asset_path, err);
            }
            eprintln!(
                "Warning: actions.json not found, action validation will be skipped: {}",
                err
            );
            ActionManifest {
                actions: Vec::new(),
                schema_definitions: serde_json::Map::new(),
            }
        }
    }
}

fn handle_postprocessing() -> Result<()> {
    let logger = zlog::scoped!("render");
    let mut ctx = mdbook::renderer::RenderContext::from_json(io::stdin())?;
    let output = ctx
        .config

View on GitHub (pinned to f4178619ac)

Solutions

  1. Run the repo's action-manifest generation step (the one that writes crates/docs_preprocessor/actions.json) before the docs build in CI
  2. Verify the artifact exists after generation: ls crates/docs_preprocessor/actions.json
  3. Keep generation and docs build in the same CI job, or cache the generated file between them
  4. Reproduce locally with CI=1 to confirm the fix

Example fix

# before (CI job)
cargo run -p docs_preprocessor   # panics: actions.json not found at ...

# after (CI job)
script/generate-actions-json      # the repo's manifest generation step
cargo run -p docs_preprocessor
Defensive patterns

Strategy: validation

Validate before calling

#!/bin/sh
# CI preflight before running docs_preprocessor
ACTIONS="$(dirname "$0")/../crates/docs_preprocessor/actions.json"
[ -f "$ACTIONS" ] || { echo "actions.json missing; run the generation step first" >&2; exit 1; }

Prevention

When it happens

Trigger: A CI job running the preprocessor without the prior step that generates actions.json; building from a copied or packaged tree where CARGO_MANIFEST_DIR no longer contains the asset; packaging rules excluding generated JSON.

Common situations: New or refactored CI pipelines dropping the generation step; clean-cache runners; building from a source tarball that never contained generated files.

Related errors


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/f2bbf8d01f54087c. Report an issue: GitHub.