Skip to content

Diagnostic codes ​

Every problem Laft reports has a stable code. The letter says which part found it, and laft explain <code> prints the explanation and fix for the codes of the system configuration and the resolver.

PrefixFound by
EStav, while it parses, type checks and evaluates a file. See the Stav error codes.
Claft, when it validates and activates the system configuration.
S, W0xxThe resolver, when it chooses the packages of a view.
Rlaft-build, when it checks recipes and stage files.
Blaft-build, when it fetches, builds and packages.
W1xxlaft-build post-processing, for things it accepts but reports.
Tlaft-build plan, for the reason a package is rebuilt.
console
$ laft explain c0901
C0901: A package reference does not resolve against the synced indexes.

fix: Fix the name, or run `laft repo sync` when the package is new.

System configuration ​

Stav checks types, refinements, required fields and references. After evaluation, laft applies these rules. C0409 to C0413 come up while the accounts are activated rather than while the file is checked.

CodeProblemFix
C0405A user or group name is not valid.Use a name of lowercase letters, digits, _ and - that starts with a letter, at most 32 characters.
C0406A user sets both password_hash and password_file.Keep one of them.
C0407An explicit uid or gid lies in a range reserved for the static system accounts.Leave the id out, so that Laft allocates one, or pick one from 1000 on.
C0408The id of root or of a static account was changed.Remove the id. Static accounts have the same ids on every Laft system.
C0409The account databases stayed locked, because another program is editing them.Finish or stop the other program, such as vipw or passwd, and run the command again.
C0410A line of /etc/passwd, /etc/group, /etc/shadow or /etc/gshadow cannot be parsed. Nothing was written.Fix or remove the line the message names, then run the command again.
C0411An account created outside Laft has the id of a declared account.Remove or renumber the other account, or give the declared one another id.
C0412A secret file is missing, not owned by the user running Laft, or readable by its group or others.Create the file, owned by that user, with mode 0600 or stricter.
C0413A password file does not hold a valid password hash.Write a hash made by mkpasswd or openssl passwd into the file.
C0414Two declared accounts have the same id.Give one of them another id, or leave both out.
C0415A regular user would take a system group as its primary group.Set the user's group explicitly.
C0420A file path is not an absolute, normalized path below /etc/.Write it as /etc/<path> without ., .. or repeated slashes.
C0421A file path is reserved for Laft, such as /etc/static or an account database.Configure the setting the file belongs to instead.
C0422An enabled file does not set exactly one of text, source, link, json, toml, yaml, ini and env.Keep exactly one content field.
C0425A path is both a file and the directory of another entry.Move one of the files.
C0426Structured content cannot be written in the format of its file.Use values the format can express, for example no null in TOML.
C0427An env key is not a variable name.Use letters, digits and _, not starting with a digit.
C0431A sysctl key is malformed.Write it with dots, such as net.ipv4.ip_forward.
C0433A kernel module is both loaded and blacklisted.Remove it from one of kernel.modules and kernel.blacklist.
C0434A sysctl value is not an integer, string or boolean.Write the value the kernel expects.
C0450The init backend is not available in this version.Remove the line or write init = runit.
C0490A value cannot be written into the file it belongs to.Remove characters such as newlines or : that the file format cannot hold.
C0491No free id is left for an account.Set an explicit id.
C0492A reference names an account that is not declared.Declare the account or fix the name.
C0801A repository URL has an unsupported scheme, or uses http:// without allow_http.Use https:// or file://, or set allow_http = true for a trusted network.
C0802A repository key is not a minisign public key.Paste the base64 line of the repository's .pub file.
C0803A repository name is not a package name.Use lowercase letters, digits and -.
C0901A package reference does not resolve against the synced indexes.Fix the name, or run laft repo sync when the package is new.
C0902An alternatives group is not a name, or a member is not a bare package name.Write alternatives.vi = neovim without version or variant.
C0903A view name is not a package name, or is system or initrd.Rename the view.
C0904A view allows a user or group that is not declared.Declare the account or remove it from the view.
C1101No root filesystem is declared.Add fs "/" { device = ..., fstype = ... }, usually in hardware.stav.
C1102A mountpoint is not an absolute, normalized path.Write it as /path without . or ...
C1103A mountpoint is managed by Laft, such as /usr or /run.Remove the filesystem.
C1104The root filesystem type cannot be mounted by the initramfs.Use ext4, xfs, btrfs or f2fs.
C1105A device of the root, /laft, the ESP or a LUKS block cannot be resolved by the initramfs, or a LUKS name is invalid.Use UUID=, PARTUUID=, LABEL= or a /dev/mapper/ name.
C1106The root filesystem is mounted read-only.Remove ro from its options.
C1107boot.esp has no vfat filesystem.Declare the ESP as fs "/boot" { fstype = vfat, ... }.
C1108A /dev/mapper/<name> device has no luks <name> block.Declare the LUKS device.
C1109A filesystem has no device.Set device.
C1110A swap device is not a path or a UUID=, LABEL=, PARTUUID= or PARTLABEL= tag.Fix the device.
C1201A service name is invalid or reserved.Use another name.
C1202A getty terminal is invalid or repeated.List each terminal once, such as tty1.
C1203A service setting does not fit its kind.Use exec for longruns and up and down for oneshots.
C1204A command or path is not absolute.Write the full path, such as /usr/bin/sshd.
C1205A service depends on a disabled service, or an early service on a later one.Enable the dependency or remove it from after.
C1206Services depend on each other in a cycle.Remove one of the after entries.
C1207An environment variable cannot be passed to a program.Use a variable name without = and a value without NUL.
C1208Services share a directory with different owners or modes.Give them the same owner and mode, or separate directories.
C1209A service package is not a bare package name.Write the name without version or variant.
C1210early is set on a service outside the base part.Remove early. Only the base part defines the early boot graph.
C1301A privileged file lies outside /usr/bin and /usr/lib.Grant privileges only to programs.
C1302A privileged file grants nothing.Set a setuid or setgid mode or capabilities, or remove the entry.
C1303The capability text is invalid.Write it like cap_net_raw=ep.

