[GH-ISSUE #562] Error "Preview not ready yet" when trying to preview uploaded PDF via REST API #436

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

Originally created by @maheshj01 on GitHub (Nov 26, 2023).
Original GitHub issue: https://github.com/ciur/papermerge/issues/562

Originally assigned to: @ciur on GitHub.

Description
Hey @ciur

I am trying to consume the paper merge REST API following the docs, When I upload a pdf file (tested using postman) the preview is not visible, I see an error when viewing the document in paper merge client

error: preview not ready yet

Steps to reproduce

  1. execute the login api http://localhost:16000/api/auth/login/
  2. use the token to create a folder by calling http://localhost:16000/api/nodes/
  3. use the newly created folder's docId to create a document http://localhost:16000/api/nodes/
image

Heres the equivalent curl request for step 3

curl --location 'http://localhost:16000/api/nodes/' \
--header 'Authorization: Token b71b705720758fa18b5130b9435d68cc470f8681876aa9d917c22d0f8c71592f' \
--header 'Content-Type: application/vnd.api+json' \
--header 'Cookie: csrftoken=SKLLHZuQraSiNAGSHeoKoVS4xTMN8rVSUPitszpJKv5zqsMUwAHEDL7zKkaEJczC; sessionid=r5mpf2lixfrued96gz0wxfm1t7urivim' \
--data '{
    "data": {
      "type": "documents",
      "attributes": {
        "title": "MyResume.pdf" 
      },
      "relationships": {
        "parent": {
          "data": {
              "type": "folders",
              "id": "802d655e-72ce-400a-877c-2bc1e43671ac"
          }
        }
      }
    }
  }'
  1. Associate the created document with an actual document
image

Heres the equivalent curl request for step 4

curl --location --request PUT 'http://localhost:16000/api/documents/7cc9d985-43c7-4a58-be70-d02c1434f24e/upload/MyResume.pdf' \
--header 'Authorization: Token b71b705720758fa18b5130b9435d68cc470f8681876aa9d917c22d0f8c71592f' \
--header 'Content-Type: application/pdf' \
--header 'Content-Disposition: attachment; filename=MyResume.pdf' \
--header 'Cookie: csrftoken=SKLLHZuQraSiNAGSHeoKoVS4xTMN8rVSUPitszpJKv5zqsMUwAHEDL7zKkaEJczC; sessionid=r5mpf2lixfrued96gz0wxfm1t7urivim' \
--form 'file=@"/Users/mahesh/Desktop/temp-docs/MyResume.pdf"'
image

Note that In both steps 3 and 4 the status code is 201. However the uploaded document can be downloaed and viewed but it would be good to have the preview feature working

Expected
The uploaded document can be previewed in papermerge client

Actual

image

Let me know if you need any further info to investigate the issue.

