Wkhtmltopdf reported an error: Exit with code 1 due to network error: HostNotFoundError

Email are fail, when I’m sending. It is giving following error:

wkhtmltopdf reported an error:
Exit with code 1 due to network error: HostNotFoundError

How it will be solved? while I’m sending my gmail account mail is send, but from this website mail sending showing error.

@megha007 check your email domain . probably it’s not working

1 Like

i am also facing this error
18:38:42 web.1 | Traceback (most recent call last):
18:38:42 web.1 | File “apps/frappe/frappe/app.py”, line 110, in application
18:38:42 web.1 | response = frappe.api.handle(request)
18:38:42 web.1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
18:38:42 web.1 | File “apps/frappe/frappe/api/init.py”, line 49, in handle
18:38:42 web.1 | data = endpoint(**arguments)
18:38:42 web.1 | ^^^^^^^^^^^^^^^^^^^^^
18:38:42 web.1 | File “apps/frappe/frappe/api/v1.py”, line 36, in handle_rpc_call
18:38:42 web.1 | return frappe.handler.handle()
18:38:42 web.1 | ^^^^^^^^^^^^^^^^^^^^^^^
18:38:42 web.1 | File “apps/frappe/frappe/handler.py”, line 49, in handle
18:38:42 web.1 | data = execute_cmd(cmd)
18:38:42 web.1 | ^^^^^^^^^^^^^^^^
18:38:42 web.1 | File “apps/frappe/frappe/handler.py”, line 85, in execute_cmd
18:38:42 web.1 | return frappe.call(method, **frappe.form_dict)
18:38:42 web.1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18:38:42 web.1 | File “apps/frappe/frappe/init.py”, line 1718, in call
18:38:42 web.1 | return fn(*args, **newargs)
18:38:42 web.1 | ^^^^^^^^^^^^^^^^^^^^
18:38:42 web.1 | File “apps/frappe/frappe/utils/typing_validations.py”, line 31, in wrapper
18:38:42 web.1 | return func(*args, **kwargs)
18:38:42 web.1 | ^^^^^^^^^^^^^^^^^^^^^
18:38:42 web.1 | File “apps/frappe/frappe/email/doctype/email_queue/email_queue.py”, line 442, in send_now
18:38:42 web.1 | record.send()
18:38:42 web.1 | File “apps/frappe/frappe/email/doctype/email_queue/email_queue.py”, line 167, in send
18:38:42 web.1 | message = ctx.build_message(recipient.recipient)
18:38:42 web.1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18:38:42 web.1 | File “apps/frappe/frappe/email/doctype/email_queue/email_queue.py”, line 314, in build_message
18:38:42 web.1 | message = self.include_attachments(message)
18:38:42 web.1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18:38:42 web.1 | File “apps/frappe/frappe/email/doctype/email_queue/email_queue.py”, line 387, in include_attachments
18:38:42 web.1 | print_format_file = frappe.attach_print(**attachment)
18:38:42 web.1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18:38:42 web.1 | File “apps/frappe/frappe/init.py”, line 2175, in attach_print
18:38:42 web.1 | else get_print(doctype, name, **kwargs)
18:38:42 web.1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18:38:42 web.1 | File “apps/frappe/frappe/init.py”, line 2134, in get_print
18:38:42 web.1 | return get_pdf(html, options=pdf_options, output=output) if as_pdf else html
18:38:42 web.1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18:38:42 web.1 | File “apps/frappe/frappe/utils/pdf.py”, line 89, in get_pdf
18:38:42 web.1 | filedata = pdfkit.from_string(html, options=options or {}, verbose=True)
18:38:42 web.1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18:38:42 web.1 | File “env/lib/python3.11/site-packages/pdfkit/api.py”, line 75, in from_string
18:38:42 web.1 | return r.to_pdf(output_path)
18:38:42 web.1 | ^^^^^^^^^^^^^^^^^^^^^
18:38:42 web.1 | File “env/lib/python3.11/site-packages/pdfkit/pdfkit.py”, line 201, in to_pdf
18:38:42 web.1 | self.handle_error(exit_code, stderr)
18:38:42 web.1 | File “env/lib/python3.11/site-packages/pdfkit/pdfkit.py”, line 155, in handle_error
18:38:42 web.1 | raise IOError(‘wkhtmltopdf reported an error:\n’ + stderr)
18:38:42 web.1 | OSError: wkhtmltopdf reported an error:
18:38:42 web.1 | Exit with code 1 due to network error: HostNotFoundError

@bahaou can u help me