Uknown error during pdf export #1320

Closed
opened 2026-02-05 00:35:40 +03:00 by OVERLORD · 16 comments
Owner

Originally created by @denisdal on GitHub (Aug 28, 2019).

Describe the bug
Hi all, during pdf export of a book with many pages (177 in my example) the process exit with an error

Steps To Reproduce
Steps to reproduce the behavior:

  1. Go to the desired book
  2. Click on PDF Export
  3. wait
  4. See error

Expected behavior
prompt pdf download/open

Screenshots
immagine

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): v0.25.5
  • PHP Version: PHP 7.2.19-0ubuntu0.18.04.2
  • Hosting Method (Nginx/Apache/Docker): Apache2

Additional context
I tried:

With a small book (< 10 pages) pdf export is fine.
Any suggestions ?

Originally created by @denisdal on GitHub (Aug 28, 2019). **Describe the bug** Hi all, during pdf export of a book with many pages (177 in my example) the process exit with an error **Steps To Reproduce** Steps to reproduce the behavior: 1. Go to the desired book 2. Click on PDF Export 3. wait 4. See error **Expected behavior** prompt pdf download/open **Screenshots** ![immagine](https://user-images.githubusercontent.com/30142395/63838538-cda8d680-c97d-11e9-8c34-bf09e656046b.png) **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): v0.25.5 - PHP Version: PHP 7.2.19-0ubuntu0.18.04.2 - Hosting Method (Nginx/Apache/Docker): Apache2 **Additional context** I tried: - switch to wkhtmltopdf (https://www.bookstackapp.com/docs/admin/pdf-rendering/) with no results. Same error but I see that wkhtmltopdf was called. - Increase php memory_limit and max_execution_time With a small book (< 10 pages) pdf export is fine. Any suggestions ?
OVERLORD added the 🐕 Support label 2026-02-05 00:35:40 +03:00
Author
Owner

@over-soul commented on GitHub (Aug 28, 2019):

What did you change memory limit and execution time to?

After you made the changes, did you run:

sudo systemctl restart php7.2.19-fpm.service

@over-soul commented on GitHub (Aug 28, 2019): What did you change memory limit and execution time to? After you made the changes, did you run: `sudo systemctl restart php7.2.19-fpm.service`
Author
Owner

@denisdal commented on GitHub (Aug 28, 2019):

memory_limit = 256M
max_execution_time = 300

I restarted apache2 service directly as works in prefork not via FPM

@denisdal commented on GitHub (Aug 28, 2019): `memory_limit = 256M` `max_execution_time = 300` I restarted apache2 service directly as works in prefork not via FPM
Author
Owner

@over-soul commented on GitHub (Aug 28, 2019):

When you check phpinfo do you see the right limit and execution time?

@over-soul commented on GitHub (Aug 28, 2019): When you check phpinfo do you see the right limit and execution time?
Author
Owner

@denisdal commented on GitHub (Aug 28, 2019):

Yes
immagine

@denisdal commented on GitHub (Aug 28, 2019): Yes ![immagine](https://user-images.githubusercontent.com/30142395/63866981-64908580-c9b4-11e9-88cf-1ddfe02f81d5.png)
Author
Owner

@over-soul commented on GitHub (Aug 28, 2019):

which version of wkhtmltopdf do you have?

@over-soul commented on GitHub (Aug 28, 2019): which version of wkhtmltopdf do you have?
Author
Owner

@denisdal commented on GitHub (Aug 28, 2019):

root@usermanual:~# wkhtmltopdf -V
wkhtmltopdf 0.12.5 (with patched qt)

@denisdal commented on GitHub (Aug 28, 2019): `root@usermanual:~# wkhtmltopdf -V` `wkhtmltopdf 0.12.5 (with patched qt)`
Author
Owner

@over-soul commented on GitHub (Aug 30, 2019):

What happens if you un-restrict the execution time by entering it as -1? Does it work then?
Also, are your pages primarily made up of text?

Also, how much ram does your server have?

@over-soul commented on GitHub (Aug 30, 2019): What happens if you un-restrict the execution time by entering it as -1? Does it work then? Also, are your pages primarily made up of text? Also, how much ram does your server have?
Author
Owner

@denisdal commented on GitHub (Aug 30, 2019):

Tried with max_execution_time = 0 and -1 and there are same error:
[Fri Aug 30 09:26:41.881842 2019] [php7:error] [pid 13038] [client 10.10.1.5:43413] PHP Fatal error: Maximum execution time of 0 seconds exceeded in /var/www/html/bookstack/vendor/symfony/polyfill-mbstring/Mbstring.php on line 500
Fatal error: Maximum execution time of -1+2 seconds exceeded (terminated) in /var/www/html/bookstack/vendor/symfony/polyfill-mbstring/Mbstring.php on line 500

Pages is primarily text but there are also images, not in all pages but they may have it.
Server with 1 GB RAM.

Thank you

@denisdal commented on GitHub (Aug 30, 2019): Tried with max_execution_time = 0 and -1 and there are same error: `[Fri Aug 30 09:26:41.881842 2019] [php7:error] [pid 13038] [client 10.10.1.5:43413] PHP Fatal error: Maximum execution time of 0 seconds exceeded in /var/www/html/bookstack/vendor/symfony/polyfill-mbstring/Mbstring.php on line 500` `Fatal error: Maximum execution time of -1+2 seconds exceeded (terminated) in /var/www/html/bookstack/vendor/symfony/polyfill-mbstring/Mbstring.php on line 500` Pages is primarily text but there are also images, not in all pages but they may have it. Server with 1 GB RAM. Thank you
Author
Owner

@ssddanbrown commented on GitHub (Sep 1, 2019):

@denisdal When you set max_execution_time to 300 was the browse loading for 5 minutes and did you see 300 in the resulting error log or were the experience/logged times different?

@ssddanbrown commented on GitHub (Sep 1, 2019): @denisdal When you set `max_execution_time` to 300 was the browse loading for 5 minutes and did you see `300` in the resulting error log or were the experience/logged times different?
Author
Owner

@denisdal commented on GitHub (Sep 2, 2019):

Well, no.
Browser return unknown error way before then 300 seconds.

@denisdal commented on GitHub (Sep 2, 2019): Well, no. Browser return unknown error way before then 300 seconds.
Author
Owner

@denisdal commented on GitHub (Sep 9, 2019):

Any help figuring out how to solve this ?
Thanks

@denisdal commented on GitHub (Sep 9, 2019): Any help figuring out how to solve this ? Thanks
Author
Owner

@denisdal commented on GitHub (Nov 4, 2019):

Any update ?

@denisdal commented on GitHub (Nov 4, 2019): Any update ?
Author
Owner

@ckdanny commented on GitHub (Dec 10, 2019):

I have met the same issue while exporting a large file which will cause mentioned error,
production.ERROR: Maximum execution time of 30 seconds exceeded

If the result file is smaller than around 5MB, it can export normally, otherwise, the error will be a trigger.

@denisdal May I know if you have figure out any possible solution for it?

@ckdanny commented on GitHub (Dec 10, 2019): I have met the same issue while exporting a large file which will cause mentioned error, `production.ERROR: Maximum execution time of 30 seconds exceeded` If the result file is smaller than around 5MB, it can export normally, otherwise, the error will be a trigger. @denisdal May I know if you have figure out any possible solution for it?
Author
Owner

@denisdal commented on GitHub (Dec 10, 2019):

No I'm still having this issue so far

@denisdal commented on GitHub (Dec 10, 2019): No I'm still having this issue so far
Author
Owner

@xavierlaviolette commented on GitHub (May 14, 2020):

Hello, i have the same problem. I do this change :
memory_limit = 256M
max_execution_time = 300
and restart the server but i have always this error.

Can you help me ?
Thanks

@xavierlaviolette commented on GitHub (May 14, 2020): Hello, i have the same problem. I do this change : memory_limit = 256M max_execution_time = 300 and restart the server but i have always this error. Can you help me ? Thanks
Author
Owner

@ssddanbrown commented on GitHub (Nov 22, 2021):

Since the last comment on this issue is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one.

@ssddanbrown commented on GitHub (Nov 22, 2021): Since the last comment on this issue is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1320