PDF export error 127, wkhtmltopd: not found #2639

Closed
opened 2026-02-05 04:41:21 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @dividerbeam on GitHub (Feb 4, 2022).

Describe the Bug

RuntimeException
The exit status code '127' says something went wrong: stderr: "sh: /home/user/bins/wkhtmltopd: not found " stdout: "" command: /home/user/bins/wkhtmltopd --lowquality --outline --print-media-type '/tmp/knp_snappy61fbb881137753.47113073.html' '/tmp/knp_snappy61fbb881138166.94518521.pdf'.

https://flareapp.io/share/qm1L8oz5#F55

Steps to Reproduce

1 go to any page
2 click Export->PDF

Expected Behaviour

I expected that a pdf file would start downloading to my computer

Screenshots or Additional Context

No response

Exact BookStack Version

v21.05.3

PHP Version

7.4.21

Hosting Environment

Linux c3281836cf2d 5.11.0-49-generic #55-Ubuntu SMP Wed Jan 12 17:36:34 UTC 2022 x86_64 GNU/Linux

Originally created by @dividerbeam on GitHub (Feb 4, 2022). ### Describe the Bug RuntimeException The exit status code '127' says something went wrong: stderr: "sh: /home/user/bins/wkhtmltopd: not found " stdout: "" command: /home/user/bins/wkhtmltopd --lowquality --outline --print-media-type '/tmp/knp_snappy61fbb881137753.47113073.html' '/tmp/knp_snappy61fbb881138166.94518521.pdf'. https://flareapp.io/share/qm1L8oz5#F55 ### Steps to Reproduce 1 go to any page 2 click Export->PDF ### Expected Behaviour I expected that a pdf file would start downloading to my computer ### Screenshots or Additional Context _No response_ ### Exact BookStack Version v21.05.3 ### PHP Version 7.4.21 ### Hosting Environment Linux c3281836cf2d 5.11.0-49-generic #55-Ubuntu SMP Wed Jan 12 17:36:34 UTC 2022 x86_64 GNU/Linux
OVERLORD added the 🐛 Bug label 2026-02-05 04:41:21 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Feb 4, 2022):

Hi @dividerbeam,
Do you definitely have a working wkhtmltopdf binary at the path /home/user/bins/wkhtmltopd?
Does it work if called via command line directly?
To me it looks like you are missing the f at the end of wkhtmltopdf in your defined WKHTMLTOPDF path.

@ssddanbrown commented on GitHub (Feb 4, 2022): Hi @dividerbeam, Do you definitely have a working wkhtmltopdf binary at the path `/home/user/bins/wkhtmltopd`? Does it work if called via command line directly? To me it looks like you are missing the `f` at the end of `wkhtmltopdf` in your defined `WKHTMLTOPDF` path.
Author
Owner

@dividerbeam commented on GitHub (Feb 4, 2022):

Hi @ssddanbrown,
i use docker image ghcr.io/linuxserver/bookstack:latest, I thought everything should work by itself and all the necessary programs are included there, I didn't reconfigure anything there

@dividerbeam commented on GitHub (Feb 4, 2022): Hi @ssddanbrown, i use docker image ghcr.io/linuxserver/bookstack:latest, I thought everything should work by itself and all the necessary programs are included there, I didn't reconfigure anything there
Author
Owner

@ssddanbrown commented on GitHub (Feb 4, 2022):

Hi @dividerbeam,
According to their readme here you need to still define the path for the WKHTMLTOPDF bookstack option path to /usr/bin/wkhtmltopdf.
I think you must have this defined somewhere already as /home/user/bins/wkhtmltopd since that's not a path built into BookStack or the linuxserver container.

Additional note: You're currently on an old container image and version of BookStack. In more recent BookStack versions WKHTMLTOPDF won't be used unless you also set:

ALLOW_UNTRUSTED_SERVER_FETCHING=true

This has important security implications though, More details on this page: https://www.bookstackapp.com/docs/admin/pdf-rendering/

@ssddanbrown commented on GitHub (Feb 4, 2022): Hi @dividerbeam, According to their [readme here](https://github.com/linuxserver/docker-bookstack/tree/master#pdf-rendering) you need to still define the path for the `WKHTMLTOPDF` bookstack option path to `/usr/bin/wkhtmltopdf`. I think you must have this defined somewhere already as `/home/user/bins/wkhtmltopd` since that's not a path built into BookStack or the linuxserver container. Additional note: You're currently on an old container image and version of BookStack. In more recent BookStack versions WKHTMLTOPDF won't be used unless you also set: ```bash ALLOW_UNTRUSTED_SERVER_FETCHING=true ``` This has important security implications though, More details on this page: https://www.bookstackapp.com/docs/admin/pdf-rendering/
Author
Owner

@dividerbeam commented on GitHub (Feb 4, 2022):

Hi @dividerbeam, Do you definitely have a working wkhtmltopdf binary at the path /home/user/bins/wkhtmltopd? Does it work if called via command line directly? To me it looks like you are missing the f at the end of wkhtmltopdf in your defined WKHTMLTOPDF path.

Привет @dividerbeam, В соответствии с их readme здесь вам все равно нужно определить путь для WKHTMLTOPDFпараметра "Путь к книжному стеллажу/usr/bin/wkhtmltopdf". Я думаю, что вы уже где-то это определили, так /home/user/bins/wkhtmltopdкак это не путь, встроенный в книжный стеллаж или контейнер linuxserver.

Дополнительное примечание: В настоящее время вы используете старый образ контейнера и версию BookStack. В более поздних версиях книжного магазина WKHTMLTOPDF не будет использоваться, если вы также не установите:

ALLOW_UNTRUSTED_SERVER_FETCHING=true

Однако это имеет важные последствия для безопасности, более подробная информация на этой странице: https://www.bookstackapp.com/docs/admin/pdf-rendering/

thank you very much

@dividerbeam commented on GitHub (Feb 4, 2022): > Hi @dividerbeam, Do you definitely have a working wkhtmltopdf binary at the path `/home/user/bins/wkhtmltopd`? Does it work if called via command line directly? To me it looks like you are missing the `f` at the end of `wkhtmltopdf` in your defined `WKHTMLTOPDF` path. > Привет @dividerbeam, В соответствии с их [readme здесь](https://github.com/linuxserver/docker-bookstack/tree/master#pdf-rendering) вам все равно нужно определить путь для `WKHTMLTOPDF`параметра "Путь к книжному стеллажу`/usr/bin/wkhtmltopdf`". Я думаю, что вы уже где-то это определили, так `/home/user/bins/wkhtmltopd`как это не путь, встроенный в книжный стеллаж или контейнер linuxserver. > > Дополнительное примечание: В настоящее время вы используете старый образ контейнера и версию BookStack. В более поздних версиях книжного магазина WKHTMLTOPDF не будет использоваться, если вы также не установите: > > ```shell > ALLOW_UNTRUSTED_SERVER_FETCHING=true > ``` > > Однако это имеет важные последствия для безопасности, более подробная информация на этой странице: https://www.bookstackapp.com/docs/admin/pdf-rendering/ thank you very much
Author
Owner

@ssddanbrown commented on GitHub (Feb 4, 2022):

No worries, I assume this is therefore solved so will close this off.

@ssddanbrown commented on GitHub (Feb 4, 2022): No worries, I assume this is therefore solved so will close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2639