Skip to content

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:

Terminal window
$ witnyx check missing.json
error WX-SBOM-NOT-FOUND: SBOM file not found: missing.json
hint: Generate one after building, for example: syft dir:. -o [email protected]=bom.json

In 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:

Terminal window
$ 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.

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.

  • 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.
  • check ran without a path in a folder that has none of bom.json, bom.xml, *.cdx.json, *.cdx.xml, *.spdx.json, target/bom.json and build/reports/bom.json. The message starts with No SBOM found in. Symbolic links are never used, and the message names any it skipped.
  • The SBOM that check found 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 --sbom names a file that does not exist.

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.

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.

  • Two SBOMs side by side, for example app.cdx.json and lib.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.

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.

The file was found, but it could not be read as a JSON or XML document.

  • 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 a DOCTYPE declaration 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 .spdx file. 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.

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.

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.

  • An SPDX JSON document whose spdxVersion is neither SPDX-2.2 nor SPDX-2.3. The message names the version.
  • A JSON document with neither a top-level "bomFormat": "CycloneDX" nor a top-level spdxVersion.
  • An XML document whose root is not a CycloneDX bom element.

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.

The SBOM was read, but it lists no components, so there is nothing to check.

  • 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.

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.

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.

Terminal window
$ witnyx check bom.json --fail-on sometimes
error WX-CONFIG: Unknown value 'sometimes' in --fail-on.
hint: Supported values: exploited, critical, high, eol, quality:<min %>, none.
  • 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.yml is a symbolic link that leads outside the repository, is not a regular file, or is larger than 256 KiB; or --config names a file that does not exist.
  • A --fail-on value that is unknown, quality without a minimum, two quality: values, or none together with another value.
  • Another option with a value that cannot work: --repo-dir that is not a folder, --timeout below 1 second, --output that is not FORMAT=PATH or names a file that cannot be written, --security-txt-url that is not an absolute https URL, or an unknown name for witnyx 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=PATH files, carries WX-CONFIG.
  • init could not create a file in --repo-dir, for example because the folder is not writable. The files it created before are kept.
  • witnyx mcp started 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 with WX-CONFIG as a tool error.
  • For upload: WITNYX_API_KEY is not set or is not a key, --env or --event is refused, no --sbom is given, or the SBOM is not a regular file or is larger than 50 MiB. These are warnings with exit code 0, unless --require-upload is given.

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.

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.

  • 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 --timeout budget 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.

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.

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.

  • 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 --timeout budget 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.

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.

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.

  • 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 --timeout budget 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.

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.

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.

  • check - was run without anything piped into it, for example in a terminal, or the program that writes the SBOM never finished. The message is No SBOM arrived on standard input within and the budget.
  • The SBOM that check found in the repository could not be read in time, for example because something replaced it with a named pipe. The message ends with could not be read within and the budget.

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.

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.

  • network: no connection could be made, or the connection failed.
  • timeout: the --timeout budget 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, which upload never follows because it would carry the key.

upload itself makes up to three attempts, but only when the service cannot have recorded the upload.

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.

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.

  • A bug in witnyx.
  • The JVM ran out of memory, or a report could not be written as JSON or SARIF.

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.