Description of problem:
hammer -u admin -p redhat host info --name=example.com failed with below error found in the production.log
ActionView::Template::Error: undefined method `split' for nil:NilClass
/usr/share/foreman/app/views/api/v2/interfaces/main.json.rabl:9:in `block in eval_source'
/opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.13.1/lib/rabl/builder.rb:114:in `block in compile_settings'
This is due to one interface on the host is having nil type. However, this is working in 6.4 so it seems like a regression..
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. hack the db to update an interface's type to nil
2. use hammer to list host info
Hammer command doesn't work and same as the WebUI.
Both hammer and WebUI should work.
We have a KCS for this issue. However, I think satellite should be smart enough to use the default type for an interface with nil type..
Created redmine issue https://projects.theforeman.org/issues/28563 from this bug
Upstream bug assigned to email@example.com
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/28563 has been resolved.
Tried on sat 6.6 with foreman-188.8.131.52-2 and were able to successfully reproduce this bug.
Afterwards I did same process with sat 6.8 snap 5 with foreman-2.1.0-0.20 there is no error on hammer host info --name/--id <host name/id>.
The process steps:
0. (prerequisite) at least 1 host
1. in database, find the host you going to work with, change type of host interface to nil, (tip is to look at host interface before you do that, so you can change it backwards after you try it)
2. hammer host info on host used in step 1
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Important: Satellite 6.8 release), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.