Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1589083

Summary: Hosts filter option from Satellite web UI is not working as expected.
Product: Red Hat Satellite Reporter: Sagar Lutade <slutade>
Component: HostsAssignee: Amir <afeferku>
Status: CLOSED ERRATA QA Contact: Corey Welton <cwelton>
Severity: high Docs Contact:
Priority: high    
Version: 6.3.1CC: akarimi, briasmit, inecas, jhutar, slutade, sokeeffe, sshtein, tbrisker
Target Milestone: 6.4.0Keywords: PrioBumpField, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-16 18:53:20 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:
Attachments:
Description Flags
Select All Hosts
none
Filter One Host none

Description Sagar Lutade 2018-06-08 11:27:36 UTC
Description of problem:

>> Hosts filter option from Satellite web UI is not working as expected.

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

>> How reproducible:

1) Go to Satellite web UI > All Hosts 

2) Select all hosts 

3) Filter so only one host is now shown 

4) Deselect the filtered host. 

Now you have a screen showing only one host that is not selected. 

Now you have got a screen showing just one host that's not chosen. 

Now run a remote execution task, host delete or the other bulk action - gazing this screen you'd definitely expect NO HOSTS to be affected.

However, Satellite 6 remembers your choice from before the filter and will affect ALL HOSTS you selected previously. 

This should not be an expected behavior and could be a really harmful security issue, as an example, patching, rebooting or perhaps deleting servers you probably did not intend too.


>> Actual results:

If we tend to filter the host the selection must not be selected.
Displaying 1 entry - 4 selected

>> Expected results:

Selection must be unselected if we use the filter option.

>> Additional info:

Even though we refresh the webpage the selection remains.

Comment 3 Shimon Shtein 2018-06-13 17:54:02 UTC
On the other hand the same mechanism enables you to run multiple queries and gather hosts from all of them.

Example:
let's assume you have two hosts for each letter of the abc:

a,aa,b,bb,c,cc e.t.c.

Now you want to select only aa and bb.
The simplest way would be typing "aa" in the search panel, selecting the host, then typing "bb" in the panel and selecting the host.

Now you have two hosts in your selection and you can perform bulk actions on them.

The example is rather oversimplified, but I think multiple queries is a valid use case here. Plus the user actually sees the list of selected hosts before the bulk action, so it is obvious to the user which hosts will be affected by the action.

Comment 4 Ivan Necas 2018-06-13 19:36:25 UTC
Shim: it still sounds like a bug to me. Otherwise, we would need to indicate clearly that X hosts is still selected, with an option to show all selected hosts. Since that's not the case, I agree with Sagar that it's unexpected and potentially dangerous behaviour.

Comment 5 Jan Hutař 2018-06-19 13:50:44 UTC
I agree with Shim that is sounds more like feature and not a bug.

Sagar, would it be OK for customer if we would add more clarity/visibility about how many hosts is selected and something like links to "clear selection" and "show all selected"?

On the other hand, looking at Sat 6.4.0 snap 7:

1. Hosts -> All hosts (I have only one)
2. Select it, make sure it says "1 of 1 selected"
3. Put "this_host_does_not_exist" and press Enter or click "Search"

now it says "0 of 0 selected" (and "Select action" button is disabled) and I would consider it a bug. What is incorrect is that:

4. Now click to Hosts -> All hosts again, note it says "0 of 1 selected"
5. Ctrl + R to refresh the page and notice the host gets checked, but label
   still says "0 of 1 selected"

So IMO this is broken, we just do not know which way. Would it make sense to involve UX rep here?

Comment 6 Sagar Lutade 2018-06-19 13:56:47 UTC
Hi Jan,

Not sure but the customer had tested with some 4-5 hosts.

Also, I have tested on the Satellite server for about 50 and above hosts (virt-who hosts) and seems to have the same behavior as per customer scenario. 

Let me know if you need any more information from my end.

Comment 7 Jan Hutař 2018-06-20 10:36:04 UTC
I have tried on Sat 6.3.0 and it works as I would expect:

1. Hosts -> All hosts -> Select all items on this page (only have few systems so they fit to the page - 2 in my case)
2. Check that text below table says: "Displaying all 2 entries - 2 selected"
3. Filter only one of the system
4. Make sure it is selected and text says "Displaying 1 entry - 2 selected"
5. Unselect it and check that text says "Displaying 1 entry - 1 selected"
6. Make sure Select action -> Schedule Remote Job select only the system which was left in the selection

Sagar, would it be OK for customer if we would add more clarity/visibility about how many hosts is selected and something like links to "clear selection" and "show all selected"?

Comment 8 Jan Hutař 2018-06-20 10:40:03 UTC
Doing the same on 6.4.0 fails (here I have 4 systems):

in step 2 it says "4 of 4 selected" -> GOOD
in step 4 filtered system is not checked and text says "0 of 1 selected" -> BAD

Restoring needinfo on Ivan

Comment 9 Ivan Necas 2018-06-28 08:13:50 UTC
Connecting redmine issue https://projects.theforeman.org/issues/19122 from this bug

Comment 10 Ivan Necas 2018-06-28 08:16:15 UTC
Actually: the behaviour was actually fixed in upstream foreman 1.16 (issue attached) to reset the selection on filtering, so it sycn of the original ask of this BZ, moving to ON_QA, as I believe it's actually less surprising behaviour than the one we had there before.

Comment 11 Ivan Necas 2018-06-28 08:33:48 UTC
Connecting redmine issue https://projects.theforeman.org/issues/19122 from this bug

Comment 12 Chris Brown 2018-07-06 17:31:13 UTC
Created attachment 1457054 [details]
Select All Hosts

Comment 13 Chris Brown 2018-07-06 17:31:58 UTC
Created attachment 1457055 [details]
Filter One Host

host is no longer selected and text is updated correctly (0 of 1 selected)

Comment 14 Chris Brown 2018-07-06 17:32:40 UTC
Verified in Satellite 6.4

Comment 18 Bryan Kearney 2018-10-16 18:53:20 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, 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-2018:2927

Comment 19 Brian Smith 2019-06-04 21:50:51 UTC
Created new BZ (https://bugzilla.redhat.com/show_bug.cgi?id=1717202) as this issue is occurring in Satellite 6.5.