{"record":{"id":"060cc978b3a1479d","repo":"jdx/mise","slug":"offline-mode-is-enabled-060cc9","errorCode":null,"errorMessage":"offline mode is enabled","messagePattern":"offline mode is enabled","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/oci/registry.rs","lineNumber":921,"sourceCode":"\n/// Push an OCI image layout directory to a registry reference.\n///\n/// Uploads only blobs the registry doesn't already have (HEAD check per\n/// blob), then PUTs the manifest under the reference's tag (or digest).\n/// Base-image blobs hosted on the same registry are cross-repo mounted\n/// instead of re-uploaded when possible.\n///\n/// With `update_index`, the manifest is pushed by digest and the tag is\n/// updated to an OCI image index that carries one entry per platform —\n/// the existing index's other-platform entries are preserved, so runners\n/// of different architectures can each push the same tag and end up with\n/// a multi-arch image.\npub(crate) async fn push_image(\n    image_dir: &Path,\n    reference: &str,\n    update_index: bool,\n) -> Result<PushSummary> {\n    eyre::ensure!(\n        !crate::config::Settings::get().offline(),\n        \"offline mode is enabled\"\n    );\n    let r = Reference::parse(reference)?;\n    let layout = ImageLayout {\n        root: image_dir.to_path_buf(),\n    };\n\n    // Resolve the layout's single manifest. `mise oci build` always writes\n    // exactly one manifest into index.json.\n    let index_bytes = crate::file::read(image_dir.join(\"index.json\"))?;\n    let index: ImageIndex = serde_json::from_slice(&index_bytes).wrap_err(\"parsing index.json\")?;\n    let manifest_desc = match index.manifests.as_slice() {\n        [one] => one,\n        [] => bail!(\"{}: index.json lists no manifests\", image_dir.display()),\n        many => bail!(\n            \"{}: index.json lists {} manifests; multi-manifest layouts are not supported\",\n            image_dir.display(),","sourceCodeStart":903,"sourceCodeEnd":939,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/oci/registry.rs#L903-L939","documentation":"`push_image` in src/oci/registry.rs requires network access to upload an OCI image to a registry, so it explicitly rejects execution while `Settings::offline()` is true with this guard before parsing the image reference. Unlike reads from a local OCI layout, pushing always contacts the remote registry, so offline mode makes it impossible by definition.","triggerScenarios":"Calling `push_image` (e.g. via `mise oci push` or an internal OCI publish flow) while `MISE_OFFLINE=1` or `[settings] offline = true` is configured.","commonSituations":"Publishing a tool image from a CI job that enabled offline mode to speed up/lock down installs; a developer who set offline globally for another task and then runs an image push; stale offline setting left in a project mise.toml.","solutions":["Disable offline mode for the push: `MISE_OFFLINE=0 mise oci push ...` or `mise settings set offline false`.","Move the push to a network-enabled step of your pipeline and keep offline mode only for install/resolve steps.","Remove the `offline = true` setting from any project-level mise.toml that unintentionally applies to the push command."],"exampleFix":"// before\n[settings]\noffline = true\n\n// after\n[settings]\n# offline removed — required for oci push\n","handlingStrategy":"validation","validationCode":"if crate::config::Settings::get().offline() {\n    eprintln!(\"skipping oci push: offline mode is enabled\");\n    return;\n}\npush_image(&dir, reference, update_index).await?;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run publish/push steps on network-enabled CI runners without offline settings.","Keep offline mode scoped to install-only steps via per-command env overrides.","Grep CI configs for MISE_OFFLINE / offline = true before adding image pushes."],"tags":["oci","network","offline-mode","config"],"backgroundTag":"feature-not-enabled","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}