Hi community,
I’m facing an issue with the email queue in my ERPNext setup using Docker. Here are the details:
Environment:
ERPNext Version: v15.52.0
Frappe Version: v15.56.0
Deployment: Docker (using frappe_docker
)
Scheduler Status: Enabled (checked with bench doctor
)
Email Account: Gmail SMTP (configured and tested, works when flushed manually)
Issue:
Emails are being queued correctly in Email Queue (status = “Not Sent”), but they are not being sent automatically .
However, when I run the following command manually inside the container, the emails are sent successfully:
bench --site [my-site-name] execute frappe.email.queue.flush
So the queue system works, but the background job that should flush the queue doesn’t seem to be triggered automatically.
Why isn’t the “Email Queue” being processed automatically, even though:
Scheduler is running
Emails are queued correctly
Manual flush works fine
Verified that the scheduler is enabled and running using bench doctor
Is there anything I’m missing in Docker-based setups to ensure background jobs (like email flush) are triggered?
Thanks in advance for your help!
This is due to long and short queue containers might not be running.
You can start them it will work to send automatically
In docker-compose file which is pwd.yml which is used in frappe-docker repo it needs a small correction as below. depends on need to be set for queue-long and queue-short as these are starting before the redis-queue started and could not able to connect to it.
queue-long:
# ... other configurations ...
**depends_on:**
** - redis-queue**
queue-short:
# ... other configurations ...
**depends_on:**
** - redis-queue**
Let me see if I can raise a PR for it.
Sudh33r:
redis-queue
In my case both containers are running.
Did you find a solution for this?
Yes, you can follow the steps below:
Access the Redis queue container (replace the container name accordingly):
docker exec -it erp-redis-queue sh
Inside the container, open the Redis console:
redis-cli
Run the following command to clear all queues:
FLUSHALL
Exit the Redis CLI and container.
Next:
Access your backend container (replace the container name):
docker exec -it erp-backend-1 bash
Disable the scheduler for your site:
bench --site SITENAME scheduler disable
Then re-enable it:
bench --site SITENAME scheduler enable
Finally, restart the server .
Note: This will clear all old queued tasks that are still pending in your Redis queue.