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.

Bug 2015344

Summary: When you create a sync-plan with "hammer sync-plan create" command, it is set in a time zone different from the time zone specified by the server or user.
Product: Red Hat Satellite Reporter: shimura <mshimura>
Component: HammerAssignee: Adam Ruzicka <aruzicka>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.9.0CC: akapse, apatel, arahaman, aruzicka, jalviso, kgaikwad, mjia, ofedoren, pmoravec, sajha
Target Milestone: 6.15.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: hammer-cli-3.7.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-04-23 17:10: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:

Comment 2 Pavel Moravec 2022-09-25 12:16:54 UTC
The same applies also to job invocation:

# timedatectl | grep zone
                Time zone: Europe/Vienna (CEST, +0200)
# 

# hammer job-invocation create --job-template 'Run Command - SSH Default' --inputs command=date --search-query="*" --start-at "2022-09-25T14:00:00"
Job invocation 3 created
#

it logs to production.log:

2022-09-25T13:47:34 [I|app|6100bdfd] Processing by Api::V2::JobInvocationsController#create as JSON
2022-09-25T13:47:34 [I|app|6100bdfd]   Parameters: {"job_invocation"=>{"job_template_id"=>166, "inputs"=>{"command"=>"date"}, "ssh"=>{}, "recurrence"=>{}, "scheduling"=>{"start_at"=>"2022-09-25T14:00:00+00:00"}, "concurrency_control"=>{}, "search_query"=>"*", "ansible"=>{}, "targeting_type"=>"static_query"}, "apiv"=>"v2"}
2022-09-25T13:47:34 [I|app|6100bdfd] Authorized user admin(Admin User)
..

to create job invocation at 14:00 UTC (not CEST=UTC+2)

While doing the same in WebUI:

2022-09-25T13:49:47 [I|app|4f40c367] Processing by JobInvocationsController#create as HTML
2022-09-25T13:49:47 [I|app|4f40c367]   Parameters: {.., "triggering"=>{"mode"=>"future", "start_at_raw"=>"2022-09-25 14:00", ..}, "commit"=>"Submit"}
(no "authorized user", as authenticity_token bearers admin

to create job invocation at 14:00 CEST.


So, foreman gets (almost) the same input (wrt timestamp) for the same user, and once it interprets it in UTC and once in local timezone? Strange..

But adding timezone to the hammer command, like:

hammer sync-plan create --name hammer_syncplan2 --organization-id 1 --sync-date "2022-09-25T14:30:00 CEST" --enabled=true --interval daily

then the sync plan is scheduled for 14:30 CEST, not UTC. So this is kind of workaround.

Comment 5 Adam Ruzicka 2023-05-22 07:53:33 UTC
This looks like it has the same root cause as https://bugzilla.redhat.com/show_bug.cgi?id=2135722 , keeping this one around as well for verification.

Comment 7 Peter Ondrejka 2024-01-16 11:12:39 UTC
Verified on Satellite 6.15 sn 6, syncplan is now created using the timezone of the user

Comment 11 errata-xmlrpc 2024-04-23 17:10: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.15.0 release), 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-2024:2010