Alarm clear time incorrectly reported on non-UTC systems

Bug #1828448 reported by David Sullivan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Kristine Bujold

Bug Description

Brief Description
-----------------
The alarm clear timestamp in fm-event logs and snmp traps are incorrect for non UTC systems.

Severity
--------
Minor

Steps to Reproduce
------------------
Set system timezone to a one different from UTC
Create alarm event (File system threshold)
Clear alarm event
Observe the logs for event timestamp

Expected Behavior
------------------
The event log timestamp should be in UTC

Actual Behavior
----------------
The event log timestamp is not in UTC or local time

Reproducibility
---------------
Reproducible

System Configuration
--------------------
Any configuration

Branch/Pull Time/Commit
-----------------------
cengn 20190505T233000Z

Last Pass
---------
Not tested earlier.

Timestamp/Logs
--------------
2019-05-09T10:26:20.000 controller-0 fmManager: info { "event_log_id" : "700.217", "reason_text" : "Exited Multi-Node Recovery Mode", "entity_instance_id" : "subsystem=vim", "severity" : "critical", "state" : "msg", "timestamp" : "2019-05-09 15:26:20.038368" }
2019-05-09T10:26:39.000 controller-0 fmManager: info { "event_log_id" : "250.001", "reason_text" : "controller-0 Configuration is out-of-date.", "entity_instance_id" : "region=RegionOne.system=fa06f482-e1f7-4f5f-a880-b2b1034cb5fe.host=controller-0", "severity" : "major", "state" : "clear", "timestamp" : "2019-05-09 20:26:39.480140" }
The system is in EST (UTC-5). The timestamp on the second log should be in UTC, instead it is in UTC+5

Revision history for this message
Ghada Khalil (gkhalil) wrote :

Marking as release gating; this would cause confusion for operators using non-UTC timezone

Changed in starlingx:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → David Sullivan (dsullivanwr)
tags: added: stx.2.0 stx.fault
Revision history for this message
Kristine Bujold (kbujold) wrote :

Another issue related to the same bug can be reproduce with this scenario

-Set the system timezone to something other than UTC
-Launch an instance
-Pause the instance
-The alarm timestamp in CLI and Horizon does not match the system's timezone timestamp. Also the timestamp in the DB, which should be in UTC, is also wrong.

Changed in starlingx:
assignee: David Sullivan (dsullivanwr) → Kristine Bujold (kbujold)
Changed in starlingx:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fault (master)

Fix proposed to branch: master
Review: https://review.opendev.org/662477

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fault (master)

Reviewed: https://review.opendev.org/662477
Committed: https://git.openstack.org/cgit/starlingx/fault/commit/?id=e5803f2a5d3e9567f830b75c711d7d5f0dde629b
Submitter: Zuul
Branch: master

commit e5803f2a5d3e9567f830b75c711d7d5f0dde629b
Author: Kristine Bujold <email address hidden>
Date: Fri May 31 10:11:06 2019 -0400

    Fix alarms issues on non-UTC systems

    This fixes two issues
    -Alarm clear time incorrectly reported on non-UTC systems.
    -Paused instances do not display the correct alarm timestamp in
    non-UTC systems.

    The mktime call that's made in fm_db_util_get_timestamp uses the local
    tz in it's calculation. It assumes the incoming time is also in the
    local time. When mktime is provided with a value in UTC we see the error
    presented in this bug.

    Change-Id: Iaf8d097e2dfdfae585b6976e02a85b9e2f1b19f9
    Closes-Bug: 1828448
    Signed-off-by: Kristine Bujold <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.