jdx/mise · error

Failed to read schema at {}: {}

Error message

Failed to read schema at {}: {}

What it means

Same guard as the other HTTP methods: get_async_with_headers_allow_error_status checks the `offline` setting before sending and throws "offline mode is enabled" if set. The "allow error status" variant still performs no network I/O in offline mode — it only skips HTTP status validation after a successful request.

Source

Thrown at crates/mise-interactive-config/build.rs:60

    // then fall back to repo-root location (used during normal development)
    let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR"));
    let local_schema = manifest_dir.join("mise.json");
    let repo_schema = manifest_dir
        .parent()
        .unwrap()
        .parent()
        .unwrap()
        .join("schema/mise.json");
    let schema_path = if local_schema.exists() {
        local_schema
    } else {
        repo_schema
    };

    println!("cargo:rerun-if-changed={}", schema_path.display());

    let schema_content = fs::read_to_string(&schema_path)
        .unwrap_or_else(|e| panic!("Failed to read schema at {}: {}", schema_path.display(), e));

    let schema: Value = serde_json::from_str(&schema_content)
        .unwrap_or_else(|e| panic!("Failed to parse schema JSON: {}", e));

    let defs = schema.get("$defs");

    // Extract top-level properties and classify them
    let mut sections = Vec::new();
    let mut entries = Vec::new(); // (name, description, type)

    if let Some(properties) = schema.get("properties").and_then(|p| p.as_object()) {
        for (name, prop) in properties {
            // Skip deprecated and internal properties
            if prop
                .get("deprecated")
                .and_then(|d| d.as_bool())
                .unwrap_or(false)
            {

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Disable offline mode: unset MISE_OFFLINE or `mise settings set offline false`
  2. Set `offline = false` in the relevant mise.toml [settings] table
  3. Avoid code paths requiring remote lookups when offline; use cached/installed data

Example fix

// before
export MISE_OFFLINE=1
mise ls-remote node

// after
export MISE_OFFLINE=0
mise ls-remote node
Defensive patterns

Strategy: try-catch

Validate before calling

[ "${MISE_OFFLINE:-0}" = "0" ] || echo "offline mode on; request will be rejected"

Try / catch

if let Err(e) = client.get_async_with_headers_allow_error_status(url, &headers).await {
    if e.to_string().contains("offline mode") { use_cached_response(); return Ok(()); }
    return Err(e);
}

Prevention

When it happens

Trigger: Calling get_async_with_headers_allow_error_status while Settings::get().offline() is true (MISE_OFFLINE=1 or offline=true in settings).

Common situations: Backend version lookups or registry checks that tolerate non-2xx responses still being invoked while offline mode is enabled in the environment.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/92a55c08bd68b535. Report an issue: GitHub.