Resolution ​

The resolver reports why it could not choose the packages of a view, with the chain of requests and dependencies that led there.

CodeProblemFix
S001No candidate matches a request.Check the name, version prefix and variant with laft search, or sync the indexes.
S002Requests for the same package disagree on the variant or the version prefix.Request the package once per view.
S003Nothing satisfies a dependency of a selected package.The repository is incomplete. Sync again later, or pin the package to an older version.
S004Several packages provide a dependency and nothing says which one to use.Request the provider you want in the view.
S005The constraints on a package leave no candidate.Relax one of the listed constraints, for example a version prefix.
S006Two selected packages conflict, or one replaces the other.Remove one of the requests that pull them in.
S007The only providers of a dependency are selected in a version or variant that does not provide it.Request the provider in the version that provides it.
S008Several repositories of the same, highest priority list a package.Give the repositories different priorities.
S009The resolver gave up after too many passes.Request more packages explicitly to narrow the search.
S010An installed package was yanked and nothing else satisfies what needs it.Wait for a fixed package or pin another version.
W001A requested package was renamed, and the request now selects the package that replaces it.Update the configuration to the new name.
W002An installed package is in no repository any more and is kept.Remove the request or find a replacement.
W003An installed version was yanked, so the resolution moves to another one.Nothing to do. The reason is shown with the warning.

Recipes ​

laft-build lint and every build check recipes after Stav has evaluated them.

CodeProblem
R001A recipe that declares a package other than its directory name, or none.
R002A path literal outside the package's recipe directory and common/, or a path or import that leaves the recipe repositories.
R003A recipe directory, subpackage or alternative group whose name is not a package name.
R004A repository without exactly one recipe_repo block, listed twice, or extending one not listed before it.
R006A path literal naming a file that cannot be read.
R009A git source, which this version cannot fetch. Git sources are planned.
R010A source URL that is not https://.
R011A source that sets both or neither of url and git, or an empty url list.
R012A URL source without sha256.
R014A vendor block whose source names no source.
R015A dest, dir, subdir, file name, license file, or setuid, caps or alternative path that is not a plain relative path.
R016An empty package with sources or a style other than custom, or a package without sources that is not empty.
R017The cargo or go style without the matching vendor block.
R018A source label that is not a plain name of letters, digits, -, _ and . that does not start with ..
R019An alternative whose subpackage is neither an explicit nor an automatic subpackage of the package.
R030An env key that does not match A-Z_A-Z0-9_*.
R031An env key that the builder sets itself, unless it is set with force(...), and always JOBS and MAKEFLAGS.
R050An update block without exactly one of github, gitlab, anitya and url, or with pattern and url not set together.
R060A stage file without exactly one stage, a stage name that does not start with a lowercase letter or digit followed by lowercase letters, digits and dashes, a step that sets both or neither of packages and script, a step name used twice, a search directory that is not a plain relative path, a missing recipe repository, a package that builds nothing in the variant named, a step or search directory that a stage building into the store cannot have, a view script outside such a stage or without packages, a view named by a step that does not run in one, or a stage given a target root it cannot have or missing one it needs.

