Error comes while sending an Purchase quote

“attachments”: “[]”,
“cc”: [],
“communication_name”: “4fe67cb77c”,
“lang”: “en”,
“print_format”: “Purchase order”,
“print_html”: “”,
“recipients”: [
mail@outlook.com
]
}
Traceback (most recent call last):
File “/home/azureuser/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py”, line 387, in sendmail
recipients=recipients, cc=cc)
File “/home/azureuser/frappe-bench/apps/frappe/frappe/core/doctype/communication/communication.py”, line 179, in _notify
_notify(self, print_html, print_format, attachments, recipients, cc)
File “/home/azureuser/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py”, line 121, in _notify
prepare_to_notify(doc, print_html, print_format, attachments)
File “/home/azureuser/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py”, line 220, in prepare_to_notify
print_format=print_format, html=print_html))
File “/home/azureuser/frappe-bench/apps/frappe/frappe/init.py”, line 1193, in attach_print
“fcontent”: get_print(doctype, name, print_format=print_format, style=style, html=html, as_pdf=True, doc=doc)
File “/home/azureuser/frappe-bench/apps/frappe/frappe/init.py”, line 1176, in get_print
return get_pdf(html, output = output)
File “/home/azureuser/frappe-bench/apps/frappe/frappe/utils/pdf.py”, line 17, in get_pdf
pdfkit.from_string(html, fname, options=options or {})
File “/home/azureuser/frappe-bench/env/src/pdfkit/pdfkit/api.py”, line 68, in from_string
return r.to_pdf(output_path)
File “/home/azureuser/frappe-bench/env/src/pdfkit/pdfkit/pdfkit.py”, line 140, in to_pdf
raise IOError(‘wkhtmltopdf reported an error:\n’ + stderr.decode(‘utf-8’))
IOError: wkhtmltopdf reported an error:
Exit with code 1 due to network error: HostNotFoundError

Check you host_name in site_config.json file.

It should be "host_name": "http://localhost:8000"

unable to find the entry on site_config file

Add host name to it if it is not there.

Thanks …its works

Didn’t work for me. My site gave me errors as soon as i made the entries on site_config.json

Please change the hostname with IP address

it still doesn’t work. as soon as i modify my site_config.json file by adding the ip address, i get internal server error on my site. the only way i get my site back up is if i delete the host name entry. my site has been changed from the default site1.local to erp.mycompany.com and i use route 53 to redirect my domain url to my erpnext instance on aws.

Apart from this error i am also unable to install ssl certificate to my site as i a timeout error on the acme challenge. The solution i’ve seen online is the same as proffered for the printing error as above but it has not worked in both instances as i lose access to my site when i add hostname to my site config file.

please try with hostname "erp.mycompany.com:53 "or 80

cross check the config.json location
/home/frappe/frappe-bench/sites/site1.local/site_config.json