erpnext icon indicating copy to clipboard operation
erpnext copied to clipboard

error wkhtmltopdf library when converting HTML to PDF (email receipt on POS)

Open Nyuuk opened this issue 8 months ago • 2 comments

Information about bug

Hello,

I encountered an issue when trying to send an email receipt from POS, and I found this error in the Email Queue List.

Thank you.

Module

selling

Version

  • ERPNext: v15.17.0
  • Frappe Framework: v15.28.0
  • Docker Debian 12
  • Bench: 5.22.3
  • wkhtmltopdf 0.12.6.1 (with patched qt)

Installation method

docker

Relevant log output / Stack trace / Full Error Message.

File "/workspace/frappe-dev-toko-ac/apps/frappe/frappe/email/doctype/email_queue/email_queue.py", line 167, in send
    message = ctx.build_message(recipient.recipient)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/frappe-dev-toko-ac/apps/frappe/frappe/email/doctype/email_queue/email_queue.py", line 314, in build_message
    message = self.include_attachments(message)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/frappe-dev-toko-ac/apps/frappe/frappe/email/doctype/email_queue/email_queue.py", line 387, in include_attachments
    print_format_file = frappe.attach_print(**attachment)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/frappe-dev-toko-ac/apps/frappe/frappe/__init__.py", line 2225, in attach_print
    else get_print(doctype, name, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/frappe-dev-toko-ac/apps/frappe/frappe/__init__.py", line 2184, in get_print
    return get_pdf(html, options=pdf_options, output=output) if as_pdf else html
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/frappe-dev-toko-ac/apps/frappe/frappe/utils/pdf.py", line 90, in get_pdf
    filedata = pdfkit.from_string(html, options=options or {}, verbose=True)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/frappe-dev-toko-ac/env/lib/python3.11/site-packages/pdfkit/api.py", line 75, in from_string
    return r.to_pdf(output_path)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/frappe-dev-toko-ac/env/lib/python3.11/site-packages/pdfkit/pdfkit.py", line 201, in to_pdf
    self.handle_error(exit_code, stderr)
  File "/workspace/frappe-dev-toko-ac/env/lib/python3.11/site-packages/pdfkit/pdfkit.py", line 155, in handle_error
    raise IOError('wkhtmltopdf reported an error:\n' + stderr)

Nyuuk avatar Jun 21 '24 10:06 Nyuuk