Skip to content

Message codes: Text and documents

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
card-malformed WARNING The YAML frontmatter at the top of a card (the block between two --- lines) does not parse: a model card beside a local model, a dataset's own card, a Hugging Face model's card, or a Hugging Face dataset card a Hub model lists. The line gives what the parser reported. 0.23.0
json-malformed ERROR, WARNING A JSON document Pitloom was given to read does not parse, or its top level is not an object; the line says which document by what it was read for: a Croissant document, PyPI's release metadata, or an SBOM given to embed or to import into an ID registry, or an ID registry file. The lines print since 0.23.0 for a Croissant document, 0.24.0 for PyPI's release metadata and 0.25.0 for an SBOM and an ID registry file. 0.23.0
json-malformed/bom WARNING An SBOM given to read ('embed-wheel --sbom', 'loom id import') starts with a UTF-8 byte order mark (U+FEFF): RFC 8259 section 8.1 says JSON text must not, and a reader that does not drop it fails. 0.25.0
text-malformed WARNING Text Pitloom read holds lone surrogates (U+D800 to U+DFFF), which UTF-8 cannot hold: a JSON or YAML \ud800 escape in a file (a model's metadata, a model or dataset card, a Croissant document, an SBOM fragment, a licence value), or a file name that is not UTF-8. For the SBOM itself, the line names the first element holding one, by its name; for a licence value, the value (LICENSE=). 0.23.0
text-malformed/registry ERROR, WARNING A name the ID registry is to hold holds lone surrogates (U+D800 to U+DFFF), which its UTF-8 file cannot hold: a file name that is not UTF-8 (loom id generate), the name or spdxId of an SBOM element (a \ud800 escape; loom id import, or the registry update of a run), or a name given to IdRegistry.register (a -e NAME). The value is shown escaped. 0.25.0
text-unsafe WARNING The display text of a model's elements (its package, base model, datasets and their creators, licence, originators and the relationships between them) or of a loom dataset's (when it has a Croissant document or dataset card) held invisible or bidi control characters (U+202E can make txt.exe read exe.txt), or a control character. Said once per model or dataset. 0.25.0

card-malformed

  • Level: WARNING.
  • Means: The YAML frontmatter at the top of a card (the block between two --- lines) does not parse: a model card beside a local model, a dataset's own card, a Hugging Face model's card, or a Hugging Face dataset card a Hub model lists. The line gives what the parser reported.
  • SBOM effect: thinner: the SBOM says less than reading the input would.
  • Pitloom did: Used nothing of the frontmatter and went on: a model card beside a local model sets no license or datasets; a Hugging Face model card also no tags, base_model, library_name, language, pipeline_tag or model-index; a dataset card no license, license_name, license_link, version, tags or pretty_name; a Hugging Face dataset card no license or keywords (the description is still read from the card's text).
  • Tell the user: which card's frontmatter is not valid YAML and what the parser reported, as the line says. They fix the card and generate again; a Hugging Face dataset card only its maintainers can fix. Do not edit the card for them; ask first, and with nobody to ask, report it only.
  • Lines:
WARNING: FILE=<file>: <card> frontmatter is not valid YAML; <failure> [card-malformed]

json-malformed

  • Level: ERROR, WARNING. As an ERROR, the command stops for that input and writes nothing for it (exit 1).
  • Means: A JSON document Pitloom was given to read does not parse, or its top level is not an object; the line says which document by what it was read for: a Croissant document, PyPI's release metadata, or an SBOM given to embed or to import into an ID registry, or an ID registry file. The lines print since 0.23.0 for a Croissant document, 0.24.0 for PyPI's release metadata and 0.25.0 for an SBOM and an ID registry file.
  • SBOM effect: not-written: no SBOM is written for the input.
  • Pitloom did: Read nothing of it: the call raises ValueError carrying the code (for PyPI's release metadata, RemoteSourceError, code pypi.response-invalid), and a command exits 1. For a Croissant document, the dataset declaration (loom.add_dataset with croissant=, or read_croissant) fails; for PyPI's release metadata of a PyPI URL, no SBOM is written; for an SBOM to embed, no wheel is changed; for one to import, the ID registry is not written; for an ID registry file, no registry and no SBOM is written, and the file is left as it is. As a WARNING (an ID registry file read again to save the ids a run added, after its SBOM is built), nothing is saved and the SBOM stands.
  • Tell the user: which document is not valid JSON, or not a JSON object, and what the parser reported, as the line says. They fix or replace a local file (for an SBOM, generate it again; for an ID registry, restore it from version control: deleting it loses every id it pins) and run again; PyPI's answer is not theirs to fix, so they retry later. Do not edit, regenerate or replace the document for them; ask first, and with nobody to ask, report it only.
  • Lines:
ERROR: FILE=<file>: not valid JSON <use>; <failure> [json-malformed]
ERROR: FILE=<file>: not a JSON object <use> [json-malformed]
WARNING: FILE=<file>: not valid JSON <use>; <failure> [json-malformed]
WARNING: FILE=<file>: not a JSON object <use> [json-malformed]

json-malformed/bom

  • Level: WARNING.
  • Means: An SBOM given to read ('embed-wheel --sbom', 'loom id import') starts with a UTF-8 byte order mark (U+FEFF): RFC 8259 section 8.1 says JSON text must not, and a reader that does not drop it fails.
  • SBOM effect: none: the SBOM states what the input holds.
  • Pitloom did: Read the SBOM without the mark; embed-wheel embeds it without the mark. The exit status does not change.
  • Tell the user: the SBOM file starts with a byte order mark, as the line says, only if they asked about it: Pitloom read it without one. They save the file as UTF-8 without a byte order mark for other readers. Do not edit the file for them; ask first, and with nobody to ask, report it only.
  • Lines:
WARNING: FILE=<file>: SBOM starts with a byte order mark, which JSON text must not have; dropped [json-malformed/bom]

text-malformed

  • Level: WARNING.
  • Means: Text Pitloom read holds lone surrogates (U+D800 to U+DFFF), which UTF-8 cannot hold: a JSON or YAML \ud800 escape in a file (a model's metadata, a model or dataset card, a Croissant document, an SBOM fragment, a licence value), or a file name that is not UTF-8. For the SBOM itself, the line names the first element holding one, by its name; for a licence value, the value (LICENSE=).
  • SBOM effect: weaker: what the SBOM says is less sure.
  • Pitloom did: Wrote each lone surrogate as the six characters \udXXX, in the SBOM and in its provenance, and went on; said once per file (once per SBOM for element names). In a licence value (the LICENSE= line), replaced each with U+FFFD instead, said once per value.
  • Tell the user: which file (or element, or licence value) holds lone surrogates, as the line says, and that the SBOM shows each as \udXXX (U+FFFD in a licence value), not as the character the source meant. If the exact text matters, they correct the source (a proper escape, a UTF-8 file name) and generate again. Do not rename or edit files for them; ask first, and with nobody to ask, report it only.
  • Printed after: FORMAT=<format> FILE=<file>: <text> (a model scan, before a model reader's own line), on its WARNING lines; the prefix is not part of the line.
  • Lines:
WARNING: FILE=<file>: lone surrogates written as \uXXXX [text-malformed]
WARNING: FORMAT=<format> FILE=<file>: lone surrogates written as \uXXXX [text-malformed]
WARNING: LICENSE=<license>: lone surrogates replaced with U+FFFD [text-malformed]

text-malformed/registry

  • Level: ERROR, WARNING. As an ERROR, the command stops for that input and writes nothing for it (exit 1).
  • Means: A name the ID registry is to hold holds lone surrogates (U+D800 to U+DFFF), which its UTF-8 file cannot hold: a file name that is not UTF-8 (loom id generate), the name or spdxId of an SBOM element (a \ud800 escape; loom id import, or the registry update of a run), or a name given to IdRegistry.register (a -e NAME). The value is shown escaped.
  • SBOM effect: thinner: the SBOM says less than reading the input would.
  • Pitloom did: Left it out: the file is not indexed, the element's id is not recorded, and the run goes on. As an ERROR (a name given to register it), nothing is registered: 'loom id generate' exits 1 and writes no registry; the library raises ValueError carrying the code.
  • Tell the user: which name the ID registry cannot hold, as the line shows it escaped, and that it has no pinned id. They rename the file to a UTF-8 name, or correct the SBOM or the name given, and run again. Do not rename or edit files for them; ask first, and with nobody to ask, report it only.
  • Lines:
ERROR: ID registry: <what> <value> cannot be encoded as UTF-8 (lone surrogate) [text-malformed/registry]
WARNING: ID registry: <what> <value> cannot be encoded as UTF-8 (lone surrogate); skipped [text-malformed/registry]
WARNING: ID registry: PATH '<path>': name cannot be encoded as UTF-8 (lone surrogate); not indexed [text-malformed/registry]

text-unsafe

  • Level: WARNING.
  • Means: The display text of a model's elements (its package, base model, datasets and their creators, licence, originators and the relationships between them) or of a loom dataset's (when it has a Croissant document or dataset card) held invisible or bidi control characters (U+202E can make txt.exe read exe.txt), or a control character. Said once per model or dataset.
  • SBOM effect: weaker: what the SBOM says is less sure.
  • Pitloom did: Wrote each such character as \uXXXX in the properties the line names (a URL percent-encoded); the spdxId and the artifact-metadata annotation keep the text as read. The rest of the SBOM is unchanged.
  • Tell the user: which model or dataset and which properties held such characters: text that reads one way and is stored another is a spoofing risk. The escape is not reversible on its own (a \u202e the file held as text looks the same): they check the model file or the artifact-metadata annotation. Do not edit the source for them.
  • Lines:
WARNING: FORMAT=<format> FILE=<file>: invisible or bidi control characters written as \uXXXX in <properties> [text-unsafe]
WARNING: loom SDK: DATASET='<dataset>': invisible or bidi control characters written as \uXXXX in <properties> [text-unsafe]