Scheduler and Email queue not working (woker online: 0)

Hello everyone,

I’m using ERPNext: v10.1.75 (master)
Frappe Framework: v10.1.67 (master)

Email account is set properly.
But Scheduler is not working , emails are not coming in the Email Queue.
“bech —site [sitename] enable-scheduler” have been set

Below is the Output of “bech doctor” :

-----Checking scheduler status-----
Workers online: 0
-----None Jobs-----
Queue: default
Number of Jobs: 3
frappe.utils.global_search.sync_global_search : 2
<function sendmail at 0x7fa628af6050> : 1

Queue: short
Number of Jobs: 6
Methods: : 1
frappe.twofactor.delete_all_barcodes_for_users : 1 : 1
frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment : 1 : 1
frappe.oauth.delete_oauth2_data : 1

mean while when i try to force run" bench worker" i get this error

frappe-bench# bench worker
Traceback (most recent call last):
File “/usr/lib/python2.7/”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/”, line 72, in _run_code
exec code in run_globals
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 94, in
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 18, in main
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 764, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 717, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/”, line 158, in start_worker
start_worker(queue, quiet = quiet)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 144, in start_worker
Worker(queues, name=get_worker_name(queue)).work(logging_level = logging_level)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/rq/”, line 466, in work
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/rq/”, line 273, in register_birth
if self.connection.exists(self.key) and
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/redis/”, line 951, in exists
return self.execute_command(‘EXISTS’, name)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/redis/”, line 673, in execute_command
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/redis/”, line 610, in send_command
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/redis/”, line 585, in send_packed_command
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/redis/”, line 489, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 11 connecting to localhost:11000. Resource temporarily unavailable.

i did run " bench restart" “supervisorctl restart all” seem all ok
no error log,

i thought its something wrong with redis localhost:11000 , i check its runing ok.

frappe-bench# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0* LISTEN 1504/redis-server 1
tcp 0 0* LISTEN 2094/mysqld
tcp 0 0* LISTEN 1915/redis-server 1
tcp 0 0* LISTEN 2096/sshd
tcp 0 0* LISTEN 2193/perl
tcp 0 0* LISTEN 2109/nginx -g daemo
tcp 0 0* LISTEN 1503/redis-server 1
tcp 0 0* LISTEN 2109/nginx -g daemo
tcp 0 0* LISTEN 1501/python
tcp 0 0* LISTEN 1510/redis-server 1
tcp6 0 0 :::9000 :::* LISTEN 1502/node
tcp6 0 0 :::5005 :::* LISTEN 2096/sshd
udp 0 0* 2193/perl

Can anyone help me in resolving this issue?

Perhaps the logs will give you some idea of the problem?

frappe@ubuntu:~/frappe-bench$ find logs -name ‘redis*’

Some other troubleshooting thoughts

change ‘log notice’ to ‘log debug’ in the redis config:
frappe@ubuntu:~/frappe-bench$ ls -al /etc/redis/redis.conf
-rw-r----- 1 redis redis 41623 Dec 19 2015 /etc/redis/redis.conf

inspect the logs for signs of the problem
frappe@ubuntu:~/frappe-bench$ sudo less /var/log/redis/redis-server.log.1
frappe@ubuntu:~/frappe-bench$ sudo less /var/log/syslog

Yes that’s happened with me too. Many times schedulers dont work.
So you can add contab for that job.
go to the crontab-e and add the crontab, you can set time accordingly.

I hope this will help you.*_