Skip to content

CLI call with --json stdout contains log messages resulting in invalid JSON #740

@netmilk

Description

@netmilk

The expected behavior is for any CLI command with --json flag to output valid JSON to stdout, everything else to stderr.

How to replicate:

$ echo '
{
  "documentUrl": "https://vancura.dev/assets/actor-test/facial-hairstyles-and-filtering-facepiece-respirators.pdf",
  "ocr": true,
  "outputFormat": "html"
}
' > docling.input

$ cat docling.input | apify call vancura/docling --json  > docling.output

$ cat docling.output | jq
jq: parse error: Invalid numeric literal at line 1, column 8

$ head docling.output
Started: 2025-02-05 at 11:11:47
Container URL: https://gs7xajuq0okp.runs.apify.net
Build: 0.0.40 (latest) | Actor version: 0.0 (latest)
Timeout: 7,200 seconds
Memory: 8192 MB
View on Apify Console: https://console.apify.com/actors/fe64zPaNdcva7wzOF/runs/XioDo2s5MQgasjrQr

{
  "id": "XioDo2s5MQgasjrQr",
  "actId": "fe64zPaNdcva7wzOF",
...

Metadata

Metadata

Assignees

Labels

t-toolingIssues with this label are in the ownership of the tooling team.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions