Message codes: ID registry¶
See also: Message codes (the index of every code) and Messages and codes (the line grammar, what a code guarantees and when to trust one).
Trust a code only when the line is one of the lines below, a value in place of
each <name>, after at most one prefix: the index lists the prefixes and
message-codes-values.md the values.
Codes¶
| Code | Level | Means | Since |
|---|---|---|---|
registry-file-missing |
WARNING | A run that saves the ids it added to the ID registry was given a registry with no file: an IdRegistry made in memory, without a path. The CLI and the build hook always name a file. | 0.25.0 |
registry-malformed |
ERROR, WARNING | An ID registry file is a JSON object but not a registry: a key named twice, a namespace, id counter, project root or entry of the wrong shape, a key the format needs missing, two entries for one key, or a key or spdxId holding a lone surrogate (a \ud800 escape). Most often a hand edit or a merge of two versions of the file. A counter a save would write out of range says the same, before the file is written; so does a mint past the largest id, which only a counter or an id edited to near it reaches. | 0.25.0 |
registry-unknown-key |
ERROR, WARNING | An ID registry file holds a key its format does not have, at the top level or in an entry. The version is checked first, so a registry from a newer Pitloom says registry-wrong-format instead: the key comes from a hand edit or another tool. | 0.25.0 |
registry-unusable |
ERROR, WARNING | An ID registry file cannot record its project root: the file stores the root relative to its own directory, and there is no such path (on Windows, the file and the project on two drives) or it would not load back. Said when the registry is saved. | 0.25.0 |
registry-wrong-format |
ERROR, WARNING | An ID registry file is of another format version than 4, the one Pitloom reads: an older one (a version 3 file from Pitloom 0.21, whose package keys hold no version, or a version 2 one), a newer one from a later Pitloom, or none at all (no 'version', or one that is not a whole number). It is never migrated. The line states the version found. | 0.25.0 |
registry-file-missing¶
- Level: WARNING.
- Means: A run that saves the ids it added to the ID registry was given a registry with no file: an IdRegistry made in memory, without a path. The CLI and the build hook always name a file.
- SBOM effect: none: the SBOM states what the input holds.
- Pitloom did: Said by loom generate (a project, wheel or environment), project, wheel and env, the library's generate_project_sbom, generate_wheel_sbom, generate_env_sbom and the PyPI and Git URL functions that call them, and loom.Run. The ids are used in the SBOM, which is written, but are not saved: the next run mints them again.
- The caller may fix: The caller may give the IdRegistry a path (IdRegistry.load, or IdRegistry.new with path=) to keep the ids, or turn the update off (update-id-registry = false; update_id_registry=False in the library) when an in-memory registry is meant.
- Lines:
WARNING: ID registry: no file to save to; the ids this run added are not saved [registry-file-missing]
registry-malformed¶
- Level: ERROR, WARNING. As an ERROR, the command stops for that input and writes nothing for it (exit 1).
- Means: An ID registry file is a JSON object but not a registry: a key named twice, a namespace, id counter, project root or entry of the wrong shape, a key the format needs missing, two entries for one key, or a key or spdxId holding a lone surrogate (a \ud800 escape). Most often a hand edit or a merge of two versions of the file. A counter a save would write out of range says the same, before the file is written; so does a mint past the largest id, which only a counter or an id edited to near it reaches.
- SBOM effect: not-written: no SBOM is written for the input.
- Pitloom did: As an ERROR, wrote nothing. The command exits 1 (the Action step fails), the build hook fails the build, and the library raises ValueError carrying the code. 'loom id' writes no registry, and every other command writes no SBOM. The file is left as it is. As a WARNING, a run whose SBOM is already built (loom generate (a project, wheel or environment), project, wheel and env, the library's generate_project_sbom, generate_wheel_sbom, generate_env_sbom and the PyPI and Git URL functions that call them, and loom.Run) read the file again to save the ids it added: nothing is saved and the SBOM stands; the next run mints those ids again.
- Tell the user: which registry file is malformed and what is wrong, as the line says. They fix the edit, or restore the file from version control, and run again; deleting it loses every id it pins. Do not edit, restore or delete the file for them; ask first, and with nobody to ask, report it only.
- Lines:
ERROR: ID registry: FILE=<file>: duplicate key <name> [registry-malformed]
ERROR: ID registry: FILE=<file>: missing a valid 'namespace' [registry-malformed]
ERROR: ID registry: FILE=<file>: 'namespace' <why>: <namespace> [registry-malformed]
ERROR: ID registry: FILE=<file>: missing <name> [registry-malformed]
ERROR: ID registry: FILE=<file>: 'id_counters' key <name> is not an id prefix [registry-malformed]
ERROR: ID registry: FILE=<file>: 'id_counters' <name>: <value> is not a whole number from 1 to 9007199254740991 [registry-malformed]
ERROR: ID registry: FILE=<file>: 'id_counters' is not an object [registry-malformed]
ERROR: ID registry: FILE=<file>: 'project_root' <value> is not a relative POSIX path (relative to the registry file's directory) [registry-malformed]
ERROR: ID registry: FILE=<file>: malformed entry: 'elements' is not an object [registry-malformed]
ERROR: ID registry: FILE=<file>: malformed entry: elements '<type>' is not an object [registry-malformed]
ERROR: ID registry: FILE=<file>: <what> <value> cannot be encoded as UTF-8 (lone surrogate) [registry-malformed]
ERROR: ID registry: FILE=<file>: two '<type>' entries for <name> [registry-malformed]
ERROR: ID registry: FILE=<file>: malformed entry: '<type>' <name> is not an object [registry-malformed]
ERROR: ID registry: FILE=<file>: malformed entry: '<type>' <name>: 'spdxId' must be a non-empty string [registry-malformed]
ERROR: ID registry: FILE=<file>: malformed entry: '<type>' <name>: 'sha256' must be a non-empty string, or left out [registry-malformed]
ERROR: ID registry: FILE=<file>: no <name> id left to mint in <namespace> [registry-malformed]
WARNING: ID registry: FILE=<file>: duplicate key <name> [registry-malformed]
WARNING: ID registry: FILE=<file>: missing a valid 'namespace' [registry-malformed]
WARNING: ID registry: FILE=<file>: 'namespace' <why>: <namespace> [registry-malformed]
WARNING: ID registry: FILE=<file>: missing <name> [registry-malformed]
WARNING: ID registry: FILE=<file>: 'id_counters' key <name> is not an id prefix [registry-malformed]
WARNING: ID registry: FILE=<file>: 'id_counters' <name>: <value> is not a whole number from 1 to 9007199254740991 [registry-malformed]
WARNING: ID registry: FILE=<file>: 'id_counters' is not an object [registry-malformed]
WARNING: ID registry: FILE=<file>: 'project_root' <value> is not a relative POSIX path (relative to the registry file's directory) [registry-malformed]
WARNING: ID registry: FILE=<file>: malformed entry: 'elements' is not an object [registry-malformed]
WARNING: ID registry: FILE=<file>: malformed entry: elements '<type>' is not an object [registry-malformed]
WARNING: ID registry: FILE=<file>: <what> <value> cannot be encoded as UTF-8 (lone surrogate) [registry-malformed]
WARNING: ID registry: FILE=<file>: two '<type>' entries for <name> [registry-malformed]
WARNING: ID registry: FILE=<file>: malformed entry: '<type>' <name> is not an object [registry-malformed]
WARNING: ID registry: FILE=<file>: malformed entry: '<type>' <name>: 'spdxId' must be a non-empty string [registry-malformed]
WARNING: ID registry: FILE=<file>: malformed entry: '<type>' <name>: 'sha256' must be a non-empty string, or left out [registry-malformed]
WARNING: ID registry: FILE=<file>: no <name> id left to mint in <namespace> [registry-malformed]
registry-unknown-key¶
- Level: ERROR, WARNING. As an ERROR, the command stops for that input and writes nothing for it (exit 1).
- Means: An ID registry file holds a key its format does not have, at the top level or in an entry. The version is checked first, so a registry from a newer Pitloom says registry-wrong-format instead: the key comes from a hand edit or another tool.
- SBOM effect: not-written: no SBOM is written for the input.
- Pitloom did: As an ERROR, wrote nothing. The command exits 1 (the Action step fails), the build hook fails the build, and the library raises ValueError carrying the code. 'loom id' writes no registry, and every other command writes no SBOM. The file is left as it is. As a WARNING, a run whose SBOM is already built (loom generate (a project, wheel or environment), project, wheel and env, the library's generate_project_sbom, generate_wheel_sbom, generate_env_sbom and the PyPI and Git URL functions that call them, and loom.Run) read the file again to save the ids it added: nothing is saved and the SBOM stands; the next run mints those ids again.
- Tell the user: which registry file holds which unknown key, as the line says. They remove the key (or restore the file from version control) and run again. Do not edit the file for them; ask first, and with nobody to ask, report it only.
- Lines:
ERROR: ID registry: FILE=<file>: unknown top-level key(s): <name> [registry-unknown-key]
ERROR: ID registry: FILE=<file>: malformed entry: '<type>' <name> has unknown key(s): <value> [registry-unknown-key]
WARNING: ID registry: FILE=<file>: unknown top-level key(s): <name> [registry-unknown-key]
WARNING: ID registry: FILE=<file>: malformed entry: '<type>' <name> has unknown key(s): <value> [registry-unknown-key]
registry-unusable¶
- Level: ERROR, WARNING. As an ERROR, the command stops for that input and writes nothing for it (exit 1).
- Means: An ID registry file cannot record its project root: the file stores the root relative to its own directory, and there is no such path (on Windows, the file and the project on two drives) or it would not load back. Said when the registry is saved.
- SBOM effect: none: the SBOM states what the input holds.
- Pitloom did: Saved nothing: the registry file is not written or changed. As an ERROR, 'loom id' exits 1 and IdRegistry.save raises ValueError carrying the code. As a WARNING (loom generate (a project, wheel or environment), project, wheel and env, the library's generate_project_sbom, generate_wheel_sbom, generate_env_sbom and the PyPI and Git URL functions that call them, and loom.Run, whose SBOM is already built), the SBOM stands and the ids the run added are not saved.
- Tell the user: that the registry file cannot record where the project is, as the line says. A registry file inside the project always works: the root is then stored as '.' or '..' steps. With no relative path (two Windows drives), a file on the project's drive works too; a root that cannot be stored (a backslash in a directory name between the file and the project) is fixed only by a file inside the project. They name such a file and run again. Do not move files for them; ask first, and with nobody to ask, report it only.
- Lines:
ERROR: ID registry: FILE=<file>: project root '<path>' has no path relative to the file's directory; <failure> [registry-unusable]
ERROR: ID registry: FILE=<file>: project root '<path>' cannot be stored as <value> [registry-unusable]
WARNING: ID registry: FILE=<file>: project root '<path>' has no path relative to the file's directory; <failure> [registry-unusable]
WARNING: ID registry: FILE=<file>: project root '<path>' cannot be stored as <value> [registry-unusable]
registry-wrong-format¶
- Level: ERROR, WARNING. As an ERROR, the command stops for that input and writes nothing for it (exit 1).
- Means: An ID registry file is of another format version than 4, the one Pitloom reads: an older one (a version 3 file from Pitloom 0.21, whose package keys hold no version, or a version 2 one), a newer one from a later Pitloom, or none at all (no 'version', or one that is not a whole number). It is never migrated. The line states the version found.
- SBOM effect: not-written: no SBOM is written for the input.
- Pitloom did: As an ERROR, wrote nothing. The command exits 1 (the Action step fails), the build hook fails the build, and the library raises ValueError carrying the code. 'loom id' writes no registry, and every other command writes no SBOM. The file is left as it is. As a WARNING, a run whose SBOM is already built (loom generate (a project, wheel or environment), project, wheel and env, the library's generate_project_sbom, generate_wheel_sbom, generate_env_sbom and the PyPI and Git URL functions that call them, and loom.Run) read the file again to save the ids it added: nothing is saved and the SBOM stands; the next run mints those ids again.
- Tell the user: which registry file cannot be read and the version the line states; what helps depends on it. Older than 4: to keep its ids, they delete it and run 'loom id import' on the last SBOM a run made with it ('loom id generate' alone mints new ids for everything). Newer: the file comes from a later Pitloom; they upgrade Pitloom and keep the file, which is not to be deleted. None, or not a whole number: most often a hand edit; they restore the file from version control. Deleting it loses every id it pins. Do not delete, restore or upgrade anything for them; ask first, and with nobody to ask, report it only.
- Lines:
ERROR: ID registry: FILE=<file>: version <value>, expected 4 (no migration support) [registry-wrong-format]
WARNING: ID registry: FILE=<file>: version <value>, expected 4 (no migration support) [registry-wrong-format]
Summaries¶
A summary is an INFO: line that reports what a run did under its own rule (a
count, the key it wrote), with no condition to name: it carries no code, and
there is nothing to do.
- 'loom id generate -e' stored NAME under the key every lookup uses (a path key, a package's normalised NAME@VERSION), spelt otherwise than typed. Said once the registry is saved, or found already up to date.
INFO: ID registry: -e <entity> stored as <name>
- A run saved the registry with that many ids new to it, under keys new to it: neither another run's ids saved meanwhile nor a refused one count.
INFO: ID registry: added <number> new id(s) to '<path>'
- 'loom id generate' or 'loom id import' saved the registry, or found it already up to date; it now holds that many ids.
INFO: ID registry: holds <number> id(s)
- 'loom id' wrote a new registry the project configuration does not name: the line to add for every run to use it.
INFO: ID registry: to use this registry, add to <table> in <file>: id-registry = <value>
- 'loom id' wrote a new registry while the project configuration names another: the value to change it to.
INFO: ID registry: to use this registry, change id-registry in <table> in <file> to: id-registry = <value>
- A run saved the registry and added no id: an entry's hash changed, an id moved to its lookup key, or a stale key was released.
INFO: ID registry: updated stale entries in '<path>'