-
Sub-task
-
Resolution: Done
-
Undefined
-
None
-
None
-
0
-
False
-
-
False
-
0
-
Phoenix
-
-
-
Sprint 133, Sprint 134
+++ This bug was initially created as a clone of Bug #2255276 +++
Description of problem:
Registration of the client system with Capsule is successful with the below message:
~~~
The system has been registered with ID: 9c0f3d6e-e60f-4950-913b-a5cfe6b452d7
The registered system name is: client.example.com
HTTP error code 422: Validation failed: Content view environment content facets is invalid
~~~
Version-Release number of selected component (if applicable):
Red Hat Satellite 6.15
How reproducible:
100%
Steps to Reproduce:
1. Register client system with Capsule with curl command generated on Satellite.
2.
3.
Actual results:
Client system registered but showing the below error:
~~~
The system has been registered with ID: 9c0f3d6e-e60f-4950-913b-a5cfe6b452d7
The registered system name is: client.example.com
HTTP error code 422: Validation failed: Content view environment content facets is invalid
~~~
Expected results:
The client system should register without error messages.
— Additional comment from on 2024-01-08T17:45:44Z
Hi,
we will need more information. Can you please add the following info:
- Command you used for the registration,
- DEBUG logs with the errors
- (if possible) site where we can reproduce the issue
Thank you
— Additional comment from on 2024-01-08T17:46:31Z
Also one question, is this a regression from the previous release or you can reproduce it only on 6.15?
— Additional comment from on 2024-01-10T15:07:39Z
Hi Leos,
Thanks for checking this bug.
Currently, I do not have a reproducer ready but I checked again and found that I can reproduce almost the same error if the Environment is not added on Capsule on Satellite version 6.15.
Below are the test results with complete command and output:
1. Registered client system with Capsule, using Activation key where Library and Default organization view is selected but Library is not synchronized to Capsule.
~~~
- curl -sS --insecure 'https://mkushwah-rhcap.syslab.pnq2.redhat.com:9090/register?activation_keys=Test+RHEL+7&force=true&ignore_subman_errors=true&location_id=2&organization_id=1&update_packages=false' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0LCJpYXQiOjE3MDQ4OTMyOTIsImp0aSI6IjNmZTNkMzE2ZTQxZmUxMmYzMzFmODY3ZGI1ZGZmMGE2YmUyMmJjNTMyZGEyZTgzMDk1ZWNiMDViNmE5YWVjMjUiLCJleHAiOjE3MDQ5MDc2OTIsInNjb3BlIjoicmVnaXN0cmF0aW9uI2dsb2JhbCByZWdpc3RyYXRpb24jaG9zdCJ9.mBoIfVnFRQRc3kcoBgccot7y9QfcO-s-mye08rEC0_Y' | bash
# - Running registration
#
This system is currently not registered.
All local data removed
The system has been registered with ID: 2d707f12-f1b2-4395-b8cd-9feadd6caab9
The registered system name is: dhcp130-181.gsslab.pnq2.redhat.com
Traceback (most recent call last):
File "/usr/sbin/subscription-manager", line 9, in <module>
load_entry_point('subscription-manager==1.24.51', 'console_scripts', 'subscription-manager')()
File "/usr/lib64/python2.7/site-packages/subscription_manager/scripts/subscription_manager.py", line 86, in main
return managercli.ManagerCLI().main()
File "/usr/lib64/python2.7/site-packages/subscription_manager/managercli.py", line 3070, in main
ret = CLI.main(self)
File "/usr/lib64/python2.7/site-packages/subscription_manager/cli.py", line 183, in main
return cmd.main()
File "/usr/lib64/python2.7/site-packages/subscription_manager/managercli.py", line 545, in main
return_code = self._do_command()
File "/usr/lib64/python2.7/site-packages/subscription_manager/managercli.py", line 1458, in _do_command
profile_mgr.update_check(self.cp, consumer['uuid'], True)
File "/usr/lib64/python2.7/site-packages/subscription_manager/cache.py", line 480, in update_check
return CacheManager.update_check(self, uep, consumer_uuid, force)
File "/usr/lib64/python2.7/site-packages/subscription_manager/cache.py", line 184, in update_check
raise re
rhsm.connection.RestlibException: HTTP error (422 - Unknown): Validation failed: Content view environment content facets is invalid - Running [dhcp130-181.gsslab.pnq2.redhat.com] host initial configuration
/usr/sbin/restorecon
# - Installing Insights client
#
Loaded plugins: product-id, search-disabled-repos, subscription-manager
https://mkushwah-rhcap.syslab.pnq2.redhat.com/pulp/content/RedHat/Library/content/dist/rhel/server/7/7Server/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/articles/1320623
If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.
Package insights-client-3.1.9-1.el7_9.noarch already installed and latest version
Nothing to do
This host has already been registered.
Automatic scheduling for Insights has been enabled.
Starting to collect Insights data for dhcp130-181.gsslab.pnq2.redhat.com
Uploading Insights data.
Successfully uploaded report from dhcp130-181.gsslab.pnq2.redhat.com to account 6038690.
View the Red Hat Insights console at https://console.redhat.com/insights/
View details about this system on console.redhat.com:
https://console.redhat.com/insights/inventory/9aa1e3a8-e277-4316-9279-7e49b14ccee2
Refreshing subscription data
All local data refreshed
Host [dhcp130-181.gsslab.pnq2.redhat.com] successfully configured.
Validation failed: Content view environment content facets is invalid
~~~
2. Registered client system with Capsule, using Activation key where "Dev" Environment and Content view "CV RHEL7" is selected which is synchronized to Capsule. This works.
~~~
- curl -sS --insecure 'https://mkushwah-rhcap.syslab.pnq2.redhat.com:9090/register?activation_keys=RHEL7&force=true&ignore_subman_errors=true&location_id=2&organization_id=1&update_packages=false' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0LCJpYXQiOjE3MDQ4OTM0NTgsImp0aSI6IjNlZTM4ZWI3OTM3NzZiZTg2NDBmZWI2ZWQwNjI4OTEwYTI1ZTlkZjcwYmUwNjA2ODBlNWM2YzZmMGFjMjgxZjIiLCJleHAiOjE3MDQ5MDc4NTgsInNjb3BlIjoicmVnaXN0cmF0aW9uI2dsb2JhbCByZWdpc3RyYXRpb24jaG9zdCJ9.3Mc_WqaZe6Jx4c04VQWTVRhAf0mhoArxFXCr2O1cHGc' | bash
# - Running registration
#
Unregistering from: mkushwah-rhcap.syslab.pnq2.redhat.com:443/rhsm
System has been unregistered.
All local data removed
The system has been registered with ID: a896144d-a797-4cb9-9678-bf110de83f35
The registered system name is: dhcp130-181.gsslab.pnq2.redhat.com - Running [dhcp130-181.gsslab.pnq2.redhat.com] host initial configuration
/usr/sbin/restorecon
# - Installing Insights client
#
Loaded plugins: product-id, search-disabled-repos, subscription-manager
rhel-7-server-satellite-client-6-rpms | 3.8 kB 00:00:00
Nothing to do
This host has already been registered.
Automatic scheduling for Insights has been enabled.
Starting to collect Insights data for dhcp130-181.gsslab.pnq2.redhat.com
Uploading Insights data.
Successfully uploaded report from dhcp130-181.gsslab.pnq2.redhat.com to account 6038690.
View the Red Hat Insights console at https://console.redhat.com/insights/
View details about this system on console.redhat.com:
https://console.redhat.com/insights/inventory/9aa1e3a8-e277-4316-9279-7e49b14ccee2
Refreshing subscription data
All local data refreshed
Host [dhcp130-181.gsslab.pnq2.redhat.com] successfully configured.
Successfully updated the system facts.
~~~
In conclusion, the issue can be reproduced if the steps used as below:
Steps to Reproduce:
1. Generate curl command from Satellite Web UI.
2. Use the Activation key in the curl command which contains Environment that is not synchronized on the Capsule.
3. Use the "Force" and "Ignore errors" options and register the client system with Capsule with the generated curl command.
Checked on Satellite 6.14, can't reproduce this issue.
Let me know if you need more details.
Here is the reproducer details:
Satellite: https://mkushwah-rhsat.syslab.pnq2.redhat.com
login: admin (RedHat1!)
Client: 10.74.130.181
login: root(redhat)
Use Content View: "Test RHEL 7"
— Additional comment from on 2024-01-17T13:26:14Z
Hi, I see that you run the command with ignore_errors=true, can I ask why? The field is there for the older versions of the subscription manager, if you use it you take full responsibility for the follow-up misbehavior in the registration process.
What's happening when you don't run it without ignore_errors?
— Additional comment from on 2024-01-17T13:55:45Z
(In reply to Leos Stejskal from comment #4)
> Hi, I see that you run the command with ignore_errors=true, can I ask why?
> The field is there for the older versions of the subscription manager, if
> you use it you take full responsibility for the follow-up misbehavior in the
> registration process.
>
> What's happening when you don't run it without ignore_errors?
In that case, the registration won't be complete, and it will exit after encountering the first error (HTTP error (422 - Unknown): Validation failed: Content view environment content facets are invalid).
— Additional comment from on 2024-01-17T14:02:21Z
I tried to play with the reproducer, but after I cleared the yum cache from the client machine (as mentioned here https://access.redhat.com/articles/1320623), the registration failed completely.
— Additional comment from on 2024-01-17T14:37:24Z
I was able to reproduce the issue as well, with following error:
> rhsm.connection.RestlibException: HTTP error (422 - Unknown): Validation failed: Content view environment content facets is invalid
Moving to the Content component, IMO this is not related to the registration.
— Additional comment from on 2024-01-18T12:37:29Z
Hi,
Thanks, Leos and Nofar,
I selected options to reproduce. I can see some updates that you can reproduce. Let me know if still any details are required.
— Additional comment from on 2024-01-18T13:57:32Z
This seems related to the error we added which disallows you from assigning a host to a lifecycle environment that is not synced on the host's capsule. If the lifecycle environment is indeed not synced to the capsule, this error would be expected (but we should still try to expose better wording so that you know that this is what the issue is.)
— Additional comment from on 2024-01-18T14:05:19Z
The error that really should be exposed is here: https://github.com/Katello/katello/blob/c617395604bda5adf99565f72cef12499d2c4e17/app/models/katello/content_view_environment_content_facet.rb#L17
— Additional comment from on 2024-01-18T14:52:14Z
Hi Mohit,
Does this issue happen (a) only when the host's lifecycle environment is not synced to the Capsule at time of registration?
Or (b) does it ever happen even when the host's lifecycle environment is properly synced?
— Additional comment from on 2024-01-22T04:51:48Z
Hi Jeremy,
Thanks for checking.
It is (a)
I only observed this issue only when the host's lifecycle environment is not synced to the Capsule at time of registration.
Regards,
Mohit Kushwah
— Additional comment from on 2024-01-22T14:54:31Z
Changed title per https://bugzilla.redhat.com/show_bug.cgi?id=2255276#c5
— Additional comment from on 2024-01-23T16:21:54Z
This doesn't need to strictly make 6.15.0 assuming the issue is indeed fixed by syncing the correct lifecycle environment to the capsule.
I would keep it for 6.15.z though since the error message is confusing.
— Additional comment from on 2024-01-25T12:20:47Z
Target Milestone is set to Unspecified, since this bug has Target Milestone set to 6.15.0 and approved release flag is not sat-6.15.0+
Once the bug has been granted the sat-6.15.0+ flag, the Target Milestone can be set to the desired value.
— Additional comment from on 2024-05-06T17:05:07Z
This commit might fix the issue: https://github.com/Katello/katello/commit/a1c864acdde85deaff5b22e131086cff5e3ffb4a
— Additional comment from on 2024-05-06T17:13:33Z
Adding Jeremy as owner for credit since I'm 99% sure it fixes the issue. If it's a failQA then we can bring it back to the drawing-board.
— Additional comment from on 2024-05-09T18:14:36Z
Created attachment 2032383
Special Hotfix RPM for Satellite 6.14.4 (2249540+2255276)
PLEASE NOTE: THIS HOTFIX COVERS MULTIPLE BUGZILLAS
A hotfix RPM is available for this BZ and https://bugzilla.redhat.com/show_bug.cgi?id=2249540 on Satellite 6.14.4
INSTALL INSTRUCTIONS:
1. Create a complete backup or snapshot of Satellite 6.14.4 server
2. Download the hotfix RPM from this attachment
3. # dnf install ./rubygem-katello-4.9.0.25-2.HOTFIXRHBZ2249540_2255276.el8sat.noarch.rpm --disableplugin=foreman-protector
4. # satellite-maintain service restart
QE Tracker for https://issues.redhat.com/browse/SAT-25079
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2280231