Content
You are here:
Issue with getting Email notifications
Added by Vadim TexNetwork about 8 years ago
Dear Community,
I have recently installed and successfully configured Open Project Core 5.0.19
Everything work fine, but I facing troubles with getting email notifications.
Email settings have been correctly configured, test email from System settings——-> Email notification works fine.
But, I haven’t got any notification during exploitation.
I ’ve been trying to register a new user, its showing that invitation has been sent,
but actually nothing came.
I have examined production.log, but was not able to find any tracks of sent emails. So, only test email works.
Please advise and assist, how can I fix this issue. I’ve spent all the day almost and tried everything.
Thanks
Replies (7)
Hi Vadim,
how are you running the server? Do you use the packaged installation?
It sounds like the
delayed_job
worker is not running.In a manual installation
RAILS_ENV=production bundle exec rails console
and check the output ofDelayed::Job.count
. It should be zero or some small value depending on what changes you made to work packages in the last minutes, since notifications are aggregated and sent 5minutes later (by default).In a packaged installation
ps ax | grep jobs
contains/opt/openproject/vendor/bundle/ruby/2.1.0/bin/rake jobs:work
.openproject run console
and check the output ofDelayed::Job.count
. It should be zero or some small value depending on what changes you made to work packages in the last minutes, since notifications are aggregated and sent 5minutes later (by default).Best,
Oliver
Hello Oliver
Thank for reply. It seems delayed_job doesn’t really work.
I have executed commands as you advise and here is result. The output of Delayed::Job.count showing more than 40 jobs…
As I guess they haven’t been ever executed… So, I’ve tried to configure Delayed_jobs through CRON as described in Installation guide,
but there are some issues
1. According the installation manual, into the crontab should be added the following string
****/1 * * * * cd /home/openproject/openproject-ce; /home/openproject/.rvm/gems/ruby-2.1.5/wrappers/rake jobs:workoff*
but there is no folder /rvm in /home/openproject directory, however when I do manually rake jobs:workoff and getting
[Worker(host:h2574187.stratoserver.net pid:26807)] Starting job worker [Worker(host:h2574187.stratoserver.net pid:26807)] No more jobs available. Exiting
if trying rake jobs:work its showing
@
/home/openproject/openproject-ce/lib/open_project/configuration.rb:36: warning: already initialized constant OpenProject::Configuration::ENV_PREFIX
/home/openproject/openproject-ce/lib/open_project/configuration.rb:36: warning: previous definition of ENV_PREFIX was here
@
However, if i execute Delayed::Job.count it show that there are delayed_jobs still exist….
Can you please advise the correct syntax how to run the Delayed_job ?
Thanks.
Vadim TexNetwork wrote:
Additional info, I’ve installed and configured manually from source code.
The output of
rake jobs:work
looks fine, however runs as an active process (waiting for jobs) rather than working off the jobs and exiting (as desired in a cron job).Can you ensure that delayed_job uses the correct environment by trying
RAILS_ENV=production bundle exec rake jobs:workoff
and see what happens?On a side note: Unless you’re on an unsupported distro, why aren’t you using the packaged installation?
Best,
Oliver
After executing RAILS_ENV=production bundle exec rake jobs:workoff all delayed have been executed successfully and all notification emails came as expected.
It works! Thank you.
Probably the issue was, just a command rake jobs:workoff executes jobs related to openproject_development database,
when specifying PRODUCTION environment it works fine.
Soo how can I change environment to production permanently and how to setup crontab?
Can i just put RAILS_ENV=production bundle exec rake jobs:workoff to crontab? would be it enough ?
Hey Vadim,
you’re correct exactly. It appears that your Delayed::Job worker was running off the wrong (dev mode) database, which correctly caused it to see no pending jobs.
Appending the environment variable to the cron job is sufficient to switch the mode.
Best,
Oliver
Dear Oliver,
The issue has been solved and can be closed.
Everything works correctly.
Thanks again for the prompt and professional help !