Bug 1383793

Summary: host_subscriptions_controller POST create incorrect args to find_or_create_host
Product: Red Hat Satellite Reporter: Tom McKay <tomckay>
Component: Hosts - ContentAssignee: Tom McKay <tomckay>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: medium Docs Contact:
Priority: high    
Version: 6.2.0CC: bbuckingham, bkearney, jcallaha, lpramuk, rplevka, zhunting
Target Milestone: UnspecifiedKeywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-katello-3.0.0.89-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1400970 (view as bug list) Environment:
Last Closed: Type: ---
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: 1380473, 1394349    
Bug Blocks: 1400970    

Description Tom McKay 2016-10-11 18:33:12 UTC
Related to https://github.com/Katello/katello/pull/6328

To reproduce call POST /host_subscriptions/create

Comment 1 Tom McKay 2016-10-11 18:33:21 UTC
Created from redmine issue http://projects.theforeman.org/issues/16867

Comment 2 Tom McKay 2016-10-11 18:33:26 UTC
Upstream bug assigned to tomckay

Comment 4 Brad Buckingham 2016-10-14 17:41:51 UTC
The PR referenced in the description is related to bugzilla 1380473; therefore, triaging this one to be consistent with it as well as adding it as a 'depends on'.

Comment 5 Bryan Kearney 2016-11-03 14:02:53 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16867 has been resolved.

Comment 6 Justin Sherrill 2016-12-01 16:48:37 UTC
*** Bug 1397860 has been marked as a duplicate of this bug. ***

Comment 8 Lukas Pramuk 2016-12-02 08:37:55 UTC
this BZ title is so magical - the impact is more obvious: 

API/CLI host registration fails with ArgumentError: wrong number of arguments (3 for 2)

Comment 10 Lukas Pramuk 2016-12-02 10:54:44 UTC
This build introduced the regression for 6.2.z: 
tfm-rubygem-katello-3.0.0.86-1 

while tfm-rubygem-katello-3.0.0.82-1 (Sat6.2.4) is ok

Comment 11 Lukas Pramuk 2016-12-06 08:23:45 UTC
VERIFIED.

@satellite-6.2.5-1.0.el6sat.noarch
tfm-rubygem-katello-3.0.0.89-1.el6sat.noarch

# hammer host subscription register --name <HOST_FQDN> --lifecycle-environment-id 1 --organization-id 1 --content-view-id 1
Host successfully registered


# tail -f /var/log/foreman/production.log
...
2016-12-06 03:08:48 [app] [I] Started POST "/api/hosts/subscriptions" for ::1 at 2016-12-06 03:08:48 -0500
2016-12-06 03:08:48 [app] [I] Processing by Katello::Api::V2::HostSubscriptionsController#create as JSON
2016-12-06 03:08:48 [app] [I]   Parameters: {"name"=>"<HOST_FQDN>", "facts"=>"[FILTERED]", "lifecycle_environment_id"=>1, "content_view_id"=>1, "api_version"=>"v2", "host_subscription"=>{"name"=>"<HOST_FQDN>", "facts"=>"[FILTERED]", "lifecycle_environment_id"=>1, "content_view_id"=>1}}
2016-12-06 03:08:48 [app] [I] Authorized user admin(Admin User)
2016-12-06 03:08:50 [app] [I] Import facts for '<HOST_FQDN>' completed. Added: 0, Updated: 1, Deleted 209 facts
2016-12-06 03:08:53 [app] [I] Import facts for '<HOST_FQDN>' completed. Added: 0, Updated: 1, Deleted 1 facts
2016-12-06 03:08:53 [app] [I]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.89/app/views/katello/api/v2/hosts/show.json.rabl within katello/api/v2/layouts/resource (8.0ms)
2016-12-06 03:08:53 [app] [I] Completed 200 OK in 5254ms (Views: 15.9ms | ActiveRecord: 232.4ms)
...

Comment 12 Bryan Kearney 2016-12-12 18:48:29 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-2016:2940

Comment 13 Bryan Kearney 2016-12-12 18:48:40 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-2016:2940