Bug 1473909 - Mail notifications not being sent
Mail notifications not being sent
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Email (Show other bugs)
Unspecified Unspecified
medium Severity medium (vote)
: GA
: --
Assigned To: Marek Hulan
: Triaged
Depends On:
  Show dependency treegraph
Reported: 2017-07-22 05:53 EDT by Marek Hulan
Modified: 2017-08-15 16:24 EDT (History)
2 users (show)

See Also:
Fixed In Version: foreman-1.15.2
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 20017 None None None 2017-07-22 05:53 EDT

  None (edit)
Description Marek Hulan 2017-07-22 05:53:05 EDT
rake reports:daily task fails with following trace

rake aborted!
NoMethodError: undefined method `mail_enabled?' for nil:NilClass
/home/ares/Projekty/Zdrojaky/foreman/app/models/user_mail_notification.rb:10:in `deliver'
/home/ares/Projekty/Zdrojaky/foreman/lib/tasks/reports.rake:97:in `block in process_notifications'
/home/ares/Projekty/Zdrojaky/foreman/lib/tasks/reports.rake:96:in `process_notifications'
/home/ares/Projekty/Zdrojaky/foreman/lib/tasks/reports.rake:102:in `block (2 levels) in <top (required)>'
/home/ares/.rbenv/versions/2.2.2/bin/bundle:23:in `load'
/home/ares/.rbenv/versions/2.2.2/bin/bundle:23:in `<main>'
Tasks: TOP => reports:daily
(See full trace by running task with --trace)

it's obviously caused by taxonomies, the rake task is not running under admin user so mail notification user can not be found if the user is in any context. I think that's a candidate for 1.15.z since it's a regression caused by #16982
Comment 1 Marek Hulan 2017-07-22 05:53:09 EDT
Created from redmine issue http://projects.theforeman.org/issues/20017
Comment 2 Marek Hulan 2017-07-22 05:53:15 EDT
Upstream bug assigned to mhulan@redhat.com
Comment 5 Daniel Lobato Garcia 2017-08-02 07:17:24 EDT

Version tested:


Running foreman-rake reports:daily does not return any error anymore.

Note You need to log in before you can comment on or make changes to this bug.