-
Bug
-
Resolution: Not a Bug
-
Normal
-
None
-
6.14.1
Description of problem:
Global registration can generate curl command with parameters of 1) an Activation Key for a CV/LE and 2) a dedicated LE, such that the CV/LE combination is invalid. Example: AK for Default CV and Library, LE = whatever non-Library. Then an attempt to register such host fails with quite cryptic error:
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint index_cve_cp_id
DETAIL: Key (cp_id)=(a5a0481ad60633eb239ec61f522ce4d2) already exists.
We have a KCS for it: https://access.redhat.com/solutions/7059235 but still it makes sense to have a check to prevent those misconfigs, directly in WebUI wizard and in hammer / API response.
Version-Release number of selected component (if applicable):
Sat 6.13+
How reproducible:
100%
Steps to Reproduce:
1. Create AK for Default CV and Library
2. Have another LE, say DEV
3. In WebUI, prepare a curl command for Global Registration for the AK and DEV
4. alternative hammer commands for 1.-3.:
activation-key create --organization-id 1 --name AK_default --lifecycle-environment Library --content-view "Default Organization View"
lifecycle-environment create --organization-id 1 --name DEV --prior Library
host-registration generate-command --organization-id 1 --activation-key ak_default --lifecycle-environment DEV
5. Use the curl command to register a Host
Actual results:
3. and 4. prepares a curl command like:
curl -sS 'https://satellite.fqdn/register?activation_keys=ak_default&lifecycle_environment_id=2&organization_id=1'
for invalid combination of CV and LE
5. fails with:
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint index_cve_cp_id
DETAIL: Key (cp_id)=(a5a0481ad60633eb239ec61f522ce4d2) already exists.
Expected results:
3. and 4. fails with a warning that given combination of CV and LE does not exist.
Additional info:
The above is the most minimalistic reproducer (hence exactly that seen at a customer). A fix should cover scenarios where having multiple AKs against mutliple CV/LEs, but neither CV is promoted to the selected LE.
- external trackers