Originally created by @maheshj01 on GitHub (Nov 26, 2023). Original GitHub issue: https://github.com/ciur/papermerge/issues/562 Originally assigned to: @ciur on GitHub. **Description** Hey @ciur I am trying to consume the paper merge REST API [following the docs](https://docs.papermerge.io/REST%20API/overview.html#create-document), When I upload a pdf file (tested using postman) the preview is not visible, I see an error when viewing the document in paper merge client error: preview not ready yet *Steps to reproduce* 1. execute the login api `http://localhost:16000/api/auth/login/` 2. use the token to create a folder by calling `http://localhost:16000/api/nodes/` 3. use the newly created folder's docId to create a document http://localhost:16000/api/nodes/ <img width="761" alt="image" src="https://github.com/ciur/papermerge/assets/31410839/3a626073-0f3c-4a98-8fb0-74bd7fa99871"> Heres the equivalent curl request for step 3 ```curl curl --location 'http://localhost:16000/api/nodes/' \ --header 'Authorization: Token b71b705720758fa18b5130b9435d68cc470f8681876aa9d917c22d0f8c71592f' \ --header 'Content-Type: application/vnd.api+json' \ --header 'Cookie: csrftoken=SKLLHZuQraSiNAGSHeoKoVS4xTMN8rVSUPitszpJKv5zqsMUwAHEDL7zKkaEJczC; sessionid=r5mpf2lixfrued96gz0wxfm1t7urivim' \ --data '{ "data": { "type": "documents", "attributes": { "title": "MyResume.pdf" }, "relationships": { "parent": { "data": { "type": "folders", "id": "802d655e-72ce-400a-877c-2bc1e43671ac" } } } } }' ``` 4. Associate the created document with an actual document <img width="620" alt="image" src="https://github.com/ciur/papermerge/assets/31410839/4ba2aded-111c-4183-a62a-9593776dd7fc"> Heres the equivalent curl request for step 4 ```curl curl --location --request PUT 'http://localhost:16000/api/documents/7cc9d985-43c7-4a58-be70-d02c1434f24e/upload/MyResume.pdf' \ --header 'Authorization: Token b71b705720758fa18b5130b9435d68cc470f8681876aa9d917c22d0f8c71592f' \ --header 'Content-Type: application/pdf' \ --header 'Content-Disposition: attachment; filename=MyResume.pdf' \ --header 'Cookie: csrftoken=SKLLHZuQraSiNAGSHeoKoVS4xTMN8rVSUPitszpJKv5zqsMUwAHEDL7zKkaEJczC; sessionid=r5mpf2lixfrued96gz0wxfm1t7urivim' \ --form 'file=@"/Users/mahesh/Desktop/temp-docs/MyResume.pdf"' ``` <img width="627" alt="image" src="https://github.com/ciur/papermerge/assets/31410839/9a89d862-1bac-4983-9c5d-855aa50f2a86"> *Note that In both steps 3 and 4 the status code is 201. However the uploaded document can be downloaed and viewed but it would be good to have the preview feature working* **Expected** The uploaded document can be previewed in papermerge client **Actual** <img width="1375" alt="image" src="https://github.com/ciur/papermerge/assets/31410839/36d19288-217a-4153-b7d9-37ca42979a39"> Let me know if you need any further info to investigate the issue.
kerem 2026-02-25 21:31:55 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@ciur commented on GitHub (Nov 27, 2023):

Maybe you give a try to version 3?

I will officially release version 3.0 it in a month or so.
One of the differences between 3.0 and previous version(s) is that in 3.0 the frontend was completely rewritten - it is all new.

<!-- gh-comment-id:1827171903 --> @ciur commented on GitHub (Nov 27, 2023): Maybe you give a try to version 3? - via docker: https://papermerge.github.io/documentation/3.0-dev/setup/docker/ - via docker compose: https://papermerge.github.io/documentation/3.0-dev/setup/docker-compose/ - or ansible: https://papermerge.github.io/documentation/3.0-dev/setup/ansible/ I will officially release version 3.0 it in a month or so. One of the differences between 3.0 and previous version(s) is that in 3.0 the frontend was completely rewritten - it is all new.
Author
Owner

@maheshj01 commented on GitHub (Nov 28, 2023):

Thanks will take a look, Keep up the great work.

<!-- gh-comment-id:1828888107 --> @maheshj01 commented on GitHub (Nov 28, 2023): Thanks will take a look, Keep up the great work.
Author
Owner

@maheshj01 commented on GitHub (Dec 4, 2023):

Hello @ciur,

I was trying to run the papermerge app using docker-compose, I think there is an issue with arm64 machines I am using a Mac with Apple silicon

mahesh@Maheshs-MacBook-Air-M1-3 papermerge % docker-compose up -d
[+] Running 1/3
 ⠼ db 14 layers [⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]      0B/0B      Pulling                                                      1.3s 
   ⠋ 3b5e91f25ce6 Pulling fs layer                                                                            0.0s 
   ⠋ e8bc76afe420 Pulling fs layer                                                                            0.0s 
   ⠋ 761b98bedd87 Pulling fs layer                                                                            0.0s 
   ⠋ 641ccbcd7a49 Waiting                                                                                     0.0s 
   ⠋ dacb5640e5b0 Pulling fs layer                                                                            0.0s 
   ⠋ c179b52c109c Pulling fs layer                                                                            0.0s 
   ⠋ 8346884a3639 Pulling fs layer                                                                            0.0s 
   ⠋ 07007a1bc9bd Pulling fs layer                                                                            0.0s 
   ⠋ 78d77fb8c2e2 Pulling fs layer                                                                            0.0s 
   ⠋ 6a3285e38d6f Pulling fs layer                                                                            0.0s 
   ⠋ 98a339fb05a2 Pulling fs layer                                                                            0.0s 
   ⠋ 3b006c0b7bf4 Pulling fs layer                                                                            0.0s 
   ⠋ 40a527a44543 Pulling fs layer                                                                            0.0s 
   ⠋ aeb99eeba715 Pulling fs layer                                                                            0.0s 
 ⠼ web Pulling                                                                                                1.3s 
 ✘ worker Error                                                                                               1.3s 
