Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout exceeded exception #292

Closed
Vercryger opened this issue Dec 14, 2017 · 3 comments
Closed

Timeout exceeded exception #292

Vercryger opened this issue Dec 14, 2017 · 3 comments

Comments

@Vercryger
Copy link

I have read #221 and #169 and there is no clear solution for this issue, I only get this exception no matter what content is at /reportendpoint:

The process "/usr/local/bin/wkhtmltopdf --lowquality 'http://localhost:8000/api/v1/report' '/var/folders/2m/5k5yt7_93pj2bmm7my3c0tzc0000gn/T/knp_snappy5a31edc8ab61e5.34915099.pdf'" exceeded the timeout of 60 seconds.

If I try to run this using the wkhtmltopdf cli, everything work just fine almost instantly:

$ wkhtmltopdf http://localhost:8000/api/v1/report out.pdf
Loading pages (1/6)
Warning: SSL error ignored
Warning: SSL error ignored
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done
@williamhector
Copy link

Did you find a solution to this? I'm experiencing something similar.

@Vercryger
Copy link
Author

Hi @williamhector, I'm afraid not 😞 We decided to migrate everything about printing to a new app with Electron.

@williamhector
Copy link

Our problem turned out to be an issue with the way we were running wkhtmltopdf, not with snappy or wkhtmltopdf itself.
We are running an Azure web server (CentOS-ish) and had a bash script at /usr/local/bin/wkhtmltoimage that simply ran:

#!/bin/bash
xvfb-run /bin/wkhtmltoimage "$@"

It would run fine from the command line, even when run as our Apache user from command line, however, when called from our PHP application, it would timeout and hog memory until it crashed Apache.

When I changed it to:

#!/bin/bash
xvfb-run /bin/wkhtmltoimage --use-xserver "$@"

it started working from our PHP app as well.

I'm not that knowledgeable on X server command and that --use-xserver option isn't mentioned in the wkhtmltopdf/image command line usage documentation, at least in our version of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants