Project

General

Profile

Actions

Bug #28563

closed

undefined method `split' for nil:NilClass when viewing the host info with hammer

Added by Tomer Brisker over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Inventory
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1736809

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/models/nic/base.rb:90:in `type_name'
/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:152:in `node'
/opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.13.1/lib/rabl/builder.rb:114:in `block in compile_settings'
/opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.13.1/lib/rabl/builder.rb:113:in `each'

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):

6.5

How reproducible:

Easy

Steps to Reproduce:
1. hack the db to update an interface's type to nil
2. use hammer to list host info

Actual results:

Hammer command doesn't work and same as the WebUI.

Expected results:

Both hammer and WebUI should work.

Additional info:

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..

Actions #1

Updated by The Foreman Bot over 4 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Tomer Brisker
  • Pull request https://github.com/theforeman/foreman/pull/7287 added
Actions #2

Updated by The Foreman Bot over 4 years ago

  • Fixed in Releases 2.0.0 added
Actions #3

Updated by Tomer Brisker over 4 years ago

  • Status changed from Ready For Testing to Closed
Actions #4

Updated by Tomer Brisker over 4 years ago

  • Fixed in Releases 1.24.1 added
Actions

Also available in: Atom PDF