Bug 2220978

Summary: Selecting day of the week for recurring remote jobs chooses wrong day
Product: Red Hat Satellite Reporter: John <jsweiker>
Component: Remote ExecutionAssignee: Adam Ruzicka <aruzicka>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.13.3CC: ahumbe, aruzicka, lhellebr, pcreech, rlavi
Target Milestone: 6.14.0Keywords: Regression, Triaged, UserExperience
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: rubygem-foreman_remote_execution-10.0.5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2242912 (view as bug list) Environment:
Last Closed: 2023-11-08 14:19:54 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 John 2023-07-06 19:05:21 UTC
Description of problem:
Provides day+1 of selected day when scheduling a recurring job through Monitor>Jobs page. Similar to 2036721
Legacy page works fine.

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

How reproducible:
Always

Steps to Reproduce:
1. Schedule a recurring job from the Monitor>Jobs>Run Job page. 
2. Select a day of the week. 
3. Finalize the job and click run. 
4. Verify date on the page that it brings you to.

Actual results:
Date is one day after selected day of the week

Expected results:
Date is the same as the day of the week selected

Additional info:

Comment 1 Adam Ruzicka 2023-07-18 08:37:02 UTC
I'm failing to reproduce this. If I now (2023-07-18, Tuesday) set the job to repeat weekly on Fridays, the job gets scheduled to be run on 2023-07-21 which is a Friday.

Any extra tips for reproducing this? What version of rubygem-foreman_remote_execution do you have?

Comment 2 Adam Ruzicka 2023-07-18 08:45:25 UTC
And on a maybe related note, what is your locale?

Comment 3 John 2023-07-19 18:12:13 UTC
I am currently showing rubygem-foreman_remote_execution-8.3.0-1.el8sat.noarch
Locale is EDT. I did try a variety of times to see if it was a time zone related issue.

Comment 4 Adam Ruzicka 2023-07-20 10:21:51 UTC
Still failing to reproduce it. Is the issue that the cron line gets generated incorrectly or that it gets generated correctly but then the times generated using it are off?

If you kick off a job to run on let's say Fridays, what do you see in the recurring logic tab in the job?

Comment 5 John 2023-07-20 19:22:22 UTC
After completing the wizard and selecting run, on the Overview tab it says the incorrect date. I selected Friday (7/21), at 12 noon (This should account for any timezone difference).
It displays "Scheduled to start at: 2023-07-22 12:00:00 -0400". 
When selecting the Recurring logic tab it displays:
Cron line:     00 12 * * 6
Next Occurence: 2023-07-22 12:00:00 -0400

I would be happy to share screenshots or do a remote session/gmeet to help verify. I continued to duplicate this issue on my Satellite as I was writing the reply.

Comment 6 Adam Ruzicka 2023-07-28 10:05:28 UTC
Steps to reproduce:
1) Set your timezone to America/New_York for your browser. Setting it for your user inside Satellite seems to make no difference. Easiest way to achieve this is to start your browser like TZ=America/New_York firefox (feel free to substitute firefox for any browser you use)
2) Go to schedule a weekly recurring job

Actual results:
The days of week start with a Saturday, the started job is one day off

Expected results:
The days of week either start with a Sunday, but if they don't, it should be accounted for.

Comment 7 Adam Ruzicka 2023-07-28 10:43:50 UTC
Created redmine issue https://projects.theforeman.org/issues/36618 from this bug

Comment 8 Bryan Kearney 2023-08-01 12:03:11 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36618 has been resolved.

Comment 9 Peter Ondrejka 2023-08-09 12:10:36 UTC
Verified on Satellite 6.14 sn 10

Comment 12 errata-xmlrpc 2023-11-08 14:19:54 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 (Important: Satellite 6.14 security and bug fix update), 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-2023:6818