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 reading

The 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

stateWhat it means
waitingMarfa hasn't come to the file yet, and will
readMarfa read the file. With no extracted_text, it found no text.
filledThe item already holds everything a reading gives, so Marfa has nothing to read
not_readMarfa 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

reasonWhy
unsupportedMarfa has no text reader for this kind of file
encryptedThe PDF opens only with a password
over_limitThe file is past the limit that limit names
ocrThe text needs OCR, and OCR is off or can't run
disabledText reading is off
failedMarfa used every try that enrichment_max_attempts allows
missingNo attached store holds a copy of the bytes
not_lentThe 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_limit names. A limit of blob, inflated or memory is the setting enrichment_max_blob_bytes, enrichment_max_inflated_bytes or enrichment_max_memory_bytes. fixed is a bound that no setting raises.
  • Turn reading on. For disabled, set enrichment_enabled to true. For ocr, set enrichment_ocr_enabled to true if it is off.
  • Replace the bytes, such as an encrypted PDF with an unlocked copy. Marfa reads the bytes a new blob_ref names.

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.

On this page