PDF Printing issues

I have been using ERPNex v14 for a while, without any major issues. However, as of yesterday, when I select the pdf button, I am directed to the home page containing the message, below;

Server Error

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 69, in application
response = frappe.api.handle()
File “apps/frappe/frappe/api.py”, line 54, in handle
return frappe.handler.handle()
File “apps/frappe/frappe/handler.py”, line 45, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 83, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “apps/frappe/frappe/init.py”, line 1587, in call
return fn(*args, **newargs)
File “apps/frappe/frappe/utils/print_format.py”, line 129, in download_pdf
frappe.local.response.filecontent = get_pdf(html)
File “apps/frappe/frappe/utils/pdf.py”, line 38, in get_pdf
filedata = pdfkit.from_string(html, options=options or {}, verbose=True)
File “env/lib/python3.10/site-packages/pdfkit/api.py”, line 75, in from_string
return r.to_pdf(output_path)
File “env/lib/python3.10/site-packages/pdfkit/pdfkit.py”, line 201, in to_pdf
self.handle_error(exit_code, stderr)
File “env/lib/python3.10/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: ConnectionRefusedError

it is noteworthy, the pdf email attachment works all be it without the logo.

any expedited help, in this regard will be most appriciated.


See if the solution here helps: https://discuss.frappe.io/t/oserror-wkhtmltopdf-reported-an-error-exit-with-code-1-due-to-network-error-sslhandshakefailederror/96029

Thank you for your prompt response.

It is all well again.

I have heard from other sources this is related to the page range you actually print.

Thank you for your response.

Addition of the correct hostname to site-config.json resolved the issue for me.

to do this I used; bench --site <> set-config hostname “http://xxx.xxx.xx.xxx”.