Project

General

Profile

Bug #9118

Failed to send email notification puppet_error_state: undefined method `recipients_for' for nil:NilClass

Added by cristian falcas almost 5 years ago. Updated over 1 year ago.

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

Description

We've configured foreman to send emails on failed puppet runs. The configuration is this:

  1. Outgoing email settings

production:
delivery_method: :smtp
smtp_settings:
address: smtp.domain.net
port: 25
domain: domain.net
authentication: :none
tls: false
enable_starttls_auto: false

In foreman logs we noticed this error:

Failed to send email notification puppet_error_state: undefined method `recipients_for' for nil:NilClass


Related issues

Related to Foreman - Tracker #7585: Mail notifications trackerNew

Associated revisions

Revision 69943393 (diff)
Added by Tom Caspy almost 5 years ago

fixes #9118 - host mailer should not fail if no owner set for host

Revision ba5c3cff (diff)
Added by Tom Caspy almost 5 years ago

fixes #9118 - host mailer should not fail if no owner set for host

(cherry picked from commit 699433930fe80c905b757ae951a5aaa1952f0e9f)

Conflicts:
test/unit/host_mailer_test.rb

History

#1 Updated by Dominic Cleal almost 5 years ago

#2 Updated by Dominic Cleal almost 5 years ago

  • Category set to E-Mail

It appears that app/mailers/host_mailer.rb doesn't handle host.owner being nil and calls recipients_for on it anyway, it assumes the host has an owner.

#3 Updated by The Foreman Bot almost 5 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2127 added
  • Pull request deleted ()

#4 Updated by Tom Caspy almost 5 years ago

  • Assignee set to Tom Caspy

#5 Updated by Tom Caspy almost 5 years ago

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

#6 Updated by Dominic Cleal almost 5 years ago

  • Legacy Backlogs Release (now unused) set to 32

Also available in: Atom PDF