[GH-ISSUE #294] REST API doc upload, python requests issue. #237

Closed
opened 2026-02-25 21:31:30 +03:00 by kerem · 2 comments
Owner

Originally created by @jjkonway on GitHub (Feb 3, 2021).
Original GitHub issue: https://github.com/ciur/papermerge/issues/294

Originally assigned to: @ciur on GitHub.

Uploading pdf to inbox via REST api and python requests does not trigger the worker. I get a response 200, and The document appears in the inbox, and the log shows STARTED OCR for each page. but it never actually COMPLETED OCR.

Drag and drop into inbox works fine.

This is with gunicorn and nginx, ..if i run the server through manage.py runserver, python request triggers the worker normally.
........

But, if I use CURL to upload the pdf, it works fine and triggers the worker as it should .

Any thoughts?
thanks.

Info:

  • OS :Ubuntu 20.04 LTS
  • Browser n/a
  • Database [PostgreSQL 12.1]
  • Papermerge Version1.5.3

Unrelated:
is there any possibility to upload meta data with the document down the line? Or any suggestions to where to look in the code regarding accessing or editing the metadata in python?

Originally created by @jjkonway on GitHub (Feb 3, 2021). Original GitHub issue: https://github.com/ciur/papermerge/issues/294 Originally assigned to: @ciur on GitHub. Uploading pdf to inbox via REST api and **python requests** does not trigger the worker. I get a response 200, and The document appears in the inbox, and the log shows STARTED OCR for each page. but it never actually COMPLETED OCR. Drag and drop into inbox works fine. This is with gunicorn and nginx, ..if i run the server through manage.py runserver, python request triggers the worker normally. ........ But, if I use CURL to upload the pdf, it works fine and triggers the worker as it should . Any thoughts? thanks. **Info:** - OS :Ubuntu 20.04 LTS - Browser n/a - Database [PostgreSQL 12.1] - Papermerge Version1.5.3 Unrelated: is there any possibility to upload meta data with the document down the line? Or any suggestions to where to look in the code regarding accessing or editing the metadata in python?
kerem 2026-02-25 21:31:30 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@ciur commented on GitHub (Feb 7, 2021):

@jjkonway

Uploading pdf to inbox via REST api and python requests does not trigger the worker.

could you please post python requests based script here so that I can troubleshoot the issue?

is there any possibility to upload meta data with the document down the line?

This feature will be implemented in later versions, when more sophisticated REST API will be introduced.

Or any suggestions to where to look in the code regarding accessing or editing the metadata in python?

Sure, metadata is added/edited in this view. As comments mention there, metadata is stored per Page (that is when end user saves metadata on the document, that metadata is actually saved on the first page of respective document).

<!-- gh-comment-id:774608655 --> @ciur commented on GitHub (Feb 7, 2021): @jjkonway > Uploading pdf to inbox via REST api and **python requests** does not trigger the worker. could you please post python requests based script here so that I can troubleshoot the issue? > is there any possibility to upload meta data with the document down the line? This feature will be implemented in later versions, when more sophisticated REST API will be introduced. > Or any suggestions to where to look in the code regarding accessing or editing the metadata in python? Sure, metadata is added/edited in [this view](https://github.com/papermerge/papermerge-core/blob/master/papermerge/core/views/metadata.py). As comments mention there, metadata is stored per Page (that is when end user saves metadata on the document, that metadata is actually saved on the first page of respective document).
Author
Owner

@jjkonway commented on GitHub (Feb 22, 2021):

Nevermind! it was my code. workng now thanks

<!-- gh-comment-id:783663372 --> @jjkonway commented on GitHub (Feb 22, 2021): Nevermind! it was my code. workng now thanks
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/papermerge#237
No description provided.