Red Hat Bugzilla – Bug 1465628
A remote job runs multiple times on a single server that belongs to multiple Host Collections
Last modified: 2018-04-13 09:47:42 EDT
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.
*** Bug 1465621 has been marked as a duplicate of this bug. ***
Created redmine issue http://projects.theforeman.org/issues/20260 from this bug
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20260 has been resolved.
*** Bug 1479091 has been marked as a duplicate of this bug. ***
Verified in Satellite 6.3 Snap 10. Added an RE-enabled host to 3 host collections, then executed the following command. -bash-4.2# hammer job-invocation create --job-template "Run Command - SSH Default" --inputs command='date +"%H:%M:%S.%N" >> /root/test.txt' --search-query "host_collection = collection2" Job invocation 3 created [......................................] [100%] 1 task(s), 1 success, 0 fail --- on the host --- -bash-4.2# cat test.txt 20:09:45.333383189
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.
Created attachment 1319206 [details] verification screenshot
Created attachment 1324496 [details] rhel7_hotfix
Created attachment 1324497 [details] rhel6_hotfix
=== 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
Amendment to 6.2.11 hotfix instructions: The hotfix RPMs are not archived, so there isn't a tarball to extract in step 3.
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