Project

General

Profile

Actions

Bug #39110

closed

Foreman UI Displays Wrong Number of Hosts When Filter By Report Origin (Puppet , Ansible)

Added by Nofar Kirshon 5 months ago. Updated 7 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

The UI is no longer displaying the correct number of Hosts from the Hosts => All Hosts page when you search for origin = Puppet (or Ansible) in the filter box.

The UI grabs the correct number of hosts, however, when it displays the hosts, it is looking at the number of reports per host to display, and not the hosts themselves. If the first host has more reports then the number of hosts per page, then the UI will only display that 1 host, even though there should be 50 hosts displayed.

This was first noticed when clicking on the reports from the Dashboard page for the Host Configuration Chart for Puppet report.

How reproducible:
always when the number of reports of the hosts are higher than the hosts per page

Is this issue a regression from an earlier version:
Yes.

Steps to Reproduce:
1. Depending on the size of your environment, you may need to determine which host is listed in the UI first, and make sure you modify the reports for that host. This will cause the UI to not load/display any of the hosts after that host.

2. Navigate to Hosts => All Hosts and type "origin = Puppet* in the filter box. If there is more than 1 host listed, you can just edit the reports for the first host listed. If no hosts are listed, you can just create Puppet reports for 2 random hosts.

3a. If you don't have any hosts listed in the UI, find 2 hosts ids, and use them in the commands below. I used the ids 10 and 20 for my hosts in my tests below:

for i in $(seq 0 51); do su - postgres -c "psql -d foreman -c \"insert into reports (id, host_id, origin, reported_at) values ('1000$i','10','Puppet','2025-12-05 17:27:37')\""; done

for i in $(seq 0 51); do su - postgres -c "psql -d foreman -c \"insert into reports (id, host_id, origin, reported_at) values ('2000$i','20','Puppet','2025-12-05 17:27:37')\""; done
3b. If there were hosts listed, you can just added some extra report entries for the first host listed. Find that host's id, and use it in the following command from Foreman (in the following example the host id is 30):

for i in $(seq 0 51); do su - postgres -c "psql -d foreman -c \"insert into reports (id, host_id, origin, reported_at) values ('2000$i','30','Puppet','2025-12-05 17:27:37')\""; done
4. Navigate to Hosts => All Hosts and type origin = Puppet in the filter box

Actual behavior:
Only the first host will get listed in the UI display, even though the count per page shows more hosts

Expected behavior:
The UI should display all of the hosts listed, and not just 1 host

Business Impact / Additional info:
UI isn't working correctly

Actions #1

Updated by The Foreman Bot 5 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/10886 added
Actions #2

Updated by The Foreman Bot 4 months ago

  • Fixed in Releases 3.19.0 added
Actions #3

Updated by Nofar Kirshon 4 months ago

  • Status changed from Ready For Testing to Closed
Actions #4

Updated by Ewoud Kohl van Wijngaarden 7 days ago

  • Red Hat JIRA set to SAT-45957
Actions

Also available in: Atom PDF