magus v0.4.3 is out. See what's new
¶ View markdown source · ✎ Suggest an edit
1 min read

MGS1042: a remote spell does not match its digest

The registry answered, but with bytes other than the ones magus.lock pins for the import:

[error] [MGS1042] remote spell ghcr.io/o/r/spells/x: the registry served bytes that do
not match the pin: oci: manifest does not match the digest its reference pins: ...
served sha256:<actual>

Why

The digest is the only proof that the code about to run is the code the workspace chose when it last ran the update charm. A registry is content-addressed, so a mismatch means the host, a proxy, or something between them changed the bytes. magus cannot tell which, so it loads nothing and caches nothing. Only the imports of that spell fail; the rest of the workspace still loads.

What to do

Do not rewrite the lock to the reported value until you know why it differs. Pull the same digest from another network (magus spell pull <path> pulls exactly what the lock pins), or ask the publisher for the digest their publish printed. See Remote spells.

Offline

With MAGUS_OFFLINE set, magus never pulls, so a cached copy under $XDG_CACHE_HOME/magus/spells/ that no longer matches its pin fails with this code rather than being refetched:

[error] [MGS1042] remote spell ghcr.io/o/r/spells/x: the cached copy does not match the
pin and MAGUS_OFFLINE forbids a fresh pull: src/ does not match the layer

Something edited the cache. Unset MAGUS_OFFLINE once so magus replaces the entry, or delete the sha256-<digest> directory it names and load again with a network.

MGS1042magusfilespellsimportsremoteocidigestintegritymagus.lock
Last updated (139df068)
Earlier changes on this page (1)

Full history ↗ · Blame source ↗

Glossary

Workspace

The magus root directory that owns a set of projects and shared config; the unit magus operates over. See workspace.

Magusfile

The magusfile.buzz that declares a project's targets (as export funs) and binds its spells. See targets.

Op

A single tool-native command a target composes (long form: operation); the middle of the work hierarchy (Spell to Op to Target). See operations.

Spell

A language/runtime adapter (e.g. go, md) that maps generic targets onto a toolchain's real commands. See spells.

Charm

An execution modifier attached with : (lint:rw) that changes how a target runs, not which one; the built-in rw flips a check-only target to mutate in place, and ci always strips it. See charms.

Cache

The content-addressed store magus consults before running a target, so unchanged work is skipped. See cache.

CI

An ordinary magusfile-defined target you compose yourself with magus\needs - magus does not hardcode its stages. Magus.RunCI treats it specially only in that it strips the rw charm, it is the anchor magus affected ci keys off, and a selected scope with no project declaring it is a load error rather than a silent no-op. See targets.

Run

One target executing under one magus invocation, such as magus run test web or magus affected ci. A run keeps its captured output behind an output reference. Every magus run is a run whether or not any job asked for it; see Job for how the two relate.

Conventions

Placeholders

Angle brackets mark a value you replace with your own - never type the brackets:

magus run <target>
magus completion <shell>    # e.g. bash, zsh, fish

<target>, <path>, <shell>, <name> and the like are stand-ins, not literal text.