Description of problem: Let say, the satellite has 2 lifecycle environment 'Development' and 'Testing', only Development LE is assigned and synced to the capsule. After registering a client through the capsule, I can assign 'Testing' LE to the client system in the content host profile. After that, 'yum repolist' fails with 404 error like below: ~~~~~~~~~~~~~~~ [root@client ~]# yum repolist Loaded plugins: enabled_repos_upload, package_upload, product-id, search-disabled-repos, subscription-manager https://capsule.example.com/pulp/repos/RedHat/Development/demo/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. https://capsule.example.com/pulp/repos/RedHat/Development/demo/content/dist/rhel/server/7/7Server/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found Trying other mirror. repo id repo name status rhel-7-server-rpms/x86_64 Red Hat Enterprise Linux 7 Server (RPMs) 0 repolist: 0 Uploading Enabled Repositories Report Loaded plugins: product-id, subscription-manager ~~~~~~~~~ We should not be able to assign the LE to the client which is not synced on the capsule or we can have a show proper error message(like 'This LE is not synced on the capsule') when trying to assign LE which is not synced on the capsule. Version-Release number of selected component (if applicable): Satellite 6.x How reproducible: Always Steps to Reproduce: 1. Register a client through a capsule 2. Go to client profile in content host page, assign a LE which is not synced on the capsule and select a content view in that LE 3. Execute below command on the client: # subscription-manager refresh # yum clean all; yum repolist
We should update the host content view selector to require selection in order: 1. Content source (capsule) 2. LCE 3. Content view In 6.13 the 'Change Content Source' page already does this. This would just be a matter of updating the 'Edit content view assignment' modal on the content view overview card.
In addition, the LCE and Content view selection should be limited based on what environment is assigned to the selected content source.
*** Bug 2134087 has been marked as a duplicate of this bug. ***
Created redmine issue https://projects.theforeman.org/issues/36316 from this bug
Upstream bug assigned to jlenz
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36316 has been resolved.
This is a defect and not an RFE, so I'm removing the RFE bits.
Verified in 6.14.0 snap 4 Setup as per comment 0: 1) SAT with multiple organizations and LCEs and CVs in each organization 2) CAPS with only a subset of LCEs and a host registered through it Results: 1) On Host details page -> Change content source page (through top right kebab), as well as on 2) On Host details page -> Overview tab -> Content view details card -> Edit content view assignment modal: - Message that some LCEs were disabled because they are not associated with the host's content source is displayed - Only the LCEs associated with the content source can be selected - Only CVs inside the selected LCE can be selected 3) On the 'Create Host' page - The 'Lifecycle Environment' dropdown is scoped to the selected organization (contains only the organization's LCEs). 4) Attempts to assign LCE not synced on the content source through CLI/API returns appropriate error: [ERROR 2023-06-29T14:14:20 API] 500 Internal Server Error [DEBUG 2023-06-29T14:14:20 API] { "error" => { "message" => "Validation failed: Host rhel8host.redhat.com: Cannot add content view environment to content facet. The host's content source 'capsule.redhat.com' does not sync lifecycle environment 'OWCA-2'." } } 5) Content host page -> bulk action still allows to assign any LCE to the selected host. However, the assignment fails with error and the issue will be tracked by BZ#2218528