Bug 1627640

Summary: recurring jobs ignore organization context of host search
Product: Red Hat Satellite Reporter: Ales Dujicek <adujicek>
Component: Remote ExecutionAssignee: Adam Ruzicka <aruzicka>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: medium Docs Contact:
Priority: high    
Version: 6.4CC: aruzicka, inecas, pcreech
Target Milestone: 6.5.0Keywords: Triaged, UserExperience
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-14 12:37:59 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 Ales Dujicek 2018-09-11 07:04:09 UTC
Description of problem:

When you create recurring job in the context of Default Organization

Monitor > Jobs > Run job

Job category: Commands
Job Template: Run Command - SSH Default
Search Query: last_report > "35 minutes ago"
Command: true repeat 3
Schedule: Set up recurring execution
Repeats: cronline
Cron line: * * * * *
Repeat N times: 3
Ends: Never

the first job is scheduled for all active hosts in Default Organization (one)
but then all repetitions of the jobs are scheduled for all active hosts across all organizations (two)

in the Job invocations page (Monitor > jobs) jobs does not provide correct host count

Description	Status	Succeeded	Failed	Pending	Total hosts	Start
Run true repeat 3	succeeded	2	0	0	1	29 minutes ago
Run true repeat 3	succeeded	2	0	0	1	30 minutes ago
Run true repeat 3	succeeded	1	0	0	1	31 minutes ago

Failed is two but Total host is only one

And the jobs detail page show nonsense result data like 200% Failed, or Infinity% Failed ..


Version-Release number of selected component (if applicable):
Sat 6.4 snap 21
satellite-6.4.0-14.el7sat.noarch
foreman-1.18.0.23-1.el7sat.noarch
katello-3.7.0-6.el7sat.noarch

How reproducible:
always

Expected results:
- recurring jobs are scheduled for the proper set of hosts
- job list page shows correct host count data and/or shows jobs filtered according to organization
- job details page does not show nonsense data like 200% Success or Infinity% Success

Comment 2 Ivan Necas 2018-09-11 07:51:29 UTC
Created redmine issue https://projects.theforeman.org/issues/24882 from this bug

Comment 3 Satellite Program 2018-10-08 14:07:25 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/24882 has been resolved.

Comment 4 Peter Ondrejka 2018-11-05 14:08:43 UTC
Verified on Satellite 6.5 snap 2

Comment 8 errata-xmlrpc 2019-05-14 12:37:59 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-2019:1222