Env file option to encrease PDF render timeout #4421

Open
opened 2026-02-05 08:51:21 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @baevga on GitHub (Jan 22, 2024).

Describe the feature you'd like

Hello!

I faced with timeout issue while pdf export and didn't find the option of .env file to control this behaiviour.
[2024-01-22 20:04:17] production.ERROR: The process "/usr/local/bin/wkhtmltopdf --lowquality --page-size 'A4' --outline --print-media-type '/tmp/knp_snappy65ae9fd597ee72.18454063.html' '/tmp/knp_snappy65ae9fd5a8eac8.16039684.pdf'" exceeded the timeout of 60 seconds. {"userId":3,"exception":"[object] (Symfony\\Component\\Process\\Exception\\ProcessTimedOutException(code: 0): The process \"/usr/local/bin/wkhtmltopdf --lowquality --page-size 'A4' --outline --print-media-type '/tmp/knp_snappy65ae9fd597ee72.18454063.html' '/tmp/knp_snappy65ae9fd5a8eac8.16039684.pdf'\" exceeded the timeout of 60 seconds. at /var/www/bookstack/vendor/symfony/process/Process.php:1152)

I found app/Config/snappy.php file where i changed 'timeout' => false value to 120 seconds and after that it became working.
But it will override during next update and i belive it should be great to have option to change it permanently using config.

Thank you!

Describe the benefits this would bring to existing BookStack users

Exporting huge books to pdf

Can the goal of this request already be achieved via other means?

No

Have you searched for an existing open/closed issue?

  • I have searched for existing issues and none cover my fundamental request

How long have you been using BookStack?

3 months to 1 year

Additional context

No response

Originally created by @baevga on GitHub (Jan 22, 2024). ### Describe the feature you'd like Hello! I faced with timeout issue while pdf export and didn't find the option of .env file to control this behaiviour. ```[2024-01-22 20:04:17] production.ERROR: The process "/usr/local/bin/wkhtmltopdf --lowquality --page-size 'A4' --outline --print-media-type '/tmp/knp_snappy65ae9fd597ee72.18454063.html' '/tmp/knp_snappy65ae9fd5a8eac8.16039684.pdf'" exceeded the timeout of 60 seconds. {"userId":3,"exception":"[object] (Symfony\\Component\\Process\\Exception\\ProcessTimedOutException(code: 0): The process \"/usr/local/bin/wkhtmltopdf --lowquality --page-size 'A4' --outline --print-media-type '/tmp/knp_snappy65ae9fd597ee72.18454063.html' '/tmp/knp_snappy65ae9fd5a8eac8.16039684.pdf'\" exceeded the timeout of 60 seconds. at /var/www/bookstack/vendor/symfony/process/Process.php:1152)``` I found `app/Config/snappy.php ` file where i changed `'timeout' => false` value to 120 seconds and after that it became working. But it will override during next update and i belive it should be great to have option to change it permanently using config. Thank you! ### Describe the benefits this would bring to existing BookStack users Exporting huge books to pdf ### Can the goal of this request already be achieved via other means? No ### Have you searched for an existing open/closed issue? - [X] I have searched for existing issues and none cover my fundamental request ### How long have you been using BookStack? 3 months to 1 year ### Additional context _No response_
OVERLORD added the 🔨 Feature Request label 2026-02-05 08:51:21 +03:00
Author
Owner

@lexasub commented on GitHub (Jan 23, 2024):

Hello, i create pull request on it:
https://github.com/BookStackApp/BookStack/pull/4792

@lexasub commented on GitHub (Jan 23, 2024): Hello, i create pull request on it: https://github.com/BookStackApp/BookStack/pull/4792
Author
Owner

@ssddanbrown commented on GitHub (Jan 23, 2024):

Thanks for the request @baevga.
I'm hesitant to increase the limit here though, or make it configurable, since 60 seconds is already quite a lot and needing longer is usually an indicator of an underlying issue rather.

Thanks for the PR @lexasub but the change in that PR likely does not affect PDFs, or any functionality in BookStack, and as above I'm not keen in increasing this or making it configurable.

@ssddanbrown commented on GitHub (Jan 23, 2024): Thanks for the request @baevga. I'm hesitant to increase the limit here though, or make it configurable, since 60 seconds is already quite a lot and needing longer is usually an indicator of an underlying issue rather. Thanks for the PR @lexasub but the change in that PR likely does not affect PDFs, or any functionality in BookStack, and as above I'm not keen in increasing this or making it configurable.
Author
Owner

@baevga commented on GitHub (Jan 23, 2024):

Thank you for your so fast answer @ssddanbrown !

I'm sad panda :(
I thought configurable option can't cause any negative effect.
We have pretty big book such as usage guide and exporting of it is taking more then 60 sec.
Of course, maybe, if use more resources it can be faster but i'm not very happy to increase hw resourses only for this operation because in any other operations bookstack is rocket.

I'll be happy if this option will appear in some future releases.

@baevga commented on GitHub (Jan 23, 2024): Thank you for your so fast answer @ssddanbrown ! I'm sad panda :( I thought configurable option can't cause any negative effect. We have pretty big book such as usage guide and exporting of it is taking more then 60 sec. Of course, maybe, if use more resources it can be faster but i'm not very happy to increase hw resourses only for this operation because in any other operations bookstack is rocket. I'll be happy if this option will appear in some future releases.
Author
Owner

@abr1x commented on GitHub (Feb 5, 2024):

It would be great if this could be implemented.

We are facing the same problem right now, and it would be kind of a waste of resources to increase the overall server resources just for the export of a huge book or shelf in general, which happens every now and then.

@abr1x commented on GitHub (Feb 5, 2024): It would be great if this could be implemented. We are facing the same problem right now, and it would be kind of a waste of resources to increase the overall server resources just for the export of a huge book or shelf in general, which happens every now and then.
Author
Owner

@DanielGordonIT commented on GitHub (Feb 16, 2024):

When using the default PDF export package, you can modify your php-local.ini (/config/php/php-local.ini or bookstack_app_data/php/php_local.ini in the lscr.io docker image) to increase the timeout. Adding a max_execution_time = 300 fixed any issues with exporting ridiculously long PDFs that we had. Is this a good idea? Not really. Does it work? Yes.

@DanielGordonIT commented on GitHub (Feb 16, 2024): When using the default PDF export package, you can modify your `php-local.ini` (`/config/php/php-local.ini` or `bookstack_app_data/php/php_local.ini` in the lscr.io docker image) to increase the timeout. Adding a `max_execution_time = 300` fixed any issues with exporting ridiculously long PDFs that we had. Is this a good idea? Not really. Does it work? Yes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4421