PDF generation failed because of broken image links

frappe 15.32.0
erpnext 15.28.0
wkhtmltopdf 0.12.5 (with patched qt)

Traceback (most recent call last):
File “apps/frappe/frappe/utils/pdf.py”, line 90, in get_pdf
filedata = pdfkit.from_string(html, options=options or {}, verbose=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “env/lib/python3.11/site-packages/pdfkit/api.py”, line 75, in from_string
return r.to_pdf(output_path)
^^^^^^^^^^^^^^^^^^^^^
File “env/lib/python3.11/site-packages/pdfkit/pdfkit.py”, line 201, in to_pdf
self.handle_error(exit_code, stderr)
File “env/lib/python3.11/site-packages/pdfkit/pdfkit.py”, line 155, in handle_error
raise IOError(‘wkhtmltopdf reported an error:\n’ + stderr)
OSError: wkhtmltopdf reported an error:
Exit with code 1 due to network error: ContentOperationNotPermittedError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 114, in application
response = frappe.api.handle(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/api/init.py”, line 49, in handle
data = endpoint(**arguments)
^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/api/v1.py”, line 36, in handle_rpc_call
return frappe.handler.handle()
^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/handler.py”, line 49, in handle
data = execute_cmd(cmd)
^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/handler.py”, line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/init.py”, line 1768, in call
return fn(*args, **newargs)
^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/utils/typing_validations.py”, line 31, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/utils/print_format.py”, line 234, in download_pdf
pdf_file = frappe.get_print(
^^^^^^^^^^^^^^^^^
File “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 “apps/frappe/frappe/utils/pdf.py”, line 98, in get_pdf
frappe.throw(_(“PDF generation failed because of broken image links”))
File “apps/frappe/frappe/init.py”, line 645, in throw
msgprint(
File “apps/frappe/frappe/init.py”, line 610, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 561, in _raise_exception
raise exc

frappe.exceptions.ValidationError: PDF generation failed because of broken image links

Anyone who can give solution?

@Zaryabqureshi I’m experiencing a similar problem. Mine occurs when sending out emails, leading to emails not being sent. However when I manually resend the emails from the Email Queue List, they’re sent without issues.

Ah great, Thanks for letting me know.

But a serious concern, there are so many emails to schedule at every hour if manually sending emails to customer its gonna take time

It seems to be an issue with the Print Format builder. There’s an open issue on Github but nobody is addressing it. @revant_one Please point us in the right direction here. This is mission critical to most companies

1 Like

Hi,

See if anything in this thread is helpful:

1 Like

wkhtmltopdf 0.12.6.1 (with patched qt) we were using this package and getting en error of image broken link.

I will check and let you know by adding full address, maybe it will work.
Thanks