{"record":{"id":"7a0d0f5c33100b14","repo":"jdx/mise","slug":"should-not-be-called-for-system-tool","errorCode":null,"errorMessage":"should not be called for system tool","messagePattern":"should not be called for system tool","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/backend/asdf.rs","lineNumber":266,"sourceCode":"            sm = sm.with_env(k, value);\n        }\n        for (key, value) in tv.install_env() {\n            sm = match value.into_string() {\n                Some(value) => sm.with_env(key, value),\n                None => sm.without_env(key),\n            };\n        }\n        if let Some(project_root) = &config.project_root {\n            let project_root = project_root.to_string_lossy().to_string();\n            sm = sm.with_env(\"MISE_PROJECT_ROOT\", project_root);\n        }\n        let install_type = match &tv.request {\n            ToolRequest::Version { .. } | ToolRequest::Prefix { .. } => \"version\",\n            ToolRequest::Ref { .. } => \"ref\",\n            ToolRequest::Path { .. } => \"path\",\n            ToolRequest::Sub { .. } => \"sub\",\n            ToolRequest::System { .. } => {\n                panic!(\"should not be called for system tool\")\n            }\n        };\n        let install_version = match &tv.request {\n            ToolRequest::Ref { ref_: v, .. } => v, // should not have \"ref:\" prefix\n            _ => &tv.version,\n        };\n        // add env vars from mise.toml files\n        for (key, value) in config.env().await? {\n            sm = sm.with_env(key, value.clone());\n        }\n        let install = tv.install_path().to_string_lossy().to_string();\n        let download = tv.download_path().to_string_lossy().to_string();\n        sm = sm\n            .with_env(\"ASDF_DOWNLOAD_PATH\", &download)\n            .with_env(\"ASDF_INSTALL_PATH\", &install)\n            .with_env(\"ASDF_INSTALL_TYPE\", install_type)\n            .with_env(\"ASDF_INSTALL_VERSION\", install_version)\n            .with_env(\"MISE_DOWNLOAD_PATH\", download)","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/backend/asdf.rs#L248-L284","documentation":"The file download routine (used to fetch release artifacts) checks the `offline` setting before starting any download and throws \"offline mode is enabled\" if enabled. Downloads also write partial files keyed by a request hash; the offline guard prevents any of that network/IO work when the user opted out of network access.","triggerScenarios":"Calling the download method (with url, destination path, headers, reporter, total_timeout) while Settings::get().offline() is true — typically during `mise install`/upgrade with offline mode set.","commonSituations":"Installing a new tool version on a machine with MISE_OFFLINE=1; a CI job configured offline attempting to download artifacts not in cache.","solutions":["Disable offline mode: unset MISE_OFFLINE or `mise settings set offline false`","Set `offline = false` in the [settings] table of your mise.toml","Pre-download artifacts while online or point at a mirror reachable in your environment","Use already-installed tool versions instead of installing new ones while offline"],"exampleFix":"// before\n# CI job\nenv:\n  MISE_OFFLINE: \"1\"\nsteps: [\"mise install node@22\"]\n\n// after\nenv:\n  MISE_OFFLINE: \"0\"\nsteps: [\"mise install node@22\"]","handlingStrategy":"validation","validationCode":"# ensure offline mode is off before installing\n[ \"$(mise settings get offline)\" = \"false\" ] || { echo \"disable offline mode to install\"; exit 1; }","typeGuard":null,"tryCatchPattern":"match download_result {\n    Err(e) if e.to_string().contains(\"offline mode is enabled\") => Err(anyhow!(\"cannot download while offline; unset MISE_OFFLINE and retry\")),\n    other => other,\n}","preventionTips":["Pre-download tool artifacts before switching to offline mode","Don't set MISE_OFFLINE=1 in CI jobs that install tools","Use pre-warmed caches or internal mirrors when operating offline"],"tags":["network","offline","download","http"],"backgroundTag":"network-request-failed","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}