Find out why a file has no text
Ask what became of a file item's bytes, whether Marfa read them, will, or won't, and learn what brings a file's text back.
Marfa reads the text inside a file and writes it onto the file item as extracted_text. An item without it looks the same whether its file waits, holds no text or won't be read. Ask for the item's reading to tell which. You need a credential that reads the item.
Ask for the reading
Get an item with include=reading. In the TypeScript example, marfa is a TypeScript SDK client.
marfa items get <item-id> --include readingThe answer gains a reading. This one is for a voice memo:
{ "state": "not_read", "reason": "unsupported" }Only a file item whose blob_ref names bytes has a reading. An agent gets it without asking: marfa_get carries a file item's reading while its state is waiting or not_read.
What each state means
state | What it means |
|---|---|
waiting | Marfa hasn't come to the file yet, and will |
read | Marfa read the file. With no extracted_text, it found no text. |
filled | The item already holds everything a reading gives, so Marfa has nothing to read |
not_read | Marfa won't read the file as things stand, and reason says why |
filled isn't a fault, and it doesn't say whether Marfa once read the file. A password-protected PDF whose extracted_text an app wrote reads filled.
Why a file is not read
reason | Why |
|---|---|
unsupported | Marfa has no text reader for this kind of file |
encrypted | The PDF opens only with a password |
over_limit | The file is past the limit that limit names |
ocr | The text needs OCR, and OCR is off or can't run |
disabled | Text reading is off |
failed | Marfa used every try that enrichment_max_attempts allows |
missing | No attached store holds a copy of the bytes |
not_lent | The item's writer never showed that it had the bytes (Who may read a blob) |
unsupported isn't a fault either. Sound, video, HEIC, AVIF and SVG pictures, and kinds of file Marfa doesn't know, have no text reader, and no setting changes that. A picture can be not_read and still hold its width and height, which Marfa reads apart from its text.
Bring the text back
- Raise the limit an
over_limitnames. Alimitofblob,inflatedormemoryis the settingenrichment_max_blob_bytes,enrichment_max_inflated_bytesorenrichment_max_memory_bytes.fixedis a bound that no setting raises. - Turn reading on. For
disabled, setenrichment_enabledtotrue. Forocr, setenrichment_ocr_enabledtotrueif it is off. - Replace the bytes, such as an encrypted PDF with an unlocked copy. Marfa reads the bytes a new
blob_refnames.
The owner changes a setting with marfa config set (Change an instance's settings). The file then reads waiting, and read once the enrichment-sweep housekeeping job next runs.
A server built without a reader
A release of Marfa reads PDFs and pictures. A server someone built without those readers names the MIME types it reads no text from in unread_types, on Get the instance, and logs them when it starts. Its files of those types read unsupported. On a release, unread_types is empty.
The rules are in the contract's housekeeping chapter, under What became of a file.