Hammer timestamps are blindly treated in UTC and does not honour user or system timezone.

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.

Issue

  • After creating a sync-plan with "hammer sync-plan create" command, it is set in the UTC timezone, regardless what timezone the specified user has.

  • When a job invocation via hammer to be started at a given time, the time is again interpreted in UTC regardless of any locale.

  • WebUI does not respect the user's or brower's timezone well.

Resolution

  • This bug was fixed in Satellite 6.15.
    This content is not included.bugzilla 2015344
    RHSA-2024:2010

  • As a workaround, specify also timezone after the timestamp, like:

    hammer> sync-plan create --name hammer_syncplan2 --organization-id 1 --sync-date "2022-09-25T14:30:00 CEST" --enabled=true --interval daily
    hammer> job-invocation create --job-template 'Run Command - SSH Default' --inputs command=date --search-query="*" --dynamic --start-at "2022-09-25T11:40:00 CDT"
    

For more KB articles/solutions related to Red Hat Satellite 6.x Satellite Tasking System Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Satellite Tasking System Issues

Root Cause

  • It appears that the timestamp value of --sync-date or --start-at is parsed as UTC+0.

Diagnostic Steps

# hammer user info --id 6
ID:                    6
Login:                 admin
Name:                    Admin User
Email:                 root@localhost
Admin:                 yes
Disabled:              no
Last login:            2021/10/19 08:21:15
Authorized by:         Internal
Effective admin:       yes
Locale:                en
Timezone:              Tokyo                <<<<==
Default organization:  
Default location:      
Roles:                 

User groups:           

Inherited User groups: 

Created at:            2021/05/21 13:46:01
Updated at:            2021/10/15 16:50:16
# hammer -u admin -p *** sync-plan create --organization-id 1 --name plan-cli-3 --sync-date "2021-10-19 10:00:00" --interval daily --enabled yes
Sync plan created.
# hammer sync-plan info  --organization-id 1 --id  6
ID:                 6
Start Date:         2021/10/19 19:00:00            <<<<==
Interval:           daily
Enabled:            yes
Cron Expression:    
Recurring Logic ID: 21                
Created at:         2021/10/19 08:24:23
Updated at:         2021/10/19 08:24:23
Next Sync:          2021/10/19 19:00:00
Products:

and for the same user:

hammer> job-invocation create --job-template 'Run Command - SSH Default' --inputs command=date --search-query="*" --dynamic --start-at "2022-09-25T11:40:00"
Job invocation 2 created
hammer> job-invocation show --id 2
---
ID: 2
Description: Run date
Status: succeeded
Success: 1
Failed: 0
Pending: 0
Missing: 0
Total: 1
Start: 2022-09-25 11:40:00 UTC
Randomized ordering: false
Job Category: Commands
Mode: future
Hosts:
- ..
hammer> 
SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.