Content
You are here:
Email Notification Not going when updating workpackage
Added by Ashutosh Sharma over 9 years ago
I am facing an issue, where email notifications are not going when a work package is update. I have checked the user settings has been set to receive all the notification. I get notification for creation of a new work package, but if I update a work package then I am not receiving any notification. Adding myself to watcher list also doesn’t help. Please help me out here.
OP Version: 4.0.8
Let me know if you need any more details here.
Replies (8)
Hi Ashutosh,
sorry for the late reply.
Emails for work package updates are send out asynchronously via delayed_job. This is probably not configured / activated.
Do you use the packager installation or the manual installation?
Please have a look at the following thread which addresses this problem:
https://community.openproject.org/topics/4134?board_id=9&r=4186#message-4186
Best,
Robin
Hi Robin,
I have manual installation. I have gone through the link you mentioned. I started the delayed job, but still the notifications are not working. Here the output of the commands
I waited for more than an hour, but still no email notification.
Interesting point it I get email only for new task and not for updates. As I mentioned earlier I has set to receive all notifications. But still the issue.
Also are there any specific configuration that needs to be done for delayed job, Please let me know what are those or where I can find it.
Let me know if you need any more details. Due to this issue, we have to email the team member if any updates are done, causing unnecessary delays.
Thanks,
Ashutosh
Hi Ashutosh,
could you please run
RAILS_ENV=production bundle exec script/delayed_job run --exit-on-complete
and tell me the output?Thanks,
Jonas
Hi Jonas,
I was able to figure out the issue. The issue was that there were 35k+ entries in the delayed_job table in the database. After clearing it, I am able to get the notification for all the updates. So I guess, following can be added as troubleshooting steps:
# Check for the setup in the Configuration.yml
# Check for the delayed_job status
. If there is no entry for “delayed_job” then start it by running
# Check the result of
You can add details to the troubleshooting steps above.
Thanks a lot.
Thanks,
Ashutosh
That didn’t helped. After sometime the emails stopped going. And When I saw the delayed_jobs table it had 176 tasks and the error text for them was
Even I have “Allow Less secure app” setting allowed on gmail account.
Please let me know if something is wrong in the settings. I am pasting the Configuration.yml details
Thanks,
Ashutosh
On further investigation and looking for the specific error, it seems that Gmail is blocking the request if multiple login requests are being made in small interval of time. All our OP user had the settings to receive for the changes they have done. Due to which it was generating huge email jobs in delayed_jobs table. After turning on the setting “Do not send notification for which I do changes”, the number of emails generated is reduced and notifications are getting flowed now. We have not seen the issue today. But will still monitor it for a day or so. But this is not permanent solution because if large number of user updates the different work packages and each is having watcher then it will stuck again.
From all this what I can guess is for each email to be send OP is opening a new connection to Gmail, authenticating and then sending email. So if a huge number of emails needs to be sent, then OP will do the same process again and again. This can be one of the reason why Gmail is blocking the requests considering a DOS Attack. A better approach would be to open the connection with SMTP server once and then sends all the emails. A further optimization can be to keep the channel open for configurable amount of time before creating a new connection to reduce the resource usage.
Hi Ashutosh,
I think you’re right about the false handling of emails within OpenProject. But the most I can do now is to create ticket: #19443.
Everythings else worked for you?
Best,
Jonas
Hi Jonas,
Everything else is working fine.
I just checked the ticket created, if I am correct, the ticket is about having a setting to define the frequency of the delayed_jobs?
In case it was different, let me put it again:
OP should run the delayed_jobs at set time interval, check for the task in delayed_jobs table. Open the connection with SMTP server, authenticate, send all the emails from the delayed_jobs table and in the end close the SMTP server connection. Follow the same process for next run.
Thanks,
Ashutosh