Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1320422

Summary: Registering a atomic host with satellite server failed with validation error: Medium Atomic_media does not belong to RedHat 7.2 operating system
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: Content ManagementAssignee: Partha Aji <paji>
Status: CLOSED ERRATA QA Contact: Sachin Ghai <sghai>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bbuckingham, ehelms, mmccune, omaciel, sghai
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/14388
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 09:28:29 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: 1321771    

Description Sachin Ghai 2016-03-23 08:01:31 UTC
Description of problem: 

I provisioned a atomic host via Satellite. Since I've synced rhel7 base OS as well as rhel 7.2 atomic ostree in same org, so when I tried to provision atomic host, it got failed due to bz1318743.

As a workaround, I didn't select content-source for provisioning atomic host. Host was provisioned successfully. 

Later, I tried to register the host with satellite server with and w/o activation-key and got following error:


-bash-4.2# subscription-manager register --org "Default_Organization"
Registering to: <sat_server>:443/rhsm
Username: admin
Password: 
Environment: Library
Validation failed: Medium Atomic_media does not belong to RedHat 7.2 operating system

-bash-4.2# subscription-manager register --org "Default_Organization" --activationkey ak_ostree
Validation failed: Medium Atomic_media does not belong to RedHat 7.2 operating system


production.log:
================

2016-03-23 03:42:18 [app] [I] Started POST "/rhsm/consumers?owner=Default_Organization&activation_keys=ak_ostree" for 192.168.100.48 at 2016-03-23 03:42:18 -0400
2016-03-23 03:42:18 [app] [I] Processing by Katello::Api::Rhsm::CandlepinProxiesController#consumer_activate as JSON
2016-03-23 03:42:18 [app] [I]   Parameters: {"facts"=>"[FILTERED]", "installedProducts"=>[{"productName"=>"Red Hat Enterprise Linux Atomic Host", "arch"=>"x86_64", "version"=>"7", "productId"=>"271"}, {"productName"=>"Red Hat Enterprise Linux Server", "arch"=>"x86_64", "version"=>"7.1", "productId"=>"69"}], "type"=>"system", "name"=>"atomichost.idmqe.lab.eng.bos.redhat.com", "contentTags"=>["rhel-atomic-7", "rhel-atomic", "rhel-7", "rhel-7-server"], "owner"=>"Default_Organization", "activation_keys"=>"ak_ostree"}
2016-03-23 03:42:19 [app] [I] Import facts for 'atomichost.idmqe.lab.eng.bos.redhat.com' completed. Added: 106, Updated: 1, Deleted 0 facts
2016-03-23 03:42:19 [foreman-tasks/action] [E] Validation failed: Medium Atomic_media does not belong to RedHat 7.2 operating system (ActiveRecord::RecordInvalid)
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/validations.rb:57:in `save!'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
 

Please note that before registering the host, I setup host with  katello-rhsm-consumer. And /etc/rhsm/rhsm.conf  was pointing to correct satellite server.


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

How reproducible:
always

Steps to Reproduce:
1. Provision atomic host
2. register it with satellite
3.

Actual results:
[E] Validation failed: Medium Atomic_media does not belong to RedHat 7.2 operating system 

Expected results:
host should be registered successfully with server

Additional info:

Comment 2 Partha Aji 2016-03-28 21:30:24 UTC
Sachin I need you to try a couple of things here 
1) Paste your rhsm.conf here and "grep ostree /etc/rhsm/rhsm.conf" returns true.

2) https://bugzilla.redhat.com/show_bug.cgi?id=1318066 didn't make the last snap (I guess we didnt mark as high sev even though it was...) So the katello-rhsm-conusmer script will likely not set the correct URL.. I suggest you manually apply this change to your /var/www/html/pub/katello-rhsm-consumer -> 

https://github.com/Katello/puppet-certs/blob/master/templates/rhsm-katello-reconfigure.erb#L27

and on your atomic machine rerun ->  "curl -s http://<sat>/pub/katello-rhsm-consumer | bash" and try registering.

Comment 5 Sachin Ghai 2016-03-29 08:17:49 UTC
I made changes as you suggested on line 27 in katello-rhsm-conusmer script. But no luck. Still getting

-bash-4.2# subscription-manager register --org="Default_Organization" --activationkey=ak_rhel7_atomic
Validation failed: Medium Atomic Media does not belong to RedHat 7.2 operating system
-

Comment 6 Partha Aji 2016-03-29 23:17:17 UTC
Created redmine issue http://projects.theforeman.org/issues/14388 from this bug

Comment 7 Bryan Kearney 2016-03-30 00:11:20 UTC
Upstream bug component is Content Management

Comment 8 Partha Aji 2016-03-30 22:54:53 UTC
Should be fixed when https://github.com/Katello/katello/pull/5926 gets in

Comment 9 Bryan Kearney 2016-04-01 20:14:16 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/14388 has been closed
-------------
Partha Aji
Applied in changeset commit:katello|5926f92b1a19397dd3f57f0d932221279c4d4180.

Comment 10 Og Maciel 2016-04-06 20:34:27 UTC
For QE, you may want to look at https://github.com/Katello/katello/pull/5926#issuecomment-203667995 for more information as to what to expect to see when verifying this issue.

Comment 11 Sachin Ghai 2016-04-12 06:17:49 UTC
Verified with Satellite 6.2 snap7.1

I can register atomic host with satellite using katello-rhsm-consumer and with activation-key as below:

# subscription-manager register --org="Default_Organization" --activationkey=ak_atomic
The system has been registered with ID: dc5c5083-ebf0-488f-8a9f-e1443b7192b3 

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Atomic Host
Status:       Subscribed

Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed



redhat.conf contains following:

[remote "rhel-atomic-host-ostree"]
url = https://cloud-qe-3.idmqe.lab.eng.bos.redhat.com/pulp/ostree/web/Default_Organization/Dev/cv_ostree/content/dist/rhel/atomic/7/7Server/x86_64/ostree/repo
gpg-verify = false
tls-client-cert-path = /etc/pki/entitlement/6139460787062692853.pem
tls-client-key-path = /etc/pki/entitlement/6139460787062692853-key.pem
tls-ca-path = /etc/rhsm/ca/katello-server-ca.pem



Manual register:
-bash-4.2# subscription-manager register --username admin --password changeme --org="Default_Organization"
Registering to: cloud-qe-3.idmqe.lab.eng.bos.redhat.com:443/rhsm
Environment: Library
The system has been registered with ID: cd4f72a5-0470-449e-8799-2b85fe72d984

Comment 13 errata-xmlrpc 2016-07-27 09:28: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:1501