Project

General

Profile

Bug #20017

Mail notifications not being sent

Added by Marek Hulán almost 6 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
E-Mail
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

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


Related issues

Related to Foreman - Bug #16982: CVE-2016-7078 - User with no organizations or locations can see all resourcesClosed2016-10-18
Related to Foreman - Tracker #10022: Taxonomies related issuesNew2015-04-05

Associated revisions

Revision cd68b208 (diff)
Added by Marek Hulán almost 6 years ago

Fixes #20017 - mail notifications work for global admins

Revision 00b0fa8b (diff)
Added by Marek Hulán over 5 years ago

Fixes #20017 - mail notifications work for global admins

(cherry picked from commit cd68b2083022f7c50f45b73f64c3b991613448dd)

History

#1 Updated by Marek Hulán almost 6 years ago

  • Related to Bug #16982: CVE-2016-7078 - User with no organizations or locations can see all resources added

#2 Updated by Marek Hulán almost 6 years ago

#3 Updated by The Foreman Bot almost 6 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Marek Hulán
  • Pull request https://github.com/theforeman/foreman/pull/4589 added

#4 Updated by Marek Hulán almost 6 years ago

  • Legacy Backlogs Release (now unused) set to 266

I propose this for 1.15.2, there's no github label yet so just setting here for now.

#5 Updated by Marek Hulán almost 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#6 Updated by Marek Hulán over 5 years ago

  • Bugzilla link set to 1473909

Also available in: Atom PDF