Bug 1432184

Summary: Task <uuid>: NoMethodError: undefined method `first' for nil:NilClass
Product: Red Hat Satellite Reporter: Thom Carlin <tcarlin>
Component: HostsAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: high Docs Contact:
Priority: high    
Version: 6.2.8CC: akofink, asahni, bbuckingham, bkearney, brcoca, cdonnell, chrobert, daniele, dezw, egolov, hmore, h.teunis, jcallaha, johan.bergstrom, jwildman, lpramuk, lzap, mdekan, mgazdik, mmithaiw, msomasun, mtenheuv, mverma, nitthoma, nshaik, rdixon, rvdwees, sokeeffe, tbrisker, tpapaioa, xdmoon
Target Milestone: UnspecifiedKeywords: PrioBumpGSS, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-1.11.0.74-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1435325 (view as bug list) Environment:
Last Closed: 2017-05-01 14:01:02 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
hotfix none

Description Thom Carlin 2017-03-14 17:57:34 UTC
Description of problem:

During subscription-manager register to Sat 6, receive "Task e938b359-b22d-4ce5-8133-b98026895061: NoMethodError: undefined method `first' for nil:NilClass"

Version-Release number of selected component (if applicable):

6.2.8

How reproducible:

about 50% on the host (may receive lock error)

Steps to Reproduce:
1. Setup system as Sat 6 client
2. subscription-manager register

Actual results:

Task e938b359-b22d-4ce5-8133-b98026895061: NoMethodError: undefined method `first' for nil:NilClass

Expected results:

Successfully registered system

Additional info:

Seems to be http://projects.theforeman.org/issues/16547
foreman-debug to follow in private attchment

Comment 2 Satellite Program 2017-03-14 18:18:35 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16547 has been resolved.

Comment 3 Craig Donnelly 2017-03-14 18:22:13 UTC
People hitting this issue appear to also be getting the following, after patching over with the changes made in 16547:


Error: Runtime Error RESTEASY001185: Could not find resource for relative : /consumers//entitlements of full path: https://localhost:8443/candlepin/consumers//entitlements at org.jboss.resteasy.core.registry.PathParamSegment.matchPattern:209

Comment 7 Brad Buckingham 2017-03-17 15:19:03 UTC
*** Bug 1432181 has been marked as a duplicate of this bug. ***

Comment 8 Johan Bergström 2017-03-22 15:36:42 UTC
Hello.

I have patched my system with the commit from foreman issue tracker # 16547 only the first change in app/models/host/base.rb and it has resolved this issue for me.

I realize I will have to manually patch my satellite again if I go to 6.2.9 since it's scheduled for 6.2.10 release.

I think it's quite critical since it's preventing new systems from being bootstrapped into the satellite, I would re-schedule it to 6.2.9

Comment 12 Sean O'Keeffe 2017-03-23 14:50:52 UTC
*** Bug 1434829 has been marked as a duplicate of this bug. ***

Comment 13 Chris Roberts 2017-03-24 16:04:45 UTC
Created attachment 1266186 [details]
hotfix

Hotfix patch tarball

Usage (tarball extraction):

  tar -xzf satellite-hotfix-1432184.tar.gz
  cd satellite-hotfix-1432184

Usage (dry run):

  ./satellite-hotfix -n 1432184

Usage:

  ./satellite-hotfix 1432184

Revert a hotfix:

  ./satellite-hotfix -r 1432184

List all avaiable hotfixes:

  ./satellite-hotfix

The numbers are real Red Hat Bugzilla numbers. All backup and reject files are
save in backups/ sub-directory. Please keep the tarball for possible reverting
of the change in the future. If patching fails, revert immediately and report
the output. After each Satellite update, this hotfix process must be repeated
if the updated does not include the bugfix yet, search in errata notes for
bugzilla numbers to confirm.

If system-wide Ruby is not installed for some reason, use Satellite Foreman
Ruby software collection:

  scl enable rh-ruby22 -- ./satellite-hotfix -h

To find out Ruby versions available do:

  ls /opt/*/*ruby* -d

Comment 15 Lukas Pramuk 2017-04-03 14:03:18 UTC
VERIFIED.

@satellite-6.2.9-2.0.el7sat.noarch
foreman-1.11.0.75-1.el7sat.noarch

by following manual reproducer:

1. With Sat6.2.8 provision a VM, install and start docker in it (docker has to be running in a VM)
# ip address show docker0
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN 
    link/ether 02:42:6f:94:5a:83 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 scope global docker0
       valid_lft forever preferred_lft forever

2. Install CA certs and try to register the VM
# subscription-manager register --org="Default_Organization" --name="vm1.example.com" --activationkey="AK" --force 
The system with UUID 834faa02-bbe9-425f-884d-8dee8c68d9af has been unregistered
Task 752a773e-6d7e-45d6-8be6-59d22b556fdf: NoMethodError: undefined method `first' for nil:NilClass

>>> reproduced 

3. Upgrade 6.2.8 > 6.2.9

4. Register the VM
# subscription-manager register --org="Default_Organization" --name="vm1.example.com" --activationkey="AK" --force 
The system has been registered with ID: 35f937c3-e4f2-4ca3-9281-2bee9e4bb87c 

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

>>> specific host (VM hosting docker) now registers successfully

Comment 19 errata-xmlrpc 2017-05-01 14:01:02 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.

https://access.redhat.com/errata/RHBA-2017:1191