Bug 1109345

Summary: Assigning a host in deployment fails with "undefined method `fact_name' for nil:NilClass"
Product: Red Hat OpenStack Reporter: Lars Kellogg-Stedman <lars>
Component: rhel-osp-installerAssignee: Mike Burns <mburns>
Status: CLOSED ERRATA QA Contact: Omri Hochman <ohochman>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: Foreman (RHEL 6)CC: aberezin, dnavale, jslagle, mburns, rhos-maint, whayutin
Target Milestone: ga   
Target Release: 5.0 (RHEL 6)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ruby193-rubygem-staypuft-0.1.3.el6ost Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-04 18:34:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
/var/log/foreman/production.log none

Description Lars Kellogg-Stedman 2014-06-13 17:44:50 UTC
With ruby193-rubygem-staypuft-0.1.2-1.el6ost.noarch, trying to assign a host to a hostgroup in /deployments/1/ results in the following error:

NoMethodError
undefined method `fact_name' for nil:NilClass
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call' 

This error appears to come from somewhere around:

https://github.com/theforeman/staypuft/commit/432dd5ba937db0633a1989bfe63c80be64693400#diff-b9bc6c5f42018f6a91dbf5969d044a27R134

Downgrading to ruby193-rubygem-staypuft-0.1.1-1.el6ost corrects this problem.

I've attached /var/log/foreman/production.log to this bz.

Comment 1 Lars Kellogg-Stedman 2014-06-13 17:45:24 UTC
Created attachment 908673 [details]
/var/log/foreman/production.log

Comment 3 Lars Kellogg-Stedman 2014-06-13 18:18:54 UTC
This is happening because the value of discovery_bootif in the fact_values table looks like:

  52:54:00:0b:68:b0

The code in /opt/rh/ruby193/root/usr/share/gems/gems/staypuft-0.1.2/app/controllers/staypuft/deployments_controller.rb attempts to find a matching macaddress_* value, but the macaddress_* facts look like:

  52:54:00:0B:68:B0

Note the difference in capitalization.

Comment 4 Lars Kellogg-Stedman 2014-06-13 18:33:36 UTC
Fix proposed in https://github.com/theforeman/staypuft/pull/150

Comment 5 Omri Hochman 2014-06-16 22:01:42 UTC
Verified:
foreman-installer-staypuft-0.0.18-1.el6ost.noarch
ruby193-rubygem-staypuft-0.1.3-1.el6ost.noarch

Comment 8 errata-xmlrpc 2014-08-04 18:34:37 UTC
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, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2014-1003.html