jdx/mise · critical

inline content

Error message

inline content

What it means

When building the OCI dotfiles layer, a FileMode::Content entry writes its inline payload; this expect fires if planning produced a Content-mode FileRequest with content = None. Request construction in src/system/files.rs sets mode Content and content together (line 271), so the panic indicates either an internal wiring bug or library misuse when callers assemble [dotfiles] requests by hand.

Source

Thrown at src/oci/builder.rs:918

                        file::read(entry.path())?,
                        source_mode(entry.path())?,
                    )?;
                }
            }
            FileMode::Template => {
                let rendered = crate::system::files::render_template(cfg, req)?;
                entries.add_file(
                    oci_target_path(req)?,
                    rendered.into_bytes(),
                    source_mode(&req.source)?,
                )?;
            }
            FileMode::Content => {
                entries.add_file(
                    oci_target_path(req)?,
                    req.content
                        .as_deref()
                        .expect("inline content")
                        .as_bytes()
                        .to_vec(),
                    0o600,
                )?;
            }
        }
    }

    info!("oci: adding {} [dotfiles] entries", requests.len());
    let (files, dirs) = entries.into_layer_inputs();
    layer::build_layer_from_files_and_dirs(&files, &dirs, owner)
}

fn collect_source_as_files(
    source: &std::path::Path,
    target: &str,
    entries: &mut DotfilesLayerEntries,
) -> Result<()> {

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Give the entry an explicit content = "..." value, or switch it to a source-based mode (copy/symlink)
  2. If the config looks valid, update mise and report the panic — the planner should never emit content-mode without content

Example fix

# before (mise.toml)
[dotfiles.motd]
mode = "content"
# content missing

# after
[dotfiles.motd]
mode = "content"
content = "welcome aboard"
Defensive patterns

Strategy: validation

Validate before calling

# Validate [dotfiles] content-mode entries before an OCI build
python3 - <<'PY'
import sys, tomllib
with open('mise.toml', 'rb') as fh:
    cfg = tomllib.load(fh)
for name, spec in (cfg.get('dotfiles') or {}).items():
    if spec.get('mode') == 'content' and not spec.get('content'):
        sys.exit(f'[dotfiles].{name!r}: mode=content requires a content value')
PY

Type guard

fn has_inline_content(req: &FileRequest) -> bool {
    match req.mode {
        FileMode::Content => req.content.is_some(),
        _ => true,
    }
}

Prevention

When it happens

Trigger: Running an OCI image build with a [dotfiles] entry that ends up in content mode without a content value — e.g. a code path or API caller that sets mode = content but never attaches the inline string.

Common situations: Hand-constructed FileRequest usage against mise's OCI builder APIs; regressions after changes to [dotfiles] planning; misconfigured [dotfiles] entries combined with template rendering paths.

Related errors


AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17). Data as JSON: /api/errors/08b6f5e134cfba44. Report an issue: GitHub.