Bug 1952529

Summary: Package and Errata actions on content hosts selected using the "select all hosts" option fails.
Product: Red Hat Satellite Reporter: Kaushik Sajjan Agarwal <kagarwal>
Component: Hosts - ContentAssignee: Jeremy Lenz <jlenz>
Status: CLOSED ERRATA QA Contact: Vladimír Sedmík <vsedmik>
Severity: high Docs Contact:
Priority: high    
Version: 6.8.0CC: ahumbe, bricci, gpadholi, gtalreja, inecas, jlenz, jrichards2, jyejare, oliver, pcreech, satellite6-bugs, smajumda, vsedmik
Target Milestone: 6.13.0Keywords: PrioBumpGSS, Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: rubygem-katello-4.7.0.11-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2174997 (view as bug list) Environment:
Last Closed: 2023-05-03 13:20:33 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 Kaushik Sajjan Agarwal 2021-04-22 13:51:40 UTC
Description of problem:

Package and Errata actions on content hosts selected using the "select all hosts" option fails.

Version-Release number of selected component (if applicable):

Satellite 6.8

How reproducible:

Always

Steps to Reproduce:
1. Navigate to "WebUI > Hosts > Content Hosts".
2. Click on the check box at the top of the table to select all the hosts displayed on the current page.
3. Now, click on the "Select all X" text to select all the content hosts across all the pages.
4. Click on "Select Actions" and then select "Manage Packages"
5. Try to perform any of the actions like Install, Update, Remove or Update All Packages through remote execution and it fails with the error "Oops, we're sorry but something went wrong No hosts have been specified."
6. For the errata reproducer, follow steps 1 to 3 and then click on "Select Actions" and then select "Manage Errata"
7. Then select any Errata and try to apply the same using remote execution and fails with the error "Oops, we're sorry but something went wrong No hosts have been specified."

Actual results:

Error "Oops, we're sorry but something went wrong No hosts have been specified." is observed.

Expected results:

No error should occur and desired action should get initiated successfully.

Additional info:

Comment 9 Bruno Ricci 2022-09-15 07:31:46 UTC
Hi Team,

my customer is in 6.10.6 and is affected.

Nevertheless, if the errata are applied using Host -> Content Host -> search applicable_errata = <errata_id> -> select all -> Manage errata -> search id = <errata_id> -> tick on the errata -> install selected everything works.

No case has been filed, considering this bugzilla.

Is there a plan to fix this?

Many thanks,
B.

Comment 10 Bruno Ricci 2022-09-15 07:42:42 UTC
As an additional detail: if we add, in Host->Contetn host a filter on lifecycle_environment (say: applicable_errata = <id> and lifecycle_environment = <lce>) and we repeat the steps above in "Content Host Errata Management" no errata is found ("There are no Errata associated with this Content Host to display").

Regards,
B.

Comment 12 Oliver Ilian 2022-10-14 09:17:56 UTC
Hi Team,

is there any update on when the "Select all" link will work? I would like to let the customer know.

Thanks
Oliver

Comment 13 Jessica Richards 2022-10-14 16:19:55 UTC
Note:  A partial workaround I've tested and used with customers is to increase the number of displayed packages per page to 100.  If there are 100 or fewer packages in the list, then "select all" works.  If there are more than 100 packages, then selecting only the packages on the first page works.

The same effect happens when using the default page list of 20 packages; when there are 20 or fewer packages in the list, then "select all" works.  It only fails when the number of packages spills onto additional pages. IOW, this doesn't really look like a problem with the "select all" feature, but rather with pagination handling.

Comment 15 Jeremy Lenz 2023-01-13 18:27:51 UTC
As a workaround on 6.11 you could do the following

1. Go to All Hosts
2. Click any host with applicable errata
3. Click the New UI button to view the new host details UI
4. Go to Content > Errata and select all errata.
5. Click the down-arrow next to Apply and then click "via customized remote execution." This will take you to the job invocation form with the "Install errata by search query" job template.
6. On the job invocation form, edit the host search to apply to all hosts.

For package actions, you can also customize similar remote execution jobs by using the "Install / remove / update packages by search query" job template.

Comment 16 Jeremy Lenz 2023-01-13 20:18:17 UTC
Created redmine issue https://projects.theforeman.org/issues/35947 from this bug

Comment 17 Jeremy Lenz 2023-01-13 21:02:06 UTC
I wasn't able to reproduce the package actions scenario. But I reproduced the errata apply scenario (see https://github.com/Katello/katello/pull/10416)

Comment 18 Bryan Kearney 2023-01-14 00:02:01 UTC
Upstream bug assigned to jlenz

Comment 19 Bryan Kearney 2023-01-14 00:02:04 UTC
Upstream bug assigned to jlenz

Comment 23 Jeremy Lenz 2023-02-09 22:16:21 UTC
To verify:

1. Navigate to "WebUI > Content > Errata".
2. Select any errata that's applicable to at least one content host, and click Apply Errata
3. Click the checkbox to select the entire page of hosts
4. Now, click on the "Select all X" text to select all the content hosts across all the pages.
5. Click to confirm
6. Click to apply the errata


Expected results:

The error "Oops, we're sorry but something went wrong No hosts have been specified." should not occur.
Also, the REX job host search should list _only_ the hosts on which that errata is applicable -- not all hosts.

Comment 25 Vladimír Sedmík 2023-02-17 13:33:53 UTC
Reproduced in 6.13.0 snap 10, verified in 6.13.0 snap 11 (with rubygem-katello-4.7.0.11-1.el8sat.noarch):

Steps:
1) Set pagination that registered hosts were split between more pages: Administer -> Settings -> Entries per page = 3
2) Synced RHEL8 BaseOS, created AK and registered 4 RHEL8 content hosts.
3) Followed steps from Comment#23. Clicking on "Select all 4" text selected the host on next page too.

Results:
"Oops" error was not shown (as opposed to snap 10)
Install errata REX job was started against all 4 hosts, which was exactly the count of hosts where the errata was applicable, and a subset of all hosts registered to the Satellite.
Also tried with erratas applicable to lower count of hosts.

Comment 30 errata-xmlrpc 2023-05-03 13:20:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.13 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:2097