I am using wickedpdf gem for generating pdf's in my rails application. Every thing runs normally, except for few requests on production fail, with the following error log.
Error: Failed to execute: ["/usr/local/bin/wkhtmltopdf", "-q", "--page-size", "A4", "--margin-top", "20", "--margin-bottom", "25", "--margin-left", "0", "--margin-right", "0", "--footer-spacing", "5", "--footer-html", "file:////tmp/wicked_footer_pdf20160714-2229-1bb7qcg.html", "file:////tmp/wicked_pdf20160714-2229-18kjik5.html", "/tmp/wicked_pdf_generated_file20160714-2229-1t66b4y.pdf"] Error: PDF could not be generated! Command Error: terminate called after throwing an instance of 'std::bad_alloc'
I am not able to reproduce this on my local/staging.
The following is my setup:
Production server running on Centos 7 on AWS-EC2. Copied wkhtmltopdf binary for linux 64-bit from http://wkhtmltopdf.org/downloads.html to /usr/local/bin/wkhtmltopdf
with version 0.12.0. Added initializer for Wickedpdf to point to wkhtmltopdf.