Error codes
When a command cannot do its work, it prints an error with a stable code on standard error, usually followed by a hint, and exits with code 2.
Here check gets the path of a software bill of materials (SBOM) that does not exist:
$ witnyx check missing.jsonerror WX-SBOM-NOT-FOUND: SBOM file not found: missing.jsonhint: Generate one after building, for example: syft dir:. -o [email protected]=bom.jsonIn agent mode, and in every file that check --output json=PATH names, the same error is a JSON document, described by the error document schema.
Its retryable field says whether running the same command again unchanged may succeed:
$ witnyx check missing.json --agent{ "schema" : "https://witnyx.dev/schemas/error/v1.json", "error" : { "code" : "WX-SBOM-NOT-FOUND", "message" : "SBOM file not found: missing.json", "hint" : "Generate one after building, for example: syft dir:. -o [email protected]=bom.json", "retryable" : false }}upload is the exception: an upload that the service did not record is a warning, with exit code 0, unless --require-upload is given.
In agent mode, its failures are in the upload document instead.
The codes are stable, so scripts and agents can act on them. Each code has a section below, and the address of each section stays the same. Not every command prints every code:
| Code | Reported today by |
|---|---|
WX-SBOM-NOT-FOUND |
check, upload and the MCP server’s tools |
WX-SBOM-AMBIGUOUS |
check and the MCP server’s tools, when they look for the SBOM themselves |
WX-SBOM-PARSE, WX-SBOM-UNSUPPORTED, WX-SBOM-EMPTY |
check, upload and the MCP server’s tools |
WX-CONFIG |
check, init, cache update, schema, mcp, upload and the MCP server’s tools |
WX-NET-KEV, WX-NET-EUVD, WX-NET-EOL |
cache update only |
WX-TIMEOUT |
check and the MCP server’s check_sbom tool, while they read the SBOM |
WX-UPLOAD |
upload only |
WX-INTERNAL |
Any command |
check never stops because a data source failed: it reports the failed source in the report, which is then incomplete or carries a note.
See also: Work offline for the cache that cache update fills, Data sources for how check reports a source that failed, and Install for getting a current version.
WX-SBOM-NOT-FOUND
Section titled “WX-SBOM-NOT-FOUND”What it means
Section titled “What it means”There is no SBOM to read: the path given does not exist, or check looked for an SBOM in --repo-dir and found none it may read.
Likely causes
Section titled “Likely causes”- The path is wrong, or the SBOM is written by a later step of the build. The message is
SBOM file not found:and the path. checkran without a path in a folder that has none ofbom.json,bom.xml,*.cdx.json,*.cdx.xml,*.spdx.json,target/bom.jsonandbuild/reports/bom.json. The message starts withNo SBOM found in. Symbolic links are never used, and the message names any it skipped.- The SBOM that
checkfound is a symbolic link that leads outside the repository, or it is not a regular file. A found SBOM is read only when it is a regular file inside the repository. upload --sbomnames a file that does not exist.
How to fix it
Section titled “How to fix it”Pass the SBOM’s path, or - to read it from standard input.
If there is no SBOM yet, generate one after building; the hint names one way, with Syft.
Running the command again unchanged does not help: retryable is false.
WX-SBOM-AMBIGUOUS
Section titled “WX-SBOM-AMBIGUOUS”What it means
Section titled “What it means”check ran without a path, and more than one file in --repo-dir matches the first pattern that matches at all, so it does not guess which one to check.
Likely causes
Section titled “Likely causes”- Two SBOMs side by side, for example
app.cdx.jsonandlib.cdx.json. The message names the pattern and every file that matches it. - The patterns are tried in the order
bom.json,bom.xml,*.cdx.json,*.cdx.xml,*.spdx.json,target/bom.json,build/reports/bom.json. A single match of an earlier pattern is used, whatever later patterns match.
How to fix it
Section titled “How to fix it”Pass the path of the SBOM to check, or - to read it from standard input.
To check several SBOMs, run check once for each.
Running the command again unchanged does not help: retryable is false.
WX-SBOM-PARSE
Section titled “WX-SBOM-PARSE”What it means
Section titled “What it means”The file was found, but it could not be read as a JSON or XML document.
Likely causes
Section titled “Likely causes”- The file is empty, or it was read before the tool that writes it had finished. The message ends with
is empty. - The JSON is broken or cut off (
is not valid JSON), or the top level is not a JSON object. - The XML is broken or cut off (
is not valid XML). XML with aDOCTYPEdeclaration or an entity reference is refused too, so that a hostile SBOM can neither read local files nor expand entities. So is XML nested deeper than 256 levels. - The file is SPDX tag-value text, such as a
.spdxfile. Only SPDX JSON is read. - The file or standard input could not be read, for example for lack of permission. The message starts with
Could not read.
How to fix it
Section titled “How to fix it”Make sure the file is a complete CycloneDX document (JSON or XML) or SPDX JSON document, written before the check starts.
Export it again from the tool that made it if it is cut off.
Running the command again unchanged does not help: retryable is false.
WX-SBOM-UNSUPPORTED
Section titled “WX-SBOM-UNSUPPORTED”What it means
Section titled “What it means”The file is valid JSON or XML, but not an SBOM format that Witnyx reads. It reads CycloneDX as JSON or XML and SPDX 2.2 or 2.3 as JSON. Versions 1.4 to 1.6 of CycloneDX are the ones supported; a file of another CycloneDX version is read as it is, with no version check, so it does not raise this error.
Likely causes
Section titled “Likely causes”- An SPDX JSON document whose
spdxVersionis neitherSPDX-2.2norSPDX-2.3. The message names the version. - A JSON document with neither a top-level
"bomFormat": "CycloneDX"nor a top-levelspdxVersion. - An XML document whose root is not a CycloneDX
bomelement.
How to fix it
Section titled “How to fix it”Export the SBOM as CycloneDX JSON or SPDX 2.3 JSON; most SBOM generators offer both.
Running the command again unchanged does not help: retryable is false.
WX-SBOM-EMPTY
Section titled “WX-SBOM-EMPTY”What it means
Section titled “What it means”The SBOM was read, but it lists no components, so there is nothing to check.
Likely causes
Section titled “Likely causes”- The SBOM was made before the build, or from a folder without the built product, so it misses the dependencies.
- The generator wrote only the product itself, in the SBOM’s metadata, and no component.
How to fix it
Section titled “How to fix it”Generate the SBOM after building, from the built product; the hint names one way, with Syft.
Running the command again unchanged does not help: retryable is false.
WX-CONFIG
Section titled “WX-CONFIG”What it means
Section titled “What it means”Something given to the command is not valid: an option or an argument, the configuration file, an output file, or, for upload, the key or a value that it would send.
The message names the value and what is wrong with it.
$ witnyx check bom.json --fail-on sometimeserror WX-CONFIG: Unknown value 'sometimes' in --fail-on.hint: Supported values: exploited, critical, high, eol, quality:<min %>, none.Likely causes
Section titled “Likely causes”- A mistake in
.witnyx.yml: broken YAML, an unknown field, a missing or wrong value. The message names the file and the line or the field, and the hint links to the configuration file page. .witnyx.ymlis a symbolic link that leads outside the repository, is not a regular file, or is larger than 256 KiB; or--confignames a file that does not exist.- A
--fail-onvalue that is unknown,qualitywithout a minimum, twoquality:values, ornonetogether with another value. - Another option with a value that cannot work:
--repo-dirthat is not a folder,--timeoutbelow 1 second,--outputthat is notFORMAT=PATHor names a file that cannot be written,--security-txt-urlthat is not an absolutehttpsURL, or an unknown name forwitnyx schema. - Arguments that cannot be parsed, such as an unknown option or an option without its value. A person gets the parser’s message and the usage instead of this line; the error document in agent mode, and in
--output json=PATHfiles, carriesWX-CONFIG. initcould not create a file in--repo-dir, for example because the folder is not writable. The files it created before are kept.witnyx mcpstarted in the file-system root, the home folder or a folder that contains it. A tool of the MCP server called with a wrong argument returns the error document withWX-CONFIGas a tool error.- For
upload:WITNYX_API_KEYis not set or is not a key,--envor--eventis refused, no--sbomis given, or the SBOM is not a regular file or is larger than 50 MiB. These are warnings with exit code 0, unless--require-uploadis given.
How to fix it
Section titled “How to fix it”Read the message and the hint: they name the value and what it may be.
Fix the option or the file, then run the command again.
Running the command again unchanged does not help: retryable is false.
WX-NET-KEV
Section titled “WX-NET-KEV”What it means
Section titled “What it means”witnyx cache update could not download CISA’s Known Exploited Vulnerabilities catalogue into the cache.
Only cache update prints this code today.
The message starts with cisa-kev was not updated: and says why.
Likely causes
Section titled “Likely causes”- This machine cannot reach
www.cisa.gov, or a proxy or firewall is in the way. - The source answered with an error, or with data that is not a valid catalogue.
- The
--timeoutbudget ran out.
check never prints this code.
When it cannot load the catalogue, it reports the failed source in the report instead: the check goes on and is incomplete, because the catalogue is a required source.
How to fix it
Section titled “How to fix it”The cached copy from before, if there is one, is kept, and the other sources are still updated; the hint says whether a copy exists.
Fix the network problem, or wait, and run witnyx cache update again.
Running the command again unchanged can help: retryable is true.
WX-NET-EUVD
Section titled “WX-NET-EUVD”What it means
Section titled “What it means”witnyx cache update could not download the list of exploited vulnerabilities of ENISA’s EU Vulnerability Database into the cache.
Only cache update prints this code today.
The message starts with enisa-euvd was not updated: and says why.
Likely causes
Section titled “Likely causes”- This machine cannot reach
euvdservices.enisa.europa.eu, or a proxy or firewall is in the way. - The source answered with an error, or with data that cannot be used.
- The
--timeoutbudget ran out.
check never prints this code.
When it cannot load the list, it reports the failed source in the report instead: a note, and actively exploited vulnerabilities shown without their EUVD ID.
The check still finds the same actively exploited vulnerabilities, because only CISA’s catalogue makes a finding actively exploited; ENISA’s list adds its EUVD ID to such a finding.
How to fix it
Section titled “How to fix it”The cached copy from before, if there is one, is kept, and the other sources are still updated; the hint says whether a copy exists.
Fix the network problem, or wait, and run witnyx cache update again.
Running the command again unchanged can help: retryable is true.
WX-NET-EOL
Section titled “WX-NET-EOL”What it means
Section titled “What it means”witnyx cache update could not download the end-of-life data of endoflife.date into the cache.
Only cache update prints this code today.
The message starts with endoflife-date was not updated: and says why.
Likely causes
Section titled “Likely causes”- This machine cannot reach
endoflife.date, or a proxy or firewall is in the way. - The source answered with an error, or with data that cannot be used.
- The
--timeoutbudget ran out.
check never prints this code.
When it cannot load the data, it reports the failed source in the report instead: a note, and the end-of-life check skipped.
How to fix it
Section titled “How to fix it”The cached copy from before, if there is one, is kept, and the other sources are still updated; the hint says whether a copy exists.
Fix the network problem, or wait, and run witnyx cache update again.
Running the command again unchanged can help: retryable is true.
WX-TIMEOUT
Section titled “WX-TIMEOUT”What it means
Section titled “What it means”check stopped waiting for the SBOM, because it did not arrive within the --timeout budget, 120 seconds by default.
Only reading the SBOM gives this code today, in check and in the MCP server’s check_sbom tool.
A slow data source never does: the report names it, and the check is incomplete or carries a note.
Likely causes
Section titled “Likely causes”check -was run without anything piped into it, for example in a terminal, or the program that writes the SBOM never finished. The message isNo SBOM arrived on standard input withinand the budget.- The SBOM that
checkfound in the repository could not be read in time, for example because something replaced it with a named pipe. The message ends withcould not be read withinand the budget.
How to fix it
Section titled “How to fix it”Pipe a complete SBOM into check -, or pass the SBOM’s path instead of -.
Running the command again unchanged does not help: retryable is false.
WX-UPLOAD
Section titled “WX-UPLOAD”What it means
Section titled “What it means”witnyx upload sent the upload, or tried to, and the hosted service did not record it.
By default this is a warning, and the exit code is 0, so the deploy goes on; with --require-upload it is an error, with exit code 2.
In agent mode, failure.reason in the upload document says which case it was.
Likely causes
Section titled “Likely causes”network: no connection could be made, or the connection failed.timeout: the--timeoutbudget ran out.rate_limited: the service answered 429: the key used up its uploads for the hour, too many unknown or revoked keys came from this address, or the service was busy with other uploads.rejected: the service answered another 4xx status, for example 401 for a key it refused, 404 for a wrong address, or 413 for an upload over its size limits.http_status: any other answer but 201, such as a 5xx status, or a redirect, whichuploadnever follows because it would carry the key.
upload itself makes up to three attempts, but only when the service cannot have recorded the upload.
How to fix it
Section titled “How to fix it”Follow the hint, which names the likely fix for each case.
Whether running the command again unchanged can help depends on the case: it can after a network failure, a timeout, a 429 or a 5xx status, and the upload document’s failure.retryable is then true; it cannot after any other 4xx status, a redirect or another unexpected answer, and failure.retryable is then false.
A failure that was remembered is reported to the service with the next upload that succeeds.
WX-INTERNAL
Section titled “WX-INTERNAL”What it means
Section titled “What it means”Something failed inside witnyx that it did not expect: a fault in the tool, not in your input.
It is printed without a stack trace.
For upload, it is a warning like any other failed upload, unless --require-upload is given.
Likely causes
Section titled “Likely causes”- A bug in
witnyx. - The JVM ran out of memory, or a report could not be written as JSON or SARIF.
How to fix it
Section titled “How to fix it”Report it, with the command, the output of witnyx version and the message; the hint, when there is one, says where.
Running the command again unchanged does not help: retryable is false.
Witnyx is a record-keeping and workflow tool. It does not certify compliance. Nothing on this site is legal advice.