Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

General discussion
  1. OpenProject
  2. Forums
  3. General discussion
  4. Issue with getting Email notifications

Issue with getting Email notifications

Added by Vadim TexNetwork almost 9 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)

RE: Issue with getting Email notifications - Added by Oliver Günther almost 9 years ago

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

  • make sure that you run it according to the documentation.
  • Open a console with RAILS_ENV=production bundle exec rails console and check the output of Delayed::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

  • assert that ps ax | grep jobs contains /opt/openproject/vendor/bundle/ruby/2.1.0/bin/rake jobs:work.
  • Open a console with openproject run console and check the output of Delayed::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

RE: Issue with getting Email notifications - Added by Vadim TexNetwork almost 9 years ago

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.

RE: Issue with getting Email notifications - Added by Vadim TexNetwork almost 9 years ago

Vadim TexNetwork wrote:

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.

Additional info, I’ve installed and configured manually from source code.

RE: Issue with getting Email notifications - Added by Oliver Günther almost 9 years ago

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

RE: Issue with getting Email notifications - Added by Vadim TexNetwork almost 9 years ago

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 ?

RE: Issue with getting Email notifications - Added by Oliver Günther almost 9 years ago

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

RE: Issue with getting Email notifications - Added by Vadim TexNetwork almost 9 years ago

Dear Oliver,

The issue has been solved and can be closed.
Everything works correctly.

Thanks again for the prompt and professional help !

  • (1 - 7/7)
Loading...