Project

General

Profile

Actions

Bug #16014

open

Improve error message when media is not set properly

Added by Lukas Zapletal over 8 years ago. Updated 4 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Content Views
Target version:
-
Difficulty:
trivial
Triaged:
Fixed in Releases:
Found in Releases:

Description

When media is not set or not available via taxonomy, we generate error trace:

2016-08-05 12:28:16 [app] [W] Fetch TFTP boot files for mac52540028624f.lab.eng.rdu2.redhat.com task failed with the following error: undefined method `path' for nil:NilClass
 | NoMethodError: undefined method `path' for nil:NilClass
 | /usr/share/foreman/app/models/operatingsystem.rb:121:in `medium_uri'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.69/app/models/katello/concerns/redhat_extensions.rb:52:in `medium_uri_with_content_uri'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.69/app/models/katello/concerns/redhat_extensions.rb:86:in `block in boot_files_uri_with_content'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.69/app/models/katello/concerns/redhat_extensions.rb:85:in `collect'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.69/app/models/katello/concerns/redhat_extensions.rb:85:in `boot_files_uri_with_content'
 | /usr/share/foreman/app/models/operatingsystem.rb:183:in `pxe_files'
 | /usr/share/foreman/app/models/concerns/orchestration/tftp.rb:78:in `setTFTPBootFiles'
 | /usr/share/foreman/app/models/concerns/orchestration.rb:162:in `execute'
 | /usr/share/foreman/app/models/concerns/orchestration.rb:107:in `block in process'
 | /usr/share/foreman/app/models/concerns/orchestration.rb:99:in `each'
 | /usr/share/foreman/app/models/concerns/orchestration.rb:99:in `process'
 | /usr/share/foreman/app/models/concerns/orchestration.rb:35:in `on_save'

We should catch for exceptions in the orchestration code and issue error.


Related issues 1 (0 open1 closed)

Related to Foreman - Feature #15439: Improve invalid medium errorClosedLukas Zapletal06/16/2016Actions
Actions

Also available in: Atom PDF