Error in email sending attachment wkhtmltopdf reported network error: ConnectionRefusedError

Hi,

I am getting an error while sending mail , but I am able to get auto email. Here is the error. Kindly help me.

{‘retry’: 0, ‘log’: <function log at 0x7fdeadc0b320>, ‘site’: u’site1.local’, ‘event’: u’sendmail’, ‘method_name’: u’sendmail’, ‘method’: <function sendmail at 0x7fdeadc0c848>, ‘user’: u’danny@mmcargoservices.co.za’, ‘kwargs’: {‘lang’: u’en’, ‘attachments’: [], ‘recipients’: [u’danny.kapasa@gmail.com’], ‘cc’: [u’danny@mmcargoservices.co.za’], ‘print_html’: u’‘, ‘session’: {u’data’: {u’session_expiry’: u’06:00:00’, u’session_country’: ‘ZA’, ‘csrf_token’: ‘a98b0b0941dcd9657b6b08dbcb3a453ea6aa8f737abfedf2af08493d’, u’last_updated’: ‘2017-10-11 10:43:50.206147’, u’lang’: u’en’, u’user_type’: None, ‘user’: u’danny@mmcargoservices.co.za’, u’full_name’: None, u’device’: u’desktop’, ‘session_ip’: u’196.31.187.154’}, u’user’: u’danny@mmcargoservices.co.za’, u’sid’: u’b6ddf5b2716bc1587dc777db188d8cf8b0164bf4db86c95be850e288’}, ‘communication_name’: ‘12b6705dc5’, ‘print_format’: u’Script MMCS Tax Invoice’}, ‘async’: True, ‘job_name’: u’<function sendmail at 0x7f96adb69a28>'}
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 71, in execute_job
method(**kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py”, line 426, in sendmail
recipients=recipients, cc=cc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/communication.py”, line 207, in _notify
_notify(self, print_html, print_format, attachments, recipients, cc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py”, line 141, in _notify
prepare_to_notify(doc, print_html, print_format, attachments)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py”, line 251, in prepare_to_notify
print_format=print_format, html=print_html))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1244, in attach_print
“fcontent”: get_print(doctype, name, print_format=print_format, style=style, html=html, as_pdf=True, doc=doc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1227, in get_print
return get_pdf(html, output = output)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/pdf.py”, line 17, in get_pdf
pdfkit.from_string(html, fname, options=options or {})
File “/home/frappe/frappe-bench/env/src/pdfkit/pdfkit/api.py”, line 68, in from_string
return r.to_pdf(output_path)
File “/home/frappe/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: ConnectionRefusedError

Is your scheduler enabled? Sending outgoing email error in version 8, need help - #7 by wahab