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

MGS1043: a remote spell's lock entry is missing or stale

magus.yaml declares a remote spell, and magus.lock has no digest for it, or has one written for another tag:

[error] [MGS1043] spell ghcr.io/team/spells/lint: magus.yaml tracks tag "1.4" but
magus.lock was written for "1.3"; run the target that writes magus.lock with the update
charm (`magus run spell-lock:update`), or `magus spell lock --update` when that magusfile
imports this spell itself

Why

A tag is a pointer its publisher can move. Only the update charm asks a registry what a tag names now; every other run reads the digest the lock recorded, so two runs of one commit execute the same bytes. When the declaration and the lock disagree, the run has no digest it may use: resolving the tag itself would be the moving target the lock exists to prevent, and serving the old digest would run a version magus.yaml no longer asks for.

The failure is held against the one import, not the workspace. Every magusfile that does not import the spell still loads, including the one owning the lock target.

What to do

Run the target that declares magus.lock as its output with the update charm:

magus run spell-lock:update

It resolves every declared tag, pulls and verifies each manifest, and rewrites the lock. If that target's own magusfile imports the stale spell, it cannot load until the lock is repaired; run the command it wraps directly:

magus spell lock --update

Review the lock diff and commit it with the magus.yaml change. See Remote spells.

MGS1043magusfilespellsimportsremoteocimagus.locklockfileupdate
Last updated (139df068)
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.

Target

A named operation (build, test, ...) you invoke with magus run <target>; it may compose a spell's tool-native operations and depend on other targets. See targets.

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.

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

This page uses none of the site's convention markers. The full set is on the conventions page.