Skip to main content

source_invalid

HTTP 422 · code: "source_invalid" · type: https://docs.formfeed.dev/errors/source-invalid

A source exists, but it cannot be processed: the render has not succeeded, the file is not of the type the step needs, or it cannot be read. Merge, protect, watermark and post.merge_after need PDFs; an image watermark needs a PNG or JPEG; /pdf/convert with a render id needs a Word or PowerPoint output. field, index and render_id say which source, where the gateway found the problem. Nothing was charged.

Example​

{
"type": "https://docs.formfeed.dev/errors/source-invalid",
"title": "Source cannot be processed",
"status": 422,
"detail": "Render rnd_7da09ab6cd9946b798c187c2a9350852 is failed; only succeeded renders can be processed",
"code": "source_invalid",
"field": "source",
"index": 0,
"render_id": "rnd_7da09ab6cd9946b798c187c2a9350852",
"request_id": "req_4b7c1e9a2f3d4c5b8a6e7f9012"
}

Common causes​

  • The source render failed, or is still queued or rendering.
  • The source render produced an image, not a PDF (Render … produced png, not a PDF), or a library file is not a PDF.
  • A watermark image that is not a PNG or JPEG, or cannot be read.
  • A PDF that cannot be read, for example a damaged file in the library (terms.pdf is not a readable PDF).
  • /pdf/convert with a render whose output is not a Word or PowerPoint document; PDFs and images need no conversion.
  • An office document that LibreOffice refuses to read (The document cannot be converted, with the converter's reason).

How to fix it​

  • Wait until the source render has status: "succeeded" (poll it, or wait for its render.completed webhook), then call the tool.
  • Use PDF outputs and PDF library files for merge, protect and watermark, and PNG or JPEG files for an image watermark.
  • Open a PDF that cannot be read in a viewer and save or export it again, then upload it again.

Retry?​

Only once the source has changed, for example when the source render has finished. Then send the request again with a new Idempotency-Key or without one: a 4xx answer is stored under its key for 24 hours, so the old key returns this problem again. See retrying.