Diagnostic codes
Diagnostic codes
This file is generated from the registry in crates/rqm/src/diag/code.rs by cargo xtask diagnostics. Do not edit it by hand.
Every diagnostic rqm prints has one of these codes, and no other code is ever emitted. The exit code says which kind of failure happened and the diagnostic code says why, so automation should branch on the code and never on exit 3 alone.
Exit codes: 0 is success, 1 is a gate failure, 2 is invalid input and 3 is an operational error. When several occur, 2 wins over 3, 3 over 1 and 1 over 0. A warning exits 0, except that with --strict any warning makes the command exit 2. Information never changes the exit code. In the table below, the exit column is the exit code a diagnostic causes on its own.
A code marked input points at a place in an input file and always carries a span. A code marked command is about the invocation as a whole and has no span.
| Code | Category | Severity | Exit | Points at | Message shape | Remedy |
|---|---|---|---|---|---|---|
E-ANNOTATION-INVALID |
scan | error | 2 | input | The marker is not written as one or more string literals: {reason} | Write the marker as #[rqm(“RQM-14”)], with one or more string literals, written directly on the item. |
E-ANNOTATION-POSITION |
scan | error | 2 | input | The marker rqm is on {item}, and it belongs on a test function or an inline module | Move the marker to a test function or an inline module. Tests in an out-of-line module carry the marker on each function, or are bound by selectors. |
E-ANNOTATION-UNKNOWN-REQ |
scan | error | 2 | input | The marker names {reference}, which is not a requirement | Name the id or the uuid of a requirement that exists. A requirement that is left out because of another error cannot be named. |
E-BASELINE-BAD-HASH |
baseline | error | 2 | input | The baseline holds a malformed hash: {detail} | A hash is 64 lowercase hexadecimal characters. Fetch a good copy or promote again. |
E-BASELINE-CHANGED |
baseline | error | 2 | command | The baseline {path} is not the one the run was made against: {change} | Fetch the baseline again, run the tests against it, and promote that run. Another job or an editor replaced the file after the run. |
E-BASELINE-DUPLICATE-KEY |
baseline | error | 2 | input | The baseline holds a key twice: {key} | Remove one of the two. A baseline is written by rqm baseline update and is not edited by hand, so fetch a good copy or promote again. |
E-BASELINE-MISSING |
baseline | error | 2 | command | The baseline {path} is configured and does not exist | Fetch the baseline before the command, or create the first one with rqm baseline update –create. A broken fetch step must not pass silently. |
E-BASELINE-NOT-CONFIGURED |
baseline | error | 2 | command | The project has no baseline configured, so there is nothing to promote into | Add a baseline key with a path to rqm.yaml. Create the first baseline with rqm baseline update –create. |
E-BASELINE-READ |
baseline | error | 3 | command | The baseline {path} cannot be read: {reason} | Check the permissions and the disk, and run the command again. |
E-BASELINE-RUN-MISSING |
baseline | error | 2 | input | The record of {requirement} names the run {run}, which the baseline does not hold | Every record needs the run it came from. Fetch a good copy or promote again. |
E-BASELINE-SCHEMA |
baseline | error | 2 | input | The baseline is not valid: {detail} | A key is missing, unknown or of the wrong type. A record without complete provenance is refused, never filled in. Fetch a good copy or promote again. |
E-BASELINE-SCHEMA-VERSION |
baseline | error | 2 | input | The baseline has schema {found} and this rqm reads schema {supported} | Use the version of rqm that wrote the baseline, or promote again with this version. |
E-BASELINE-STALE-ALGO |
baseline | error | 2 | command | The baseline {path} was written with the hash algorithm {found} and this rqm uses {present} | A baseline is not reinterpreted under another algorithm. Create a new one with rqm baseline update –create after moving the old file away. |
E-BASELINE-UNKNOWN-ENUM |
baseline | error | 2 | input | The baseline holds a value that rqm does not know: {detail} | The file was written by another version of rqm or edited by hand. Fetch a good copy or promote again. |
E-CARGO-METADATA |
scan | error | 2 | command | cargo metadata failed: {first line of cargo’s message} | Fix the problem that cargo names, for example a manifest it cannot read or a Cargo.lock that is missing or out of date, then run the command again. |
E-CARGO-NOT-FOUND |
scan | error | 3 | command | Cannot start cargo: {operating system error} | Install cargo, or make it available on the PATH of the process that runs rqm. |
E-CONFIG-NOT-FOUND |
config | error | 2 | command | {what} was not found | Run rqm inside a project that has an rqm.yaml, or point RQM_CONFIG at the configuration file. |
E-COVERAGE-INPUT-MISSING |
verify | error | 2 | command | The class {class} was selected and needs {input}, which is not available | Run rqm test first for the run classes, or configure a baseline for not_recorded. A class without its input is never treated as empty. |
E-CREATE-EXISTS |
path | error | 2 | command | The file {path} already exists, so no requirement was created | Run the command again to take the next free number. The existing file was left as it was. |
E-DECL-UNSUPPORTED |
scan | error | 2 | input | The function {name} carries the attribute {attribute}, which is not a supported test form | Use one of the supported forms (test, tokio::test, rstest, test_case, quickcheck), or bind the test with a selector in the requirement. |
E-DIAG-CAP |
diagnostics | error | 2 | command | Showing {shown} of {total} diagnostics (limit {cap}) | Fix the reported problems and run the command again, because the ones that were cut appear once these are gone. |
E-EDITOR-EXIT |
cli | error | 3 | command | The editor exited with {status}, so {file} was not changed | Save and quit the editor normally to keep an edit. A non-zero exit is taken as an abort. |
E-EDITOR-NOT-FOUND |
cli | error | 2 | command | The editor {program} was not found: {reason} | Set VISUAL or EDITOR to a program on PATH or to its full path. |
E-EDITOR-NOT-SET |
cli | error | 2 | command | No editor is set: VISUAL and EDITOR are both unset or blank | Set VISUAL or EDITOR to the command that starts your editor, such as vi or code –wait. |
E-EDITOR-START |
cli | error | 3 | command | The editor {program} could not be started: {operating system error} | Check that the program can be run, then run the command again. |
E-EMPTY-FIELD |
document | error | 2 | input | The field ‘{field}’ is empty | Write the content of the field. |
E-EMPTY-VALUE |
document | error | 2 | input | The list ‘{field}’ has an item that is an empty list | Remove the empty list, or write the item that was meant. |
E-EVIDENCE-REQUIRED |
document | error | 2 | input | The field ‘evidence’ is required because verification includes {methods} | Describe the manual evidence in the evidence field. |
E-EXEC-ARGUMENT |
run | error | 2 | command | The suite {suite} cannot be started: an argument of the command is not allowed for a batch file: {reason} | Remove the line break from the argument, or run a program that is not a batch file. |
E-EXEC-NOT-FOUND |
run | error | 2 | command | The program {program} of the suite {suite} was not found: {reason} | Install the program, put its directory on the PATH of the process that runs rqm, or write its absolute path in the suite command. |
E-EXEC-START |
run | error | 3 | command | The suite {suite} could not be started: {operating system error} | Check that the program may be run by this account and that the system has the resources to start it, then run the command again. |
E-FIELD-TYPE |
document | error | 2 | input | The field ‘{field}’ must be {expected}, found {found} | Write the value as the expected type. A number that is meant as text must be quoted. |
E-FIELD-VALUE |
document | error | 2 | input | The field ‘{field}’ must be one of {allowed values}, found ‘{value}’ | Use one of the allowed values. |
E-FLOAT-NORMATIVE |
document | error | 2 | input | The field ‘{field}’ counts towards the requirement’s meaning and cannot hold the float {number} | Use an integer, for example by choosing a smaller unit. |
E-ID-DUPLICATE |
identity | error | 2 | input | The id {id} is also used in {others} | Give each requirement its own id. Every requirement that shares an id is left out until the duplicates are resolved. |
E-ID-INVALID |
identity | error | 2 | input | ‘{text}’ is not a valid requirement id: {reason} | Write the id as a prefix such as RQM, a hyphen and a number without leading zeros, such as RQM-12. |
E-ID-NONASCII |
identity | error | 2 | input | The identifier ‘{text}’ has the non-ASCII character {character} | Identifiers are printable ASCII. Replace the character, and quote the identifier if it is not text. |
E-ID-PREFIX |
identity | error | 2 | command | The id {id} has the prefix {prefix}, which id_prefixes in rqm.yaml does not declare | Use one of the declared prefixes, add the prefix to id_prefixes, or rename the requirement with rqm rename. |
E-INHERIT-BROKEN |
inheritance | error | 2 | input | The parent chain of {id} passes through {ancestor}, which has an error | Fix the error in the ancestor. The requirement is left out until the whole chain is sound. |
E-INHERIT-CYCLE |
inheritance | error | 2 | input | The parent chain loops through {members} | Remove the parent of one of the requirements so that the chain ends. |
E-INHERIT-DEPTH |
inheritance | error | 2 | input | The requirement {id} has {depth} ancestors, and at most {max} are allowed | Shorten the chain by giving a requirement in it a different parent, or none. |
E-INHERIT-MISMATCH |
inheritance | error | 2 | input | The field ‘{field}’ of {id} cannot be taken from {ancestor}, which declares it differently | Declare the field identically in both kinds, or set the value on the requirement itself. |
E-INIT-EXISTS |
config | error | 2 | command | A project already exists: {where} | Work in the existing project, or run rqm init –force to replace its rqm.yaml with a new one. |
E-INTEGER-LEADING-ZERO |
document | error | 2 | input | The number {number} in ‘{field}’ has a leading zero | Remove the leading zeros, or write 0o for an octal number. |
E-INTEGER-RANGE |
document | error | 2 | input | The integer {number} in ‘{field}’ is outside the signed 64-bit range | Use a number between -9223372036854775808 and 9223372036854775807. |
E-INTERNAL |
internal | error | 3 | command | Internal error: {detail} | This is a bug in rqm. Report it together with the command line and this message. |
E-IO |
io | error | 3 | input | Cannot {operation} ‘{path}’: {operating system error} | Check that the file exists and that rqm may access it, then run the command again. |
E-KIND-INCOMPLETE |
kind | error | 2 | input | The field ‘{field}’ of kind ‘{kind}’ has no {missing} | Give every field a type, and every enum field its list of values. |
E-KIND-INVALID |
kind | error | 2 | input | The declaration of ‘{name}’ contradicts itself: {reason} | Correct the declaration in the kinds section of rqm.yaml. |
E-KIND-UNKNOWN |
kind | error | 2 | input | The kind ‘{kind}’ is not declared in rqm.yaml | Use one of the declared kinds, or declare the kind in the kinds section of rqm.yaml. |
E-MISSING-FIELD |
document | error | 2 | input | The field ‘{field}’ is missing | Add the field. |
E-MODULE-AMBIGUOUS |
scan | error | 2 | input | The module {name} has two files: {first} and {second} | Remove one of the two files, as rustc requires. |
E-MODULE-MISSING |
scan | error | 2 | input | The module {name} has no file: neither {first} nor {second} exists | Create one of the two files, or correct the mod declaration or its path attribute. |
E-MODULE-UNSUPPORTED |
scan | error | 2 | input | The module {name} has a path attribute and is inline, and rqm does not follow that | Remove the path attribute from the inline module, or move the code to a file module. |
E-NULL-FIELD |
document | error | 2 | input | The field ‘{field}’ is null | Give the field a value, or remove the field if it is optional. |
E-PATH-INVALID |
path | error | 2 | input | The path ‘{path}’ is not allowed: {reason} | Write the path relative to the project root, with ‘/’ separators and names that every platform accepts. |
E-PATH-MISMATCH |
path | error | 2 | input | The path ‘{path}’ opened a different name than it spells | Write the path the way the file system spells it, without short names, trailing dots or stream names. |
E-PATH-NOT-FILE |
path | error | 2 | input | The path ‘{path}’ is not {expected} | Point at a regular file, or a directory where one is expected, not at a device, a pipe or another kind of entry. |
E-PATH-SYMLINK |
path | error | 2 | input | The path ‘{path}’ goes through a symbolic link or a reparse point | Use the real path. rqm never follows symbolic links, junctions or other reparse points, and there is no option to. |
E-POLICY-CHANGED |
baseline | error | 2 | command | The policy, the suites or the hash algorithm changed since the run: {change} | Run the tests again under the present configuration, then promote that run. |
E-REF-INVALID |
identity | error | 2 | input | ‘{text}’ is not a requirement reference: {reason} | Refer to a requirement by its id, such as RQM-14, or by its UUID. |
E-REF-UNKNOWN |
identity | error | 2 | input | The reference {reference} does not name a requirement | Refer to the id or the uuid of an existing requirement. A requirement that is left out because of another error cannot be referred to. |
E-RENAME-IN-PLACE |
identity | error | 2 | input | The reference at this place cannot be changed in place: {reason} | Write the id as a plain or quoted value, such as RQM-12 or “RQM-12”, and run the command again. Nothing was changed. |
E-REPORT-CHANGED |
report | error | 2 | command | The report {path} of the suite {suite} changed while it was being read | Make sure that nothing writes the report after the suite has ended, and run the command again. |
E-REPORT-DUPLICATE-CASE |
report | error | 2 | input | The case {class} {name} appears {count} times in the report | Make the test names unique, or set generic_duplicate_cases to attempts in the join section of rqm.yaml if a repeated case is a retry. |
E-REPORT-LIMIT |
report | error | 2 | input | The report exceeds the limit {limit} ({value}): {what} | Make the report smaller, or raise the limit of that name in the limits section of rqm.yaml if the size is expected. |
E-REPORT-MALFORMED |
report | error | 2 | input | The report cannot be read: {reason} | Check that the suite writes a JUnit report in UTF-8 without a DOCTYPE, and that the declared adapter is the tool that wrote it. |
E-REPORT-MISSING |
report | error | 2 | command | The suite {suite} wrote no report at {path} | Check that the command of the suite writes its report to the path in rqm.yaml, and read the log of the suite. |
E-REPORT-STALE |
report | error | 2 | command | The report {path} of the suite {suite} is older than the start of the run | Make the suite write its report on every run, or put {run_id} in the report path so that each run has its own. |
E-REPORT-TOO-SHORT |
report | error | 2 | command | The report of the suite {suite} has {found} cases and at least {needed} are required | Find out why the suite ran so few tests, or lower min_report_cases of the suite if the number is right. |
E-REQ-NOT-FOUND |
identity | error | 2 | command | No requirement has the id or uuid {reference} | Run rqm list to see the ids of the loaded requirements. A requirement that is left out because of another error cannot be shown. |
E-REQUIRED-UNBOUND |
document | error | 2 | input | The requirement {id} is required and verified by test, but no test is bound to it | Add a test selector to the tests list of the requirement, annotate a test for it, or change its status or its verification methods. |
E-RUN-NOT-FOUND |
run | error | 2 | command | No run record was found: {what} | Run rqm test to make one, or give the id of a run that has a record in .rqm/runs. |
E-RUN-RECORD |
run | error | 2 | input | The run record cannot be used: {reason} | Run rqm test again to make a new record. A record is never edited by hand, and one that was written by another version of rqm cannot be read. |
E-SCHEMA-VERSION |
document | error | 2 | input | Schema version {found} is not supported, this rqm reads version {supported} | Set schema to the supported version, or use a version of rqm that reads the newer schema. |
E-SELECTOR-DUPLICATE |
identity | error | 2 | input | The selector {selector} appears more than once in {requirement}, here and at {other} | Remove the repeated selector. |
E-SELECTOR-INVALID |
identity | error | 2 | input | ‘{text}’ is not a test selector: {reason} | Write the crate, the modules and the function joined by ‘::’, such as alpha::db::txn::survives, or namespace:body for another runner. |
E-SNAPSHOT-CHANGED |
baseline | error | 2 | command | The project changed in a way the run depends on since the run: {change} | Run the tests again on the present project, then promote that run. A run is only promoted into the project it ran against. |
E-SOURCE-ENCODING |
scan | error | 2 | input | The Rust source is not valid UTF-8 | Save the file as UTF-8 and remove the bytes that the position points at. |
E-SUITE-DUPLICATE |
config | error | 2 | input | The suite id ‘{suite}’ is declared twice | Give every suite its own id. |
E-SUITE-EXIT |
run | error | 2 | command | The suite {suite} ended with {exit}, which is not one of the accepted exit codes {accepted} | Look at the log of the suite to see why it ended, or add the code to accepted_exit_codes of the suite if it is a normal outcome. |
E-SUITE-SELECT |
run | error | 2 | command | The suite selection is not usable: {reason} | Name suites that are declared in rqm.yaml, name each suite once, and leave at least one suite to run. |
E-SUITE-SURVIVORS |
run | error | 3 | command | The suite {suite} left processes running after {when}: {pids} | Make the suite stop the processes that it starts. A process that leaves the process group of the suite cannot be seen or ended by rqm. |
E-SUITE-TIMEOUT |
run | error | 3 | command | The suite {suite} did not finish within {seconds} seconds and was ended | Raise timeout_secs of the suite if it is meant to take this long, or find out why it hangs. |
E-SUITE-UNKNOWN |
config | error | 2 | input | The suite ‘{suite}’ is not declared in the suites section | Declare the suite under suites, or remove it from the list that names it. |
E-SYNTAX |
scan | error | 2 | input | Cannot parse the Rust source: {parser message} | Fix the syntax at the position shown. No test of the file is bound until the file parses. |
E-UNKNOWN-FIELD |
document | error | 2 | input | Unknown field ‘{field}’ | Remove the field, or correct its spelling to one of the fields the schema declares. |
E-USAGE |
cli | error | 2 | command | {what is wrong with the command line} | Run rqm –help to see the accepted arguments, then correct the command line. |
E-UUID-CHANGED |
identity | error | 2 | input | The uuid of {id} was changed from {old} to {new} | A uuid never changes. Put the old uuid back with rqm edit. |
E-UUID-DUPLICATE |
identity | error | 2 | input | The uuid {uuid} is also used in {others} | Give each requirement its own uuid. Every requirement that shares a uuid is left out until the duplicates are resolved. |
E-UUID-INVALID |
identity | error | 2 | input | ‘{text}’ is not a valid UUIDv7: {reason} | Write the uuid of the requirement as a lowercase version 7 UUID. Never change the uuid of an existing requirement. |
E-WRITE-CHANGED |
io | error | 3 | command | The file {path} changed after rqm read it, so nothing was written | Another program changed the file while the command ran. Run the command again. |
E-YAML-DUPLICATE-KEY |
yaml | error | 2 | input | The key ‘{key}’ appears twice in the same mapping | Remove one of the two keys, or merge their values. |
E-YAML-EMPTY |
yaml | error | 2 | input | The file holds no YAML document | Write the document, or remove the file if it is not needed. |
E-YAML-ENCODING |
yaml | error | 2 | input | The file is not valid UTF-8 | Save the file as UTF-8 and remove the bytes that the position points at. |
E-YAML-INVALID |
yaml | error | 2 | input | Cannot read the YAML: {parser message} | Fix the YAML at the position shown. |
E-YAML-LIMIT |
yaml | error | 2 | input | The document exceeds a parser limit: {limit} | Simplify the document. The limits are listed in docs/YAML.md. |
E-YAML-MERGE-KEY |
yaml | error | 2 | input | Merge keys are not supported | Write out the merged entries instead of using ‘«’. |
E-YAML-MULTIPLE-DOCUMENTS |
yaml | error | 2 | input | The file holds more than one YAML document | Keep one document per file and move the others to files of their own. |
E-YAML-NON-FINITE |
yaml | error | 2 | input | The number ‘{text}’ is not finite | Write a finite number, or quote the text if it is meant to be a string. |
E-YAML-TAG |
yaml | error | 2 | input | The tag ‘{tag}’ is not supported | Remove the tag. Only the YAML core tags, such as !!str and !!int, are accepted. |
I-BASELINE-ORPHAN |
baseline | info | 0 | input | The baseline holds a record for {uuid}, which no requirement of the project has | The requirement was deleted or its file is not read. The record is ignored, and baseline update –prune drops it. |
W-AFFECTED-PATH-IGNORED |
cli | warning | 0 | command | The path {path} cannot be inside the project and is ignored: {reason} | Give paths relative to the directory that holds rqm.yaml, such as requirements/RQM-1.yaml or src/lib.rs. |
W-BASELINE-MISSING |
baseline | warning | 0 | command | The baseline {path} is configured and does not exist, so no requirement has a record | This is expected before the first baseline exists. Create it with rqm baseline update –create. |
W-CASE-FLAKY |
verify | warning | 0 | input | The case {case} passed only after an earlier attempt failed | The case counts as a pass because its last attempt passed. Fix the flakiness, because a test that needs a retry is weak evidence. |
W-DECL-DUPLICATE |
scan | warning | 0 | input | The test {id} is declared more than once in the target: here and at {other} | This is normal when the declarations are alternatives behind cfg attributes. Otherwise rename one of the functions. |
W-HASH-ALGO-STALE |
hashing | warning | 0 | input | The hash algorithm ‘{found}’ is not ‘{current}’, so the record is stale | Run the tests and promote again so that the record is written with the current algorithm. A hash of another algorithm is never reinterpreted. |
W-MANUAL-EVIDENCE-EDITED |
verify | warning | 0 | input | The manual evidence of {requirement} was edited after the baseline recorded it | Review the new text, then promote again so that the baseline records it. Until then the claim is not presented as reviewed. |
W-MODULE-MISSING |
scan | warning | 0 | input | The module {name} is behind a cfg attribute and has no file: neither {first} nor {second} exists | Create the file if the module is meant to be scanned. A file that exists only on some platforms or with some features is not scanned when it is absent. |
W-ROOT-MISSING |
path | warning | 0 | input | The requirement root ‘{path}’ does not exist, so it holds no requirements | Create the directory, or correct requirement_roots in rqm.yaml. Under –strict a missing root fails the run. |
W-SNAPSHOT-UNRELATED-CHANGE |
baseline | warning | 0 | command | The project changed since the run, but not in anything the evidence depends on: {change} | Nothing to do. The promotion goes on, and the change is in its summary so that it is not silent. |
W-SUITE-OPTIONAL |
run | warning | 0 | command | The optional suite {suite} is not clean ({causes}), so the requirements that depend on it are incomplete | Fix the suite, or make it mandatory if a failure of it should fail the command. |
W-TARGET-OUTSIDE-ROOT |
scan | warning | 0 | command | The {kind} target {name} of package {package} has its root file outside the project, so its tests are not scanned | Run rqm from the project that holds the sources, or ignore the warning when the target is not meant to be scanned. |