Between recipes, and while planning:

CodeProblem
R020A reference to a package of the run in a variant it does not build.
R021A reference that no recipe of the run and no published package satisfies.
R022More than one recipe of the run for the same package and variant, reported once with their repositories.
B010Dirty items that depend on each other in a cycle.

Sources ​

Fetching and unpacking sources:

CodeProblem
B020A location served a file whose SHA-256 hash differs from the recipe's.
B021An archive entry or link that leads outside its destination.
B022No URL and no mirror has the file.
B023A local file that cannot be read or written.
B024An archive that cannot be read.

Builds ​

CodeProblem
B030A phase, or a stage script inside the root, that ran longer than the timeout.
B031A build root with less than 10 GiB free.
B032A build root whose lock another run holds.
B040A phase or tool that failed.
B041An installation or unpacking into a directory outside bootstrap mode.
B042A stage root whose top-level entries differ from Laft's layout, or a laft-build that is not a static ELF executable for a step inside the root.
B043A payload path that is a directory in a package and something else in the system it is unpacked into, or the other way round.
B044A recipe file that changed since evaluation or cannot be read, a license file that is missing or outside the source tree, a build record, lock record, stage record or reproducibility report that cannot be read or serialized, an install or stage record that is neither a build key line nor a build key record of a format this version reads, or a /proc/meminfo without a MemAvailable line.
B050A build view that the build-side store cannot satisfy.
B060A reproducibility check of a package without a successful build.
B061A reproducibility check with a package that differs or could not be checked.
B1xx, R040, W1xxA payload that breaks a post-processing rule, see post-processing.

Post-processing ​

After the install phase, post-processing turns the payload into packages. Each step that fails stops the build with its code. The W codes are warnings.

CodeProblem
B101The install phase produced no files.
B102A path cannot move into the usr layout, because the target is not a directory or both exist.
B103A path outside usr/ and etc/.
B104A shared object in a static build.
B105A dynamically linked program in a static build.
B106A setuid file that the recipe does not declare in setuid.
B107An ELF file that searches libraries in a directory of the build.
B108An ELF file built for a machine other than x86-64, outside usr/lib/firmware.
B109A symlink that points into the build.
B110The smoke test failed.
B111A path listed in setuid or caps that is not a regular file of the payload.
B112A library link that does not point at the library its soname names.
B113An ELF file that needs a library only found in a private directory, without a $ORIGIN run path.
B114An ownership entry that is not user:group, or names an account that is not a static system account.
B115A subpackage whose name is not a valid package name.
B116A dependency or capability that is not valid.
R040An alternative that names a subpackage the build did not emit, or a path the package does not contain.
W101The payload has no license file in usr/share/licenses/.
W110Static archives were removed. Set keep_archives to ship them.
W111An ELF file searches libraries in a directory not relative to $ORIGIN.
W112A script runs an interpreter that is not detected as a dependency. Declare its package in deps.
W113Files that views generate themselves were removed.
W114An ELF file needs a library that no package of the build view provides.
W115An ELF file that could not be inspected was skipped.
W120A symlink points outside the system directories.
W121A file contains /build/, which is probably a leaked build path.
W122A file was installed writable by everyone.

Rebuild triggers ​

laft-build plan gives each build the reasons it is needed.

CodeTrigger
T1The plan hash differs from the latest build. Recipe edits, schema changes and style template changes do this.
T2The hash of a source, a vendor tarball, a patch or another file the recipe names changed.
T3A link dependency no longer provides a soname or a symbol that the latest build imports from it.
T4A static package inside a static build has a new store id.
T5The abi_epoch of a link dependency changed.
T6The toolchain epoch of the recipe repositories changed.
T7There is no previous successful build.
T8A rebuild was requested.

Released under the MIT or Apache 2.0 license, at your option.