jhonnymertz/java-wkhtmltopdf-wrapper

Exit with code 1 due to network error: ConnectionRefusedError

hpardess opened this issue · 1 comments

Jul 26 13:59:01 ip-172-31-31-97 oms.jar[317062]: com.github.jhonnymertz.wkhtmltopdf.wrapper.exceptions.PDFExportException: Process (/usr/local/bin/wkhtmltopdf --margin-top 10 --margin-bottom 0 --margin-left 20 --margin-right 20 --enable-local-file-access --viewport-size 1920×1080 /tmp/java-wkhtmltopdf-wrapper24ad1ef4-dd81-4f36-85fb-37a2836d66628538789048534919579.html /upload/tmp/08cbe37d-f5f3-4e36-96bd-c5cb55222ed2_1627307939947.pdf) exited with status code 1:
Jul 26 13:59:01 ip-172-31-31-97 oms.jar[317062]: Loading pages (1/6)
Jul 26 13:59:01 ip-172-31-31-97 oms.jar[317062]: [361B blob data]
Jul 26 13:59:01 ip-172-31-31-97 oms.jar[317062]: [356B blob data]
Jul 26 13:59:01 ip-172-31-31-97 oms.jar[317062]: [98B blob data]
Jul 26 13:59:01 ip-172-31-31-97 oms.jar[317062]: [110B blob data]
Jul 26 13:59:01 ip-172-31-31-97 oms.jar[317062]: Printing pages (6/6)
Jul 26 13:59:01 ip-172-31-31-97 oms.jar[317062]: [152B blob data]
Jul 26 13:59:01 ip-172-31-31-97 oms.jar[317062]: Exit with code 1 due to network error: ConnectionRefusedError
Jul 26 13:59:01 ip-172-31-31-97 oms.jar[317062]: at com.github.jhonnymertz.wkhtmltopdf.wrapper.Pdf.getPDF(Pdf.java:218)
Jul 26 13:59:01 ip-172-31-31-97 officems.jar[317062]: at com.github.jhonnymertz.wkhtmltopdf.wrapper.Pdf.saveAsDirect(Pdf.java:189)

Environment:

  • java-wkhtmltopdf-wrapper version: 1.1.13
  • wkhtmltopdf version: 0.12.6
  • OS: Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-1045-aws x86_64)

The issue is solved by adding following line of code
pdf.setAllowMissingAssets();