Getting server error while creating pdf

Hi,
i am very new to this forum. recently installed erpnext in digital ocean docker. i am getting error while trying to generate pdf. Please suggest. log attached.

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 66, 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 31, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 68, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “apps/frappe/frappe/init.py”, line 1229, in call
return fn(*args, **newargs)
File “apps/frappe/frappe/utils/print_format.py”, line 93, in download_pdf
frappe.local.response.filecontent = get_pdf(html)
File “apps/frappe/frappe/utils/pdf.py”, line 37, in get_pdf
filedata = pdfkit.from_string(html, False, options=options or {})
File “env/lib/python3.9/site-packages/pdfkit/api.py”, line 72, in from_string
return r.to_pdf(output_path)
File “env/lib/python3.9/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: ConnectionRefusedError

Add the following code in pdf.py file (36 th line)

options = {
“enable-local-file-access”: None,
“quiet”: “”
}

1 Like