Open LuanGB opened 10 months ago
After upgrading to 2.7.0 version, the pdf generation fails on non-dev/test environment with the following error:
No such file or directory @ apply2files - /tmp/wicked_header_pdf20230905-21-mm5ta8.html
backtrace:
vendor/bundle/ruby/2.7.0/gems/wicked_pdf-2.7.0/lib/wicked_pdf.rb:112 delete vendor/bundle/ruby/2.7.0/gems/wicked_pdf-2.7.0/lib/wicked_pdf.rb:112 block in clean_temp_files vendor/bundle/ruby/2.7.0/gems/wicked_pdf-2.7.0/lib/wicked_pdf.rb:112 each vendor/bundle/ruby/2.7.0/gems/wicked_pdf-2.7.0/lib/wicked_pdf.rb:112 clean_temp_files vendor/bundle/ruby/2.7.0/gems/wicked_pdf-2.7.0/lib/wicked_pdf.rb:85 pdf_from_url vendor/bundle/ruby/2.7.0/gems/wicked_pdf-2.7.0/lib/wicked_pdf.rb:36 pdf_from_html_file vendor/bundle/ruby/2.7.0/gems/wicked_pdf-2.7.0/lib/wicked_pdf.rb:44 pdf_from_string
The issue seems to be related with the #clean_temp_files method.
#clean_temp_files
wicked_pdf gem version (output of cat Gemfile.lock | grep wicked_pdf): 2.7.0
cat Gemfile.lock | grep wicked_pdf
wkhtmltopdf version (output of wkhtmltopdf --version): 0.12.6.1 (with patched qt)
wkhtmltopdf --version
whtmltopdf provider gem and version if one is used:
platform/distribution and version (e.g. Windows 10 / Ubuntu 16.04 / Heroku cedar): Alpine
@unixmonkey created a PR with a simple fix: #1074
Issue description
After upgrading to 2.7.0 version, the pdf generation fails on non-dev/test environment with the following error:
backtrace:
The issue seems to be related with the
#clean_temp_files
method.Expected or desired behavior
#clean_temp_files
checks if file exists before trying to deleteSystem specifications
wicked_pdf gem version (output of
cat Gemfile.lock | grep wicked_pdf
): 2.7.0wkhtmltopdf version (output of
wkhtmltopdf --version
): 0.12.6.1 (with patched qt)whtmltopdf provider gem and version if one is used:
platform/distribution and version (e.g. Windows 10 / Ubuntu 16.04 / Heroku cedar): Alpine