ERPNext Version 7 Email Scheduler Error - Celery or Redis Queue

Hi,

I have upgraded our system to Version 7.
Now I can able to send some of the email like password change and user creation.
But Email function for any document is not working.
As per my knowledge Celery is replaced with Redis Queue.
But still error log showing scheduler error related to Celery.
I got below error on the console.

Some of the email even not showing into Email Queue also.
I can able to send Queued email from Email Queue manually.

19:00:09 workerbeat.1     | [2016-07-18 19:00:09,057: INFO/MainProcess] Scheduler: Sending due task sync_queues (frappe.tasks.sync_queues)
19:00:09 workerbeat.1     | [2016-07-18 19:00:09,061: INFO/MainProcess] Scheduler: Sending due task scheduler (frappe.tasks.enqueue_scheduler_events)
19:00:09 async_worker.1   | [2016-07-18 19:00:09,062: ERROR/MainProcess] Received unregistered task of type u'frappe.tasks.sync_queues'.
19:00:09 async_worker.1   | The message has been ignored and discarded.
19:00:09 async_worker.1   | 
19:00:09 async_worker.1   | Did you remember to import the module containing this task?
19:00:09 async_worker.1   | Or maybe you are using relative imports?
19:00:09 async_worker.1   | Please see http://bit.ly/gLye1c for more information.
19:00:09 async_worker.1   | 
19:00:09 async_worker.1   | The full contents of the message body was:
19:00:09 async_worker.1   | {u'utc': True, u'chord': None, u'args': [], u'retries': 0, u'expires': None, u'task': u'frappe.tasks.sync_queues', u'callbacks': None, u'errbacks': None, u'timelimit': [None, None], u'taskset': None, u'kwargs': {}, u'eta': None, u'id': u'f0c0571b-6472-4144-876d-3cfbec327155'} (261b)
19:00:09 async_worker.1   | Traceback (most recent call last):
19:00:09 async_worker.1   |   File "/home/brillare/frappe-bench/env/local/lib/python2.7/site-packages/celery/worker/consumer.py", line 456, in on_task_received
19:00:09 async_worker.1   |     strategies[name](message, body,
19:00:09 async_worker.1   | KeyError: u'frappe.tasks.sync_queues'
19:00:09 longjob_worker.1 | [2016-07-18 19:00:09,065: ERROR/MainProcess] Received unregistered task of type u'frappe.tasks.enqueue_scheduler_events'.
19:00:09 longjob_worker.1 | The message has been ignored and discarded.
19:00:09 longjob_worker.1 | 
19:00:09 longjob_worker.1 | Did you remember to import the module containing this task?
19:00:09 longjob_worker.1 | Or maybe you are using relative imports?
19:00:09 longjob_worker.1 | Please see http://bit.ly/gLye1c for more information.
19:00:09 longjob_worker.1 | 
19:00:09 longjob_worker.1 | The full contents of the message body was:
19:00:09 longjob_worker.1 | {u'utc': True, u'chord': None, u'args': [], u'retries': 0, u'expires': None, u'task': u'frappe.tasks.enqueue_scheduler_events', u'callbacks': None, u'errbacks': None, u'timelimit': [None, None], u'taskset': None, u'kwargs': {}, u'eta': None, u'id': u'bfbc3f25-17cf-4b59-b737-9240770916fe'} (274b)
19:00:09 longjob_worker.1 | Traceback (most recent call last):
19:00:09 longjob_worker.1 |   File "/home/brillare/frappe-bench/env/local/lib/python2.7/site-packages/celery/worker/consumer.py", line 456, in on_task_received
19:00:09 longjob_worker.1 |     strategies[name](message, body,
19:00:09 longjob_worker.1 | KeyError: u'frappe.tasks.enqueue_scheduler_events'

@sweetdharmik

Please check the Procfile in your bench, which must still have entries for the celery workers.

You can try running bench setup procfile, which will generate a new set of instructions for the bench to pickup RQ instead of Celery.

@shreyasp

I executed setup procfile. But procfile configuration does not change.
Here is my procfile content.

redis_cache: redis-server config/redis_cache.conf
redis_socketio: redis-server config/redis_socketio.conf
redis_queue: redis-server config/redis_queue.conf
web: bench serve --port 8000
socketio: /usr/bin/node apps/frappe/socketio.js
watch: bench watch
workerbeat: sh -c ‘cd sites && exec …/env/bin/python -m frappe.celery_app beat -s scheduler.schedule’
worker: sh -c ‘cd sites && exec …/env/bin/python -m frappe.celery_app worker -n jobs@%h -Ofair --soft-time-limit 360 --time-limit 390’
longjob_worker: sh -c ‘cd sites && exec …/env/bin/python -m frappe.celery_app worker -n longjobs@%h -Ofair --soft-time-limit 1500 --time-limit 1530’
async_worker: sh -c ‘cd sites && exec …/env/bin/python -m frappe.celery_app worker -n async@%h -Ofair --soft-time-limit 1500 --time-limit 1530’

Is it correct or Celery configuration should not be there in the file?

hello @rmehta i need your help
i try to sent email quotations to customer but have an error like this
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py”, line 387, in sendmail
recipients=recipients, cc=cc)
File “/home/frappe/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/frappe/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/frappe/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/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1171, 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 1154, in get_print
return get_pdf(html)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/pdf.py”, line 16, in get_pdf
pdfkit.from_string(html, fname, options=options or {})
File “/home/frappe/frappe-bench/env/src/pdfkit/pdfkit/api.py”, line 66, in from_string
configuration=configuration)
File “/home/frappe/frappe-bench/env/src/pdfkit/pdfkit/pdfkit.py”, line 38, in init
self.configuration = (Configuration() if configuration is None
File “/home/frappe/frappe-bench/env/src/pdfkit/pdfkit/configuration.py”, line 27, in init
https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf’ % self.wkhtmltopdf)
IOError: No wkhtmltopdf executable found: “”
If this file exists please check that this process can read it. Otherwise please install wkhtmltopdf - https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf
Plz help what can i do in this case?

Event i try to setup yandex mailservice or gmail it the same error
plz help @rmehta

Anybody help plz

Any help plz

Hi, @W360S_Corp.
Please check the forum rules before posting. Regarding your question — it already contains the answer to itself, you just have to read it carefully.