[GH-ISSUE #361] [Help wanted] "Stapler not found" #286

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

Originally created by @crtvrmn on GitHub (Apr 3, 2021).
Original GitHub issue: https://github.com/ciur/papermerge/issues/361

Hello everyone,

im quite a total noob when it comes to unix system. Im running portainer/docker on a raspi 4 with 8gb and i created a new stack with

'---
version: "2.1"
services:
papermerge:
image: ghcr.io/linuxserver/papermerge
container_name: papermerge
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Berlin
volumes:
- ./volumes/papermerge/Config:/config
- ./volumes/papermerge/Data:/data
ports:
- 8005:8000
restart: unless-stopped'

It seemed like my RasPi was lacking a "new" python version, so i came up with

'wget http://ftp.de.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.1-1_armhf.deb && sudo dpkg -i libseccomp2_2.5.1-1_armhf.deb'
(look how beautiful i linked the commands with &&, like someone that knows what he is doing).
The python error went away, i was able to log into the webinterface. But OCR is not working, so i looked at the log files again.

The log keeps telling me "PermissionError: [Errno 13] Permission denied: '/root/.local/bin/stapler'". After having a look at the log (extended version on pastebin https://pastebin.pl/view/6690bdae )
`WARNINGS:

?: Papermerge can't find stapler. Without it, Papermerge won't be able to cut/paste PDF pages.

HINT: Either it's not in your PATH or it's not installed.`

Now im kinda irritated, i thought the stack would "pull" everything it needed? Right now im not really sure what to do, so any pointings into the right direction would be highly appreciated!

thank you in advance!

Originally created by @crtvrmn on GitHub (Apr 3, 2021). Original GitHub issue: https://github.com/ciur/papermerge/issues/361 Hello everyone, im quite a total noob when it comes to unix system. Im running portainer/docker on a raspi 4 with 8gb and i created a new stack with '--- version: "2.1" services: papermerge: image: ghcr.io/linuxserver/papermerge container_name: papermerge environment: - PUID=1000 - PGID=1000 - TZ=Europe/Berlin volumes: - ./volumes/papermerge/Config:/config - ./volumes/papermerge/Data:/data ports: - 8005:8000 restart: unless-stopped' It seemed like my RasPi was lacking a "new" python version, so i came up with 'wget http://ftp.de.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.1-1_armhf.deb && sudo dpkg -i libseccomp2_2.5.1-1_armhf.deb' (look how beautiful i linked the commands with &&, like someone that knows what he is doing). The python error went away, i was able to log into the webinterface. But OCR is not working, so i looked at the log files again. The log keeps telling me "PermissionError: [Errno 13] Permission denied: '/root/.local/bin/stapler'". After having a look at the log (extended version on pastebin [https://pastebin.pl/view/6690bdae](url) ) `WARNINGS: ?: Papermerge can't find stapler. Without it, Papermerge won't be able to cut/paste PDF pages. HINT: Either it's not in your PATH or it's not installed.` Now im kinda irritated, i thought the stack would "pull" everything it needed? Right now im not really sure what to do, so any pointings into the right direction would be highly appreciated! thank you in advance!
kerem closed this issue 2026-02-25 21:31:37 +03:00
Author
Owner

@URBANsUNITED commented on GitHub (Apr 5, 2021):

As you'll use the Linuxserver Docker container, the stabler should be here:

BINARY_STAPLER = "/usr/local/bin/stapler"

In doubt:

type "which stabler" in your docker console:

Result:
root@e0b33fb76cc4:/# which stapler
/usr/local/bin/stapler
root@e0b33fb76cc4:/#

Cheers

URBANsUNITED

<!-- gh-comment-id:813319089 --> @URBANsUNITED commented on GitHub (Apr 5, 2021): As you'll use the Linuxserver Docker container, the stabler should be here: BINARY_STAPLER = "/usr/local/bin/stapler" In doubt: type "which stabler" in your docker console: Result: root@e0b33fb76cc4:/# which stapler /usr/local/bin/stapler root@e0b33fb76cc4:/# Cheers URBANsUNITED
Author
Owner

@christo-ph commented on GitHub (Apr 7, 2021):

Hi,

although stapler is there, in path as you described, papermerge still reports that it is unable to find stapler.

Later it reports

PermissionError: [Errno 13] Permission denied: '/root/.local/bin/stapler'

and the server fails to start.

What is expected by papermerge to find stapler properly?

<!-- gh-comment-id:814910397 --> @christo-ph commented on GitHub (Apr 7, 2021): Hi, although stapler is there, in path as you described, papermerge still reports that it is unable to find stapler. Later it reports ``` PermissionError: [Errno 13] Permission denied: '/root/.local/bin/stapler' ``` and the server fails to start. What is expected by papermerge to find stapler properly?
Author
Owner

@guim31 commented on GitHub (Apr 7, 2021):

I'm facing the exact same issue

<!-- gh-comment-id:814918708 --> @guim31 commented on GitHub (Apr 7, 2021): I'm facing the exact same issue
Author
Owner

@amo13 commented on GitHub (Apr 7, 2021):

are the permissions correct? ls -lah /root/.local/bin/stapler

<!-- gh-comment-id:814921723 --> @amo13 commented on GitHub (Apr 7, 2021): are the permissions correct? `ls -lah /root/.local/bin/stapler`
Author
Owner

@christo-ph commented on GitHub (Apr 7, 2021):

Thats not really the case. There is no folder /root/.local/bin/

Papermerge is somehow looking in the wrong place. It should be /usr/local/bin

<!-- gh-comment-id:814942969 --> @christo-ph commented on GitHub (Apr 7, 2021): Thats not really the case. There is no folder `/root/.local/bin/` Papermerge is somehow looking in the wrong place. It should be `/usr/local/bin`
Author
Owner

@amo13 commented on GitHub (Apr 7, 2021):

I think you can set the PATH to stapler manually in the configuration file. Did you try?

<!-- gh-comment-id:814946280 --> @amo13 commented on GitHub (Apr 7, 2021): I think you can set the PATH to stapler manually in the configuration file. Did you try?
Author
Owner

@christo-ph commented on GitHub (Apr 7, 2021):

Thanks to your and @URBANsUNITED post, I found it in the config and the initial error disappears.

The following errors are due to permission problems with the mounted share. I will check this further

<!-- gh-comment-id:814962405 --> @christo-ph commented on GitHub (Apr 7, 2021): Thanks to your and @URBANsUNITED post, I found it in the config and the initial error disappears. The following errors are due to permission problems with the mounted share. I will check this further
Author
Owner

@crtvrmn commented on GitHub (Apr 7, 2021):

So i learned a little bit of linux the last few days. i found stapler with
root@c396486f1713:/# find / stapler | grep -e "stapler" 2>dev/null
/usr/local/bin/stapler
/usr/local/bin/pdf-stapler
/usr/local/lib/python3.8/dist-packages/staplelib/stapler.py
/usr/local/lib/python3.8/dist-packages/staplelib/pycache/stapler.cpython-38.pyc
/usr/local/lib/python3.8/dist-packages/stapler-1.0.0.dist-info
/usr/local/lib/python3.8/dist-packages/stapler-1.0.0.dist-info/METADATA
/usr/local/lib/python3.8/dist-packages/stapler-1.0.0.dist-info/INSTALLER
/usr/local/lib/python3.8/dist-packages/stapler-1.0.0.dist-info/WHEEL
/usr/local/lib/python3.8/dist-packages/stapler-1.0.0.dist-info/RECORD
/usr/local/lib/python3.8/dist-packages/stapler-1.0.0.dist-info/LICENSE
/usr/local/lib/python3.8/dist-packages/stapler-1.0.0.dist-info/entry_points.txt
/usr/local/lib/python3.8/dist-packages/mglib/stapler.py
/usr/local/lib/python3.8/dist-packages/mglib/pycache/stapler.cpython-38.pyc
find: ‘/proc/313/map_files’: Permission denied
find: ‘/proc/315/map_files’: Permission denied
find: ‘/proc/337/map_files’: Permission denied
find: ‘/proc/3271/map_files’: Permission denied
find: ‘/proc/3272/map_files’: Permission denied
find: ‘stapler’: No such file or directory

and according to https://www.papermerge.com/docs/Installation/settings.html the default path for stapler in the papermerge.conf.py is expected to be BINARY_STAPLER = "/usr/bin/stapler"

Its kinda clear to me, that i either need to edit the papermerge.conf.py but neither vi, vim or nano do work. what am i missing? im using the docker terminal, i guess there is no vi, vim or nano installed?

<!-- gh-comment-id:815012316 --> @crtvrmn commented on GitHub (Apr 7, 2021): So i learned a little bit of linux the last few days. i found stapler with root@c396486f1713:/# find / stapler | grep -e "stapler" 2>dev/null /usr/local/bin/stapler /usr/local/bin/pdf-stapler /usr/local/lib/python3.8/dist-packages/staplelib/stapler.py /usr/local/lib/python3.8/dist-packages/staplelib/__pycache__/stapler.cpython-38.pyc /usr/local/lib/python3.8/dist-packages/stapler-1.0.0.dist-info /usr/local/lib/python3.8/dist-packages/stapler-1.0.0.dist-info/METADATA /usr/local/lib/python3.8/dist-packages/stapler-1.0.0.dist-info/INSTALLER /usr/local/lib/python3.8/dist-packages/stapler-1.0.0.dist-info/WHEEL /usr/local/lib/python3.8/dist-packages/stapler-1.0.0.dist-info/RECORD /usr/local/lib/python3.8/dist-packages/stapler-1.0.0.dist-info/LICENSE /usr/local/lib/python3.8/dist-packages/stapler-1.0.0.dist-info/entry_points.txt /usr/local/lib/python3.8/dist-packages/mglib/stapler.py /usr/local/lib/python3.8/dist-packages/mglib/__pycache__/stapler.cpython-38.pyc find: ‘/proc/313/map_files’: Permission denied find: ‘/proc/315/map_files’: Permission denied find: ‘/proc/337/map_files’: Permission denied find: ‘/proc/3271/map_files’: Permission denied find: ‘/proc/3272/map_files’: Permission denied find: ‘stapler’: No such file or directory and according to https://www.papermerge.com/docs/Installation/settings.html the default path for stapler in the papermerge.conf.py is expected to be BINARY_STAPLER = "/usr/bin/stapler" Its kinda clear to me, that i either need to edit the papermerge.conf.py but neither vi, vim or nano do work. what am i missing? im using the docker terminal, i guess there is no vi, vim or nano installed?
Author
Owner

@amo13 commented on GitHub (Apr 7, 2021):

a simple whereis stapler would have found the binary too ;)

I never used any docker or container stuff, but if you can't edit the config file, you should take notice of the error message given to you. Why can't you edit it? No editor like nano installed? Or is nano showing you the file but without permission to edit?

<!-- gh-comment-id:815015403 --> @amo13 commented on GitHub (Apr 7, 2021): a simple `whereis stapler` would have found the binary too ;) I never used any docker or container stuff, but if you can't edit the config file, you should take notice of the error message given to you. Why can't you edit it? No editor like nano installed? Or is nano showing you the file but without permission to edit?
Author
Owner

