docling-project / docling-project/docling-serve

[BUG] Improve Logging so that refused jobs return a detailed error message

Open
#201 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.8k
Forks
340
Avg merge
6d 11h
Merged PRs (30d)
8

Description

In the ` /v1alpha/convert/source/async` just send whatever file you want and simply set `ocr_lang` as the value `eng` for the `ocr_engine=easyocr`

The task poll endpoint `/v1alpha/status/poll/{task_id}` returns `failure` but doesn't give me the detailed error message

```json
{
"task_id": "eb333c05-a722-4db3-b5aa-b86199322050",
"task_status": "failure",
"task_position": null,
"task_meta": null
}
```

I can clearly see in the `docker logs` that you log it as an error, where the `eng` value is not supported

```
INFO: 172.17.0.1:57238 - "POST /v1alpha/convert/file/async HTTP/1.1" 200 OK
ERROR:docling_serve.engines.async_local.worker:Worker 0 failed to process job eb333c05-a722-4db3-b5aa-b86199322050: 500: ({'eng'}, 'is not supported')
```

If you check the result endpoint `/v1alpha/status/poll/{task_id}`

```json
{
"detail": "Task result not found. Please wait for a completion status."
}
```

I expect a `detail` field in the poll endpoint `/v1alpha/status/poll/{task_id}` with the `({'eng'}, 'is not supported` message or the `detail` field in the result endpoint to have that message. Right now the client has no idea why the task even failed

Contributor guide

Open the contributing guide

Research direction

Start with the /v1alpha/status/poll/{task_id} and result endpoint handlers, then trace the failure recorded by docling_serve.engines.async_local.worker. Reproduce the unsupported ocr_lang=eng request and compare the poll response with the worker's docker log. Done means the client receives the detailed failure message through the relevant status or result endpoint.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.