-
Notifications
You must be signed in to change notification settings - Fork 646
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
Random "Error: PDF could not be generated!" after upgrade from 2.1 to 2.6.3 #1064
Comments
Having same error here, without |
Does reverting solve your problem? Did you also upgrade Something I've always tried to do is make sure my assets are always local files before PDF generation, and nothing is being fetched over the network in real-time. |
Any update on this? Would an update to 2.7.0 or 2.8.0 fix this? |
@staffler-xyz Possibly, but probably not. Have you tried yet? Please provide more information if you can. What is the actual error? Do you get a stacktrace? What version are you running? Is it also random (like it works most of the time)? I can't think of any good reason this happens randomly, unless your system is getting rid of tempfiles that are still in-use, or you have system limits that prevent too many |
hi, I get this error:
(unfortunately the output is truncated at the end) wicked_pdf gem version (output of cat Gemfile.lock | grep wicked_pdf): wicked_pdf (2.6.3) |
@staffler-xyz Does it always die out like this? Is it random, or every time for this specific PDF generation? This looks like Try either enabling that option, or disabling custom headers and footers, or some combination of both. Also make sure your footer is a complete and valid HTML document, including doctype and |
it happens randomly, usually it works after reloading the page. But it also fails in the background with ActiveJob and We don't use local files, only images from CDN. This is our layout (simplified):
I noticed that this might be the problem:
Should it be replaced with:
Did anyone solve this successfully? |
Is it possible that generating the PDF is exceeding Heroku's memory limit, and thus getting killed off before it finishes? |
I don't think so, memory is 16GB RAM and the application is running at about 1GB RAM (no spikes when running wkhtmltopdf commands) |
If possible, try downloading remote resources from the CDN into local files or tempfiles or base64, and loading that instead. I don't have any solid reasons for this, but experience & casually googling |
ok, thanks for your hints. I will check again and post the solution here, if found. |
First of all, thank you for your work on maintaining this gem for the community! 🙇
Issue description
After an upgrade from 2.1 to 2.6.3 we're experiencing random PDF generation failures.
Calling:
randomly results in the following:
Retrying the same, with the same content, can result in success, hence the random nature of the issue.
Our configuration is:
I'd be happy to share more information, but I need to figure out where to start and what's helpful.
Expected or desired behavior
Consistent PDF generation.
System specifications
wicked_pdf gem version (output of
cat Gemfile.lock | grep wicked_pdf
):wicked_pdf (2.6.3)
wkhtmltopdf version (output of
wkhtmltopdf --version
):0.12.6.1
whtmltopdf provider gem and version if one is used:
https://github.com/zakird/wkhtmltopdf_binary_gem
platform/distribution and version (e.g. Windows 10 / Ubuntu 16.04 / Heroku cedar):
heroku-22
The text was updated successfully, but these errors were encountered: