**Support - wkhtmltopdf**

Having some challenges in setting up wkhtmltopdf. Base OS is Ubuntu server 18.04, enterprise code e2.20.3. Installed wkhtmltox_0.12.6-1.bionic_amd64.deb (but also tried wkhtmltox_0.12.5-1.bionic_amd64.deb). The command line test of wkhtmltopdf www.google.com /tmp/google.pdf works perfectly, and quite quickly. The PDF looks good as well.

When I try the wkhtmltopdf https://fqdn/settings/testPdf test.pdf it gets to 10%, then times out after 60 seconds (from the command line). Tried both normal and sudo.

Error on the command line is:

root@flare:/home/administrator# wkhtmltopdf https://fqdn/settings/testPdf test.pdf
Loading pages (1/6)
Error: Failed to load https://fqdn/settings/testPdf, with network status code 4 and http status code 0 - Socket operation timed out
Error: Failed loading page https://fqdn/settings/testPdf (sometimes it will work just to ignore this error with --load-error-handling ignore)
Exit with code 1 due to network error: TimeoutError

In the app, error is:

An error occurred while we tried to generate a test pdf - the configured path or the library is wrong, please review the installation.

Path is set to: /usr/local/bin/wkhtmltopdf

In the app error log, I get this:

[Symfony\Component\Process\Exception\ProcessTimedOutException] The process “/usr/local/bin/wkhtmltopdf --lowquality --dpi ‘100’ --orientation ‘portrait’ ‘https://fqdn/settings/testPdf’ ‘/tmp/knp_snappy60c12bd59a6737.12138811.pdf’” exceeded the timeout of 60 seconds.

I saw another post about changing the hosts file which I tried, but that looks like a RedHat specific issue, regardless it didn’t help.

This is the last system health issue I think I need to address.

Appreciate any coaching here please.

With regards,

Tim

Hello Tim,

Server needs to be able to connect to itself. So you need to have a look at this with your network team.

Ahh, that was the hint I needed, resolved now, thanks!

1 Like