Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/pdf.py”, line 38, in get_pdf
filedata = pdfkit.from_string(html, False, options=options or {})
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pdfkit/api.py”, line 72, in from_string
return r.to_pdf(output_path)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pdfkit/pdfkit.py”, line 156, in to_pdf
raise IOError(‘wkhtmltopdf reported an error:\n’ + stderr)
OSError: wkhtmltopdf reported an error:
QSslSocket: cannot resolve CRYPTO_num_locks
QSslSocket: cannot resolve CRYPTO_set_id_callback
QSslSocket: cannot resolve CRYPTO_set_locking_callback
QSslSocket: cannot resolve sk_free
QSslSocket: cannot resolve sk_num
QSslSocket: cannot resolve sk_pop_free
QSslSocket: cannot resolve sk_value
QSslSocket: cannot resolve SSL_library_init
QSslSocket: cannot resolve SSL_load_error_strings
QSslSocket: cannot resolve SSLv3_client_method
QSslSocket: cannot resolve SSLv23_client_method
QSslSocket: cannot resolve SSLv3_server_method
QSslSocket: cannot resolve SSLv23_server_method
QSslSocket: cannot resolve X509_STORE_CTX_get_chain
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf
QSslSocket: cannot resolve SSLeay
QSslSocket: cannot call unresolved function CRYPTO_num_locks
QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function sk_num
Exit with code 1 due to network error: ContentNotFoundError
QSslSocket: cannot call unresolved function CRYPTO_num_locks
QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 62, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/api.py”, line 55, in handle
return frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 61, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1054, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/print_format.py”, line 92, in download_pdf
frappe.local.response.filecontent = get_pdf(html)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/pdf.py”, line 46, in get_pdf
frappe.throw(_(“PDF generation failed because of broken image links”))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 377, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 356, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 316, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: PDF generation failed because of broken image links
I got the following error trying to export. Solution was to delete all stylesheet links and script tags linking to files that were pointing to non-existing files. (“assets/bootstrap/css/bootstrap.min.css” for example)
Just commenting in case anybody else has the same issue and finds this thread!
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/pdf.py", line 39, in get_pdf
filedata = pdfkit.from_string(html, False, options=options or {})
File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pdfkit/api.py", line 72, in from_string
return r.to_pdf(output_path)
File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pdfkit/pdfkit.py", line 156, in to_pdf
raise IOError('wkhtmltopdf reported an error:\n' + stderr)
OSError: wkhtmltopdf reported an error:
Exit with code 1 due to network error: ContentNotFoundError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 64, in application
response = frappe.api.handle()
File "/home/frappe/frappe-bench/apps/frappe/frappe/api.py", line 59, in handle
return frappe.handler.handle()
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 24, in handle
data = execute_cmd(cmd)
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 64, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1064, in call
return fn(*args, **newargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/print_format.py", line 92, in download_pdf
frappe.local.response.filecontent = get_pdf(html)
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/pdf.py", line 47, in get_pdf
frappe.throw(_("PDF generation failed because of broken image links"))
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 377, in throw
msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable)
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 356, in msgprint
_raise_exception()
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 316, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: PDF generation failed because of broken image links
I have the same problem.
I have no images in my report. Example User Document, goto Print → HTML Preview and then to PDF.
I get
OSError: wkhtmltopdf reported an error:
Exit with code 1 due to network error: ContentNotFoundError
and as following error
frappe.exceptions.ValidationError: PDF-Generierung ist aufgrund fehlerhafter Verknüpfungen für Bilddateien fehlgeschlagen
I have tried all variants of host_name in site.config, but no success.
It is at this time a showstopper, because my app depends very much on the PDF functionality.
I had the same problem,but i sorted it out by going to the server at location **cd /etc** then i **sudo nano hosts**
then i added this line 127.0.0.1 erp.domain.com
this sorted my issue