Bug 1420626

Summary: Content host registration with satellite raises error: Couldn't find Katello::System without an ID
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: UpgradesAssignee: Justin Sherrill <jsherril>
Status: CLOSED ERRATA QA Contact: Sachin Ghai <sghai>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.7CC: bkearney, ehelms, inecas, jsherril, mbacovsk, rplevka, zhunting
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-3.0.0.102-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-06 08:37:50 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:
Bug Depends On:    
Bug Blocks: 1410795    
Attachments:
Description Flags
generated logs on registering content-host
none
foreman-debug none

Description Sachin Ghai 2017-02-09 06:20:46 UTC
Description of problem: Upgraded satellite from sat6.1.11 -> sat6.2.8 and later registered a content host w/ satellite and it got failed w/ error:

 ~]# subscription-manager register --org="Default_Organization" --activationkey=rhel7_capsule_ak --force
Task 6276055d-fd95-4af7-80c1-cf7429aac471: ActiveRecord::RecordNotFound: Couldn't find Katello::System without an ID

--

==> /var/log/foreman/production.log <==
2017-02-09 01:03:36 [foreman-tasks/action] [E] Couldn't find Katello::System without an ID (ActiveRecord::RecordNotFound)
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/relation/finder_methods.rb:402:in `find_with_ids'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/relation/finder_methods.rb:68:in `find'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/querying.rb:3:in `find'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.101/app/lib/actions/katello/host/register.rb:70:in `finalize'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.3/lib/dynflow/action.rb:528:in `block (2 levels) in execute_finalize'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.3/lib/dynflow/middleware/stack.rb:26:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.3/lib/dynflow/middleware/stack.rb:26:in `pass'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.3/lib/dynflow/middleware.rb:17:in `pass'

--

Version-Release number of selected component (if applicable):
upgrade sat6.1.11 -> sat6.2.8

How reproducible:
always

Steps to Reproduce:
1. register a content-host w/ upgraded satellite
2.
3.

Actual results:
content-host registration failed 

Expected results:
registration should work.

Additional info:
this issue appears w/ both satellite on rhel6 and rhel7.

Comment 2 Sachin Ghai 2017-02-09 06:30:23 UTC
Created attachment 1248742 [details]
generated logs on registering content-host

Comment 3 Sachin Ghai 2017-02-09 06:38:57 UTC
Created attachment 1248744 [details]
foreman-debug

Comment 4 Sachin Ghai 2017-02-09 08:24:43 UTC
Please note that this issue appears when we register a content-host w/ upgraded (sat6.2.7 -> sat6.2.8 snap1) satellite.

Comment 5 Sachin Ghai 2017-02-09 08:26:32 UTC
(In reply to Sachin Ghai from comment #4)
> Please note that this issue appears when we register a content-host w/
> upgraded (sat6.2.7 -> sat6.2.8 snap1) satellite.

Just to clarify, this issue appears for both upgraded versions..

6.1.11 -> 6.2.8
6.2.7 -> 6.2.8

Comment 6 Roman Plevka 2017-02-10 16:07:56 UTC
the 'upgrade' part plays no role in this BZ, it also fails to register a CH on a freshly installed 6.2.8-1.0.
It has trouble with using an org-id+host name and explicitely requires ID.

Comment 7 Roman Plevka 2017-02-10 16:09:02 UTC
*** Bug 1420747 has been marked as a duplicate of this bug. ***

Comment 8 Sachin Ghai 2017-02-13 07:44:13 UTC
Verified sat6.2.8 snap2

Issue has been fixed. We can now register the content-host w/ satellite.

 ~]# subscription-manager register --org Default_Organization --activationkey clientak_rhel7
The system has been registered with ID: bfe9e638-ff13-4a06-8852-56db37cc9ecf 

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

Comment 10 errata-xmlrpc 2017-03-06 08:37:50 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:0447