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.
Description of problem:
When you run a remote job on a single host collection and it contains a system that belongs to multiple host collections, the job will run multiple times on that system.
How reproducible:
100%
Steps to Reproduce:
[root@sat62 ~]# hammer job-invocation create --job-template "Run Command - SSH Default" --inputs command='date +"%H:%M:%S.%N" >> /tmp/lala.txt' --search-query "host_collection = hostcol01"
Job invocation 13 created
[........................................................................................................................................] [100%]
8 task(s), 6 success, 2 fail
^^Note: 8 tasks created.
[root@sat62 ~]# hammer host-collection info --id 3
ID: 3
Name: hostcol01
Limit: None
Description:
Total Hosts: 4
^^ Note: hostcol01 has 4 hosts only.
[root@member-of-hostcol01 ~]# cat /tmp/lala.txt
18:26:55.103882174
18:26:55.104630745
18:26:55.273895571
^^ This specific member of hostcol01 belongs to 3 host collections. It ran this job 3 times.
[root@member-of-hostcol01 ~]# journalctl -u sshd --since 18:20:55
-- Logs begin at Dom 2017-06-25 04:35:12 UTC, end at Ter 2017-06-27 18:45:30 UTC. --
Jun 27 18:26:54 member-of-hostcol01.example.com sshd[2269]: Accepted publickey for root from 172.18.0.1 port 45202 ssh2: RSA ee:a4:a8:67:65:b9:a3:
Jun 27 18:26:54 member-of-hostcol01.example.com sshd[2271]: Accepted publickey for root from 172.18.0.1 port 45204 ssh2: RSA ee:a4:a8:67:65:b9:a3:
Jun 27 18:26:54 member-of-hostcol01.example.com sshd[2270]: Accepted publickey for root from 172.18.0.1 port 45203 ssh2: RSA ee:a4:a8:67:65:b9:a3:
^^ All 3 visits to this host on the same second.
[root@other-member-of-hostcol01 ~]# cat /tmp/lala.txt
18:26:54.671381525
^^ Note, this host belongs to a single Host Collection. It ran the remote job only once.
Actual results:
It created 8 tasks
Expected results:
4 tasks and the job to run only once.
Verified in Satellite 6.2.12 Snap 1.
Added a single host to two host collections then ran the below command.
-bash-4.1# hammer job-invocation create --job-template "Run Command - SSH Default" --inputs command='date +"%H:%M:%S.%N" >> /root/test.txt' --search-query "host_collection = coll2"
[Foreman] Password for admin:
Job invocation 1 created
[..............................................................] [100%]
1 task(s), 1 success, 0 fail
on the target host, it is clear that it only ran once.
[root@ibm-x3250m4-06 ~]# cat test.txt
15:46:30.231378802
Finally, see attached screenshot for job page.
=== HOTFIX INSTRUCTIONS FOR SATELLITE 6.2.11 ONLY ===
1. Download attached hotfix RPM depending on your Satellite host OS version
2. Stop Satellite
katello-service stop
3. Extract the tarball and install the package
4. Start Satellite
katello-service start
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/RHBA-2017:2803