Email is not coming

Hi,
I have set email domain and email account and submit salary slip.
But employee did not get salary slip email.
Email log is

06:16:40 worker_default.1 | 06:16:40 default: frappe.utils.background_jobs.execute_job(async=True, event=None, job_name=u’frappe.utils.global_search.update_global_search’, kwargs={‘doc’: <frappe.email.doctype.email_queue.email_queue.EmailQueue object at 0x7ff6facadb10>}, method=u’frappe.utils.global_search.update_global_search’, site=‘site1.local’, user=u’Administrator’) (990c65a9-b143-4522-a64e-421a81a8a83d)
06:16:40 worker_default.1 | 06:16:40 default: Job OK (990c65a9-b143-4522-a64e-421a81a8a83d)

06:16:40 worker_default.1 | 06:16:40 default: frappe.utils.background_jobs.execute_job(async=True, event=None, job_name=u’frappe.utils.global_search.update_global_search’, kwargs={‘doc’: frappe.email.doctype.email_queue.email_queue.EmailQueue object at 0x7ff6facadb10>}, method=u’frappe.utils.global_search.update_global_search’, site=‘site1.local’, user=u’Administrator’) (990c65a9-b143-4522-a64e-421a81a8a83d)
06:16:40 worker_default.1 | 06:16:40 default: Job OK (990c65a9-b143-4522-a64e-421a81a8a83d)
06:16:40 worker_default.1 | 06:16:40 Result is kept for 500 seconds
06:16:40 worker_default.1 | 06:16:40

Hi @arif

If you are doing with Process Payroll,then checked this option ““Email Salary Slip to Employee”” which is in HR setting.

@arif

I see you ask many questions on this forum. Maybe try helping some other users with their questions as well. Profile - arif - Frappe Forum

Hi @shraddha,
Already have checked and I have shared console log.
There you can see that email queue but email is not coming

@arif,

Please check the Email Queue List you will find the list of mail sent from the system, check its status if status is Not Sent then maybe your site scheduler is disabled you can enable the scheduler using following command

bench --site your_sitename enable-scheduler

Thanks

Hi @makarand_b,

I have put this command bench --site your_sitename enable-scheduler.
After this command showing Enabled for site1.local.
But I see that not sent status at email queue.
After sent from email queue, email is going.
How can be automatic?

0:40:32 worker_short.1 | 10:40:32 AttributeError: ‘NoneType’ object has no attribute ‘get_messages’
10:40:32 worker_short.1 | Traceback (most recent call last):
10:40:32 worker_short.1 | File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/rq/worker.py”, line 700, in perform_job
10:40:32 worker_short.1 | rv = job.perform()
10:40:32 worker_short.1 | File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/rq/job.py”, line 500, in perform
10:40:32 worker_short.1 | self._result = self.func(*self.args, **self.kwargs)
10:40:32 worker_short.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 65, in execute_job
10:40:32 worker_short.1 | method(**kwargs)
10:40:32 worker_short.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 698, in pull_from_email_account
10:40:32 worker_short.1 | email_account.receive()
10:40:32 worker_short.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 257, in receive
10:40:32 worker_short.1 | emails = email_server.get_messages()
10:40:32 worker_short.1 | AttributeError: ‘NoneType’ object has no attribute ‘get_messages’
10:40:32 worker_short.1 | Traceback (most recent call last):
10:40:32 worker_short.1 | File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/rq/worker.py”, line 700, in perform_job
10:40:32 worker_short.1 | rv = job.perform()
10:40:32 worker_short.1 | File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/rq/job.py”, line 500, in perform
10:40:32 worker_short.1 | self._result = self.func(*self.args, **self.kwargs)
10:40:32 worker_short.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 65, in execute_job
10:40:32 worker_short.1 | method(**kwargs)
10:40:32 worker_short.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 698, in pull_from_email_account
10:40:32 worker_short.1 | email_account.receive()
10:40:32 worker_short.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 257, in receive
10:40:32 worker_short.1 | emails = email_server.get_messages()
10:40:32 worker_short.1 | AttributeError: ‘NoneType’ object has no attribute ‘get_messages’
10:40:32 worker_short.1 | 10:40:32 Moving job to u’failed’ queue
10:40:32 worker_short.1 | 10:40:32

The code there changed 5 days ago

Maybe run ‘bench update’ ?

https://github.com/frappe/frappe/commit/04331023a2b302998c86ae98c18a5d8f3c1e22ea

Hi, @makarand_b, @clarkej,
bench --site your_sitename enable-scheduler this command is working from which version?
I see that leave email application email is stored at email queue and if we submit email from email queue then email is working.

But I need to automatic email

the enable-scheduler command is working for both v7.0 & v8.0 and even for the old version.

please check background job page for any failed email queue job, either the site scheduler is not enabled or there may be some error while running the scheduler

@makarand_b

06:02:37 worker_short.1 | Traceback (most recent call last):
06:02:37 worker_short.1 | File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/rq/worker.py”, line 700, in perform_job
06:02:37 worker_short.1 | rv = job.perform()
06:02:37 worker_short.1 | File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/rq/job.py”, line 500, in perform
06:02:37 worker_short.1 | self._result = self.func(*self.args, **self.kwargs)
06:02:37 worker_short.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 60, in execute_job
06:02:37 worker_short.1 | method = frappe.get_attr(method)
06:02:37 worker_short.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 887, in get_attr
06:02:37 worker_short.1 | return getattr(get_module(modulename), methodname)
06:02:37 worker_short.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 672, in get_module
06:02:37 worker_short.1 | return importlib.import_module(modulename)
06:02:37 worker_short.1 | File “/usr/lib/python2.7/importlib/init.py”, line 37, in import_module
06:02:37 worker_short.1 | import(name)
06:02:37 worker_short.1 | ImportError: No module named list_settings
06:02:37 worker_short.1 | Traceback (most recent call last):
06:02:37 worker_short.1 | File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/rq/worker.py”, line 700, in perform_job
06:02:37 worker_short.1 | rv = job.perform()
06:02:37 worker_short.1 | File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/rq/job.py”, line 500, in perform
06:02:37 worker_short.1 | self._result = self.func(*self.args, **self.kwargs)
06:02:37 worker_short.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 60, in execute_job
06:02:37 worker_short.1 | method = frappe.get_attr(method)
06:02:37 worker_short.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 887, in get_attr
06:02:37 worker_short.1 | return getattr(get_module(modulename), methodname)
06:02:37 worker_short.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 672, in get_module
06:02:37 worker_short.1 | return importlib.import_module(modulename)
06:02:37 worker_short.1 | File “/usr/lib/python2.7/importlib/init.py”, line 37, in import_module
06:02:37 worker_short.1 | import(name)
06:02:37 worker_short.1 | ImportError: No module named list_settings
06:02:37 worker_short.1 | 06:02:37 Moving job to u’failed’ queue

What do you mean by automatic!?

If the code does not work for you I suggest you browse it -

frappe@erpnext:~/frappe-bench$ find . -name *.py | xargs grep list_settings

06:02:37 worker_short.1 | 06:02:37 Moving job to u’failed’ queue

i also got the same error but in my case email are also not in email queue even the scheduler is enabled

hey i sort it by enabling variable to true in /frappe-bench/apps/frappe/frappe/core/notifications.py
set as_list=True to get mails in queue

def get_things_todo(as_list=True):

1 Like