jdx/mise · error

additional_artifacts must be an array in lockfile

Error message

additional_artifacts must be an array in lockfile

What it means

In mise.lock, each platform entry's `additional_artifacts` field must be a TOML array of artifact tables. If the key exists but holds any other TOML type (string, integer, inline table, etc.), the parser rejects it because there is no sensible interpretation of a non-array artifact list.

Solutions

  1. Fix mise.lock so additional_artifacts is an array of artifact tables: additional_artifacts = [{ url = "...", checksum = "..." }].
  2. Remove the malformed additional_artifacts key and re-run `mise lock` to regenerate it.
  3. Restore the lockfile from version control if a merge corrupted it.

Example fix

// before (mise.lock)
additional_artifacts = "artifact.tar.gz"

// after
additional_artifacts = [{ url = "https://example.com/artifact.tar.gz", checksum = "sha256:..." }]
Defensive patterns

Strategy: validation

Validate before calling

const aa = platformEntry.get('additional_artifacts');
if (aa != null && !Array.isArray(aa)) throw new Error('additional_artifacts must be an array');

Type guard

function isArrayOrAbsent(v) { return v == null || Array.isArray(v); }

Prevention

When it happens

Trigger: Parsing a mise.lock where `additional_artifacts` under a tool's platform section is a non-array value — e.g. hand-edited to a string or table, or corrupted by a faulty merge.

Common situations: Manual lockfile edits that dropped the array brackets; TOML merge conflicts resolved incorrectly; scripts rewriting the lockfile without preserving the array structure.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/66bbbae4cecd4027. Report an issue: GitHub.

Appendix: source

Thrown at src/lockfile.rs:870

                    github_attestations
                };
                let signer = match t.remove("signer") {
                    Some(toml::Value::String(s)) => Some(s),
                    _ => None,
                };
                let attested_by = match t.remove("attested_by") {
                    Some(toml::Value::String(s)) if s == "repackager" => Some(s),
                    Some(toml::Value::String(s)) => {
                        bail!("unrecognized attested_by {s:?} in lockfile")
                    }
                    _ => None,
                };
                let additional_artifacts = match t.remove("additional_artifacts") {
                    Some(toml::Value::Array(values)) => values
                        .into_iter()
                        .map(|value| value.try_into().map_err(Report::from))
                        .collect::<Result<Vec<ArtifactInfo>>>()?,
                    Some(_) => bail!("additional_artifacts must be an array in lockfile"),
                    None => Vec::new(),
                };
                Ok(PlatformInfo {
                    install,
                    checksum,
                    size,
                    url,
                    url_api,
                    conda_deps,
                    pkgx_deps,
                    pkgx_provides,
                    pkgx_runtime_env,
                    provenance,
                    provenance_verified,
                    github_attestations,
                    signer,
                    attested_by,
                    additional_artifacts,

View on GitHub (pinned to 533346cc37)