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 1701543 - Enhance subscription-manager so that it can automatically supress duplicate activation keys specified by the --activationkey command-line option
Summary: Enhance subscription-manager so that it can automatically supress duplicate a...
Keywords:
Status: CLOSED DUPLICATE of bug 1701541
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Registration
Version: 6.5.0
Hardware: All
OS: Linux
low
low
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Stephen Wadeley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-19 13:18 UTC by momran
Modified: 2021-01-07 17:08 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-01-07 17:08:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description momran 2019-04-19 13:18:28 UTC
Description of problem:

As a result of many individual parts of automation and inheritance related to server provisioning, we might end up with duplicate activation-keys. 

This apperently results in an SQL-error on the server trying to register:

[root@hostname ~]# subscription-manager register --name="hostname.example.com" --org='Example' --activationkey='act-auto-attach-vdc,act-Verification-cv-soe-7Server,act-Verification-cv-soe-7Server'
HTTP error (500 - Internal Server Error): PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "katello_subscription_facet_activation_keys_sa_ak_id"
DETAIL:  Key (subscription_facet_id, activation_key_id)=(3530, 24) already exists.
: INSERT INTO "katello_subscription_facet_activation_keys" ("subscription_facet_id", "activation_key_id") VALUES ($1, $2) RETURNING "id"


In order to avoid encountering the error described above, the customer would like to have an enhanced version of subscription-manager, which is capable of identifying multiple activation key values specified using the --activationkey command-line option, and automatically supressing the duplicate values (if any).


The customer would test to confirm that the requirement is successfully implemented by executing a 'subscription-manager register' command that has duplicate activation key values specified using the --activationkey command-line option. For example:
~~~
[root@hostname ~]# subscription-manager register --name="hostname.example.com" --org='Example' --activationkey='act-auto-attach-vdc,act-Verification-cv-soe-7Server,act-Verification-cv-soe-7Server'
~~~


How reproducible:


Steps to Reproduce:
1. Perform a complete a basic kickstart-based installation using satellite
2. Try to register the newly installed host using subscription-manager with a valid activation-key mentioned 2 times (or more).


Actual results:

The following error message is received, and the host registration fails:
~~~
HTTP error (500 - Internal Server Error): PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "katello_subscription_facet_activation_keys_sa_ak_id"
DETAIL:  Key (subscription_facet_id, activation_key_id)=(3530, 24) already exists.
: INSERT INTO "katello_subscription_facet_activation_keys" ("subscription_facet_id", "activation_key_id") VALUES ($1, $2) RETURNING "id"
~~~


Expected results:

subscription-manager would be able to intelligently identify that there is a duplicate activation key specified, and suppress it, resulting in a successful system registration.

Comment 3 Rehana 2020-12-11 15:54:46 UTC
Hi , 

We have evaluated this request, and we believe more robust fix for this issue can be done in server side . Hence moving this bug to katello for consideration. 

Thanks,
Rehana

Comment 4 Brad Buckingham 2021-01-07 17:08:56 UTC

*** This bug has been marked as a duplicate of bug 1701541 ***


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