rposborne/wkhtmltopdf-heroku

Error: PDF could not be generated!

Closed this issue · 12 comments

All of a sudden today I'm getting

`Command Error:
2015-03-30T19:46:07.712683+00:00 app[worker.1]: ["/app/vendor/bundle/ruby/1.9.1/bin/wkhtmltopdf", "-q", "--margin-top", "5", "--margin-bottom", "5", "--margin-left", "5", "--margin-right", "5", "file:///tmp/wicked_pdf20150330-3-5v5qy9.html", "/tmp/wicked_pdf_generated_file20150330-3-17xdczx.pdf"]

Error: PDF could not be generated!`

We have not deployed or made any changes. Anyone else experiencing this?

which version of wkthtmltopdf are you running?
and also, what's your heroku stack? (cedar or cedar-14)

2.12.2.1 on Cedar-14

restarting server seems to correct the issue temporarily. Happening both in web process and in worker process.

Sorry, misread. wkhtmltopdf version 0.9.9.3

you should update wkhtmltopdf. I believe 0.9.9.3 was not built for ubuntu 14

wkhtmltopdf 0.12.2.1
wkhtmltopdf-heroku 2.12.2.1

Still having intermittent issues. It will lock up the worker and the only way to recover is manual restarting. After doing so error message in original post will be outputted in logs.

In the web process, generating the same pdf it will work correctly and quickly or timeout. No recognizable pattern to when it works and does not.

that's really odd. Have you been monitoring the ram usage of the dynos? Was there any external requests in your source html file?

RAM is fine on dynos. There is an external request to s3, which we've been using for the past 2 years and have generated 100s of thousands of PDFs with no issue.

Hmm I'm not sure what might be the issue here. Could you try to run wkhtmltopdf binary manually when this issue happens?

(run bash on heroku and navigate to the gem folders)

Having almost identical problem. Was the cause identified?

It's probably not related to this gem.

Could you try to reproduce this issue with a different wrapper gem? (e.g. WisePDF, PDFKit...etc) or even without using any ruby - just run bash in you heroku dyno, and execute wkhtmltopdf binary directly.

I never figured out why this happened to me. It just went back to working correctly without any doing on my part several hours later.