Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1320422 - Registering a atomic host with satellite server failed with validation error: Medium Atomic_media does not belong to RedHat 7.2 operating system
Registering a atomic host with satellite server failed with validation error:...
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Content Management (Show other bugs)
6.2.0
Unspecified Unspecified
unspecified Severity high (vote)
: Beta
: Unused
Assigned To: Partha Aji
Sachin Ghai
http://projects.theforeman.org/issues...
: Triaged
Depends On:
Blocks: 1321771
  Show dependency treegraph
 
Reported: 2016-03-23 04:01 EDT by Sachin Ghai
Modified: 2018-08-31 11 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-07-27 05:28:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 14388 None None None 2016-04-22 12:04 EDT
Red Hat Product Errata RHBA-2016:1501 normal SHIPPED_LIVE Red Hat Satellite 6.2 Capsule and Server 2016-07-27 08:28:58 EDT

  None (edit)
Description Sachin Ghai 2016-03-23 04:01:31 EDT
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 17:30:24 EDT
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 04:17:49 EDT
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 19:17:17 EDT
Created redmine issue http://projects.theforeman.org/issues/14388 from this bug
Comment 7 Bryan Kearney 2016-03-29 20:11:20 EDT
Upstream bug component is Content Management
Comment 8 Partha Aji 2016-03-30 18:54:53 EDT
Should be fixed when https://github.com/Katello/katello/pull/5926 gets in
Comment 9 Bryan Kearney 2016-04-01 16:14:16 EDT
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 16:34:27 EDT
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 02:17:49 EDT
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 05:28:29 EDT
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

Note You need to log in before you can comment on or make changes to this bug.