{"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":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/oci/registry.rs","lineNumber":933,"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":915,"sourceCodeEnd":951,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/oci/registry.rs#L915-L951","documentation":"push_image (src/oci/registry.rs:933) refuses to push an OCI image to a registry while offline mode is enabled. Pushing inherently requires network access to the target registry, so the function checks `Settings::get().offline()` first and fails fast rather than making partial uploads that cannot complete.","triggerScenarios":"Calling OCI push_image (e.g. via `mise` OCI tool push workflows) with a valid image_dir and reference while MISE_OFFLINE=1 / `[settings] offline = true` / --offline is set. Notably reachable from tests like sparse_push_downloads_missing_bytes_when_head_is_unsupported as well as CLI usage.","commonSituations":"Running a push step in an offline CI job or air-gapped environment; MISE_OFFLINE left exported from a previous step or shell profile; user expected pushes to use a local registry/daemon but offline mode blocks all network egress.","solutions":["Disable offline mode: unset MISE_OFFLINE, remove `offline = true` from settings, or drop --offline, then retry the push.","If the target is a local registry, ensure it's reachable and still disable offline mode — the setting blocks all registry HTTP traffic.","In CI, scope MISE_OFFLINE only to pull/build steps, not the push step.","Verify with `mise settings get offline` where the flag originates and remove it there."],"exampleFix":"# before\nMISE_OFFLINE=1 mise oci push localhost:5000/tools/mytool:1.0\n# after\nunset MISE_OFFLINE\nmise oci push localhost:5000/tools/mytool:1.0","handlingStrategy":"validation","validationCode":"if std::env::var(\"MISE_OFFLINE\").is_ok() {\n  eprintln!(\"push skipped: MISE_OFFLINE is set\");\n  std::process::exit(1);\n}","typeGuard":null,"tryCatchPattern":"match push_result {\n  Err(e) if e.to_string().contains(\"offline mode is enabled\") => {\n    eprintln!(\"push requires network; unset MISE_OFFLINE for this step\");\n  }\n  other => other?,\n}","preventionTips":["Never export MISE_OFFLINE for push/deploy pipeline stages","Confirm registry reachability in the job before pushing","Use per-step env overrides in CI instead of job-wide offline flags"],"tags":["network","offline-mode","oci","push"],"backgroundTag":"feature-not-enabled","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}