Bug 863526

Summary: failed registration with activation key leaves system in candlepin
Product: Red Hat Satellite Reporter: Tom McKay <tomckay>
Component: Content ManagementAssignee: Tom McKay <tomckay>
Status: CLOSED WONTFIX QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: mmccune, omaciel
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-18 17:38:55 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:

Description Tom McKay 2012-10-05 17:53:19 UTC
Description of problem:

When system registration with an activation key fails, an entry is left in the candlepin cp_consumer database. This "extra" system is showing up in the dashboard stats.

# subscription-manager register --org 91d8977f-a64a-45f8-af18-d62b8cd818a5 --activationkey test
Not enough entitlements in pools (1), required: 4, available: 2

candlepin=> select * from cp_consumer where name = 'qeclient07.usersys.redhat.com';
                id                |          created           |          updated           | autoheal | entitlementstatus |        lastcheckin         |     
        name              | servicelevel |   username    |                 uuid                 | environment_id |        consumer_idcert_id        |         
   keypair_id            |             owner_id             | type_id | releasever 
----------------------------------+----------------------------+----------------------------+----------+-------------------+----------------------------+-----
--------------------------+--------------+---------------+--------------------------------------+----------------+----------------------------------+---------
-------------------------+----------------------------------+---------+------------
 ff8080813a2c5153013a2db30c3500e3 | 2012-10-04 17:33:59.733-04 | 2012-10-04 17:34:00.254-04 | t        | invalid           |                            | qecl
ient07.usersys.redhat.com |              | hidden-PRuSw1 | 529f082c-2017-44d1-ac8b-cf0686101a23 | 3              | ff8080813a2c5153013a2db30e1600e6 | ff808081
3a2c5153013a2db30e0200e5 | ff8080813a288eee013a28921ddb0003 | 1000    | 
 ff8080813a2c5153013a2db6e390013e | 2012-10-04 17:38:11.472-04 | 2012-10-05 13:27:18.594-04 | t        | valid             | 2012-10-05 13:27:18.594-04 | qecl
ient07.usersys.redhat.com |              | guest         | 37530392-80ea-415e-beed-28b32f49baa1 | 3              | ff8080813a2c5153013a2db6e50f0141 | ff808081
3a2c5153013a2db6e4fd0140 | ff8080813a288eee013a28921ddb0003 | 1000    | 
(2 rows)

katelloschema=> select * from systems where name = 'qeclient07.usersys.redhat.com';
 id |                 uuid                 |             name              |         description         | location | environment_id |         created_at     
    |         updated_at         | system_template_id |  type  
----+--------------------------------------+-------------------------------+-----------------------------+----------+----------------+------------------------
----+----------------------------+--------------------+--------
  9 | 37530392-80ea-415e-beed-28b32f49baa1 | qeclient07.usersys.redhat.com | Initial Registration Params | None     |              3 | 2012-10-04 21:38:12.636
196 | 2012-10-04 21:38:12.636196 |                    | System
(1 row)


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 2 Og Maciel 2012-10-05 19:17:09 UTC
This is how I managed to stumble on this issue:

* Imported a manifest file with "stacked" subscriptions
* Created an organization using i18n characters:  Tupinambá
* Environment: Mild
* Enabled, synced and promoted RHEL 6 Server content to Mild environment
* Created a custom repo, synced and also promoted it to Mild
* Created an activation key, unlimited access, and added all available subscriptions to it
* ssh to a RHEL 6.2 client
* "faked" a multi-socket system

   echo '{"cpu.cpu_socket(s)":"4"}' > /etc/rhsm/facts/sockets.facts

* registered it against my katello instance. Since the organization name had i18n characters, the Details pane for the activation key told me to use the following command:

  subscription-manager register --org 91d8977f-a64a-45f8-af18-d62b8cd818a5 --activationkey test

Note: 91d8977f-a64a-45f8-af18-d62b8cd818a5 was organziation label that was automatically created for me

This process failed:

# subscription-manager register --org 91d8977f-a64a-45f8-af18-d62b8cd818a5 --activationkey test
Not enough entitlements in pools (1), required: 4, available: 2

Ok, so I decided to subscribe to it using the proper Org name:

# subscription-manager register --user guest --password guest --org Tupinambá --env MildThe system has been registered with id: 37530392-80ea-415e-beed-28b32f49baa1

Comment 4 Mike McCune 2014-03-18 17:38:55 UTC
This bug was closed because of a lack of activity.  If you feel this bug should be reconsidered for attention please feel free to re-open the bug with a comment stating why it should be reconsidered.