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: The switch --print-media-type, is not support using unpatched qt, and will be ignored.The switch --disable-smart-shrinking, is not support using unpatched qt, and will be ignored.QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to ‘/tmp/runtime-erpnextuser001’ Exit with code 1 due to network error: ConnectionRefusedError
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 1599, 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
with wkhtmltopdf 0.12.6.1 (with patched qt). I wonder if there are more than one wkhtmltopdf installed?
Adding the stanza slowed the site page loads greatly, but the problem still remains. May I know if you have letsencrypt deployed ? It is not here and I’m wondering if there is a ssl element here.
I restarted the bench and found this error:
Traceback (most recent call last):
File “/home/erpnextuser001/.local/bin/bench”, line 10, in
sys.exit(cli())
File “/usr/local/lib/python3.9/dist-packages/bench/cli.py”, line 80, in cli
bench_config = get_config(“.”)
File “/usr/local/lib/python3.9/dist-packages/bench/config/common_site_config.py”, line 30, in get_config
return get_common_site_config(bench_path)
File “/usr/local/lib/python3.9/dist-packages/bench/config/common_site_config.py”, line 38, in get_common_site_config
return json.load(f)
File “/usr/lib/python3.9/json/init.py”, line 293, in load
return loads(fp.read(),
File “/usr/lib/python3.9/json/init.py”, line 346, in loads
return _default_decoder.decode(s)
File “/usr/lib/python3.9/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/lib/python3.9/json/decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 21 column 15 (char 589)