no matching manifest for linux/arm64/v8 in the manifest list entries
mahesh@Maheshs-MacBook-Air-M1-3 papermerge % docker-compose up -d
[+] Running 1/2
 ⠴ worker Pulling                                                                                             6.6s 
 ✘ web Error                                                                                                  6.6s 
no matching manifest for linux/arm64/v8 in the manifest list entries
mahesh@Maheshs-MacBook-Air-M1-3 papermerge % docker-compose up -d
[+] Running 1/3
 ⠼ solr Pulling                                                                                               1.4s 
 ✘ web Error                                                                                                  1.4s 
 ⠼ worker Pulling                                                                                             1.4s 
no matching manifest for linux/arm64/v8 in the manifest list entries

I tried all three configuration on this link https://papermerge.github.io/documentation/3.0-dev/setup/docker-compose/

<!-- gh-comment-id:1839577708 --> @maheshj01 commented on GitHub (Dec 4, 2023): Hello @ciur, I was trying to run the papermerge app using docker-compose, I think there is an issue with arm64 machines I am using a Mac with Apple silicon ``` mahesh@Maheshs-MacBook-Air-M1-3 papermerge % docker-compose up -d [+] Running 1/3 ⠼ db 14 layers [⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀] 0B/0B Pulling 1.3s ⠋ 3b5e91f25ce6 Pulling fs layer 0.0s ⠋ e8bc76afe420 Pulling fs layer 0.0s ⠋ 761b98bedd87 Pulling fs layer 0.0s ⠋ 641ccbcd7a49 Waiting 0.0s ⠋ dacb5640e5b0 Pulling fs layer 0.0s ⠋ c179b52c109c Pulling fs layer 0.0s ⠋ 8346884a3639 Pulling fs layer 0.0s ⠋ 07007a1bc9bd Pulling fs layer 0.0s ⠋ 78d77fb8c2e2 Pulling fs layer 0.0s ⠋ 6a3285e38d6f Pulling fs layer 0.0s ⠋ 98a339fb05a2 Pulling fs layer 0.0s ⠋ 3b006c0b7bf4 Pulling fs layer 0.0s ⠋ 40a527a44543 Pulling fs layer 0.0s ⠋ aeb99eeba715 Pulling fs layer 0.0s ⠼ web Pulling 1.3s ✘ worker Error 1.3s no matching manifest for linux/arm64/v8 in the manifest list entries mahesh@Maheshs-MacBook-Air-M1-3 papermerge % docker-compose up -d [+] Running 1/2 ⠴ worker Pulling 6.6s ✘ web Error 6.6s no matching manifest for linux/arm64/v8 in the manifest list entries mahesh@Maheshs-MacBook-Air-M1-3 papermerge % docker-compose up -d [+] Running 1/3 ⠼ solr Pulling 1.4s ✘ web Error 1.4s ⠼ worker Pulling 1.4s no matching manifest for linux/arm64/v8 in the manifest list entries ``` I tried all three configuration on this link https://papermerge.github.io/documentation/3.0-dev/setup/docker-compose/
Author
Owner

@ciur commented on GitHub (Dec 5, 2023):

Yes it is because of arm architecture of your cpu. Currently there are no docker image for arm.

<!-- gh-comment-id:1839981006 --> @ciur commented on GitHub (Dec 5, 2023): Yes it is because of arm architecture of your cpu. Currently there are no docker image for arm.
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#436
No description provided.