@crtvrmn commented on GitHub (Apr 8, 2021):

No editor like nano installed

this :c

edit
finally it clicked. i just used putty, ran the search for my conf file with the super cool looking 2>/dev/null thingy and finally was able to edit the file with nano as it should be.

i also added in the german OCR, for now ill just have to wait if this worked as i expect it to work :D container is restarting

<!-- gh-comment-id:815555315 --> @crtvrmn commented on GitHub (Apr 8, 2021): > No editor like nano installed this :c *edit* finally it clicked. i just used putty, ran the search for my conf file with the super cool looking 2>/dev/null thingy and finally was able to edit the file with nano as it should be. i also added in the german OCR, for now ill just have to wait if this worked as i expect it to work :D container is restarting
Author
Owner

@crtvrmn commented on GitHub (Apr 8, 2021):

Problem with stapler fixed due to adding the correct path (it got an extra local in there) in the papermerge.conf.py

now i need to fix "DEBUG/ForkPoolWorker-2] Missing page txt /data/media/results/user_1/document_2/pages/page_1.txt." wich seems to be a problem with the DB location, but my initial problem is solved so im closing this one :)

edit (the last one, i swear!): last problem was, i added german lang support in the config file and the linux server package had it not included so i had to run a "apt-get install tesseract-ocr-deu" from the portainer-docker container console and now it seems to work

<!-- gh-comment-id:815578601 --> @crtvrmn commented on GitHub (Apr 8, 2021): Problem with stapler fixed due to adding the correct path (it got an extra local in there) in the papermerge.conf.py now i need to fix "DEBUG/ForkPoolWorker-2] Missing page txt /data/media/results/user_1/document_2/pages/page_1.txt." wich seems to be a problem with the DB location, but my initial problem is solved so im closing this one :) edit (the last one, i swear!): last problem was, i added german lang support in the config file and the linux server package had it not included so i had to run a "apt-get install tesseract-ocr-deu" from the portainer-docker container console and now it seems to work
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#286
No description provided.