Alarm snapshot: last-transition time appears 5 h off from AVEVA history; possibly stale active state #226

Closed
opened 2026-11-11 12:18:56 -05:00 by dohertj2 · 2 comments
Owner

Observed from OtOpcUa (lmxopcua#614 H6 investigation, read-only) on 2026-11-11 against the DEV gateway on wonder-app-vd03:5120. Not yet confirmed.

Observation 1: timestamps are 5 hours off. For alarm Galaxy!CVDAisle_1.TableAlarms_008.RuntimeAlert, QueryActiveAlarms reports the last transition as 2026-07-29T01:02:46.830Z. AVEVA alarm history (Runtime.dbo.v_AlarmEventHistory2 on wonder-sql-vd03) has the same transition, with identical milliseconds, at 2026-07-28 20:02:46.830 in its UTC column. That looks like a local-time value (EDT is UTC−4, EST UTC−5) being converted to UTC twice, or labelled as UTC when it isn't. Please check the time-zone handling in the alarm snapshot.

Observation 2: possible stale active state. The gateway still reports that alarm as active and unacknowledged. History shows five later 'set off scan' return-to-normal rows, the last on 2026-10-22, with no new alarm row after them.

Both may affect ScadaBridge and OtOpcUa alarm timestamps and states.

Observed from OtOpcUa (lmxopcua#614 H6 investigation, read-only) on 2026-11-11 against the DEV gateway on wonder-app-vd03:5120. Not yet confirmed. **Observation 1: timestamps are 5 hours off.** For alarm `Galaxy!CVDAisle_1.TableAlarms_008.RuntimeAlert`, `QueryActiveAlarms` reports the last transition as `2026-07-29T01:02:46.830Z`. AVEVA alarm history (`Runtime.dbo.v_AlarmEventHistory2` on wonder-sql-vd03) has the same transition, with identical milliseconds, at `2026-07-28 20:02:46.830` in its UTC column. That looks like a local-time value (EDT is UTC−4, EST UTC−5) being converted to UTC twice, or labelled as UTC when it isn't. Please check the time-zone handling in the alarm snapshot. **Observation 2: possible stale active state.** The gateway still reports that alarm as active and unacknowledged. History shows five later 'set off scan' return-to-normal rows, the last on 2026-10-22, with no new alarm row after them. Both may affect ScadaBridge and OtOpcUa alarm timestamps and states.
Author
Owner

Related, from the same DEV gateway: an alarm ack of CVDAisle_1.TableAlarms_008.RuntimeAlert by an NAM account at 2026-11-11T17:37:55Z returned OK, but .Acked stayed False and AVEVA history has no ACK row. OtOpcUa's side (treating an unconfirmed OK as success) is lmxopcua#869. Please check the gateway log around that time for why the ack didn't apply.

Related, from the same DEV gateway: an alarm ack of `CVDAisle_1.TableAlarms_008.RuntimeAlert` by an NAM account at 2026-11-11T17:37:55Z returned OK, but `.Acked` stayed False and AVEVA history has no ACK row. OtOpcUa's side (treating an unconfirmed OK as success) is lmxopcua#869. Please check the gateway log around that time for why the ack didn't apply.
Author
Owner

Fixed on main 892bdc1a.

Obs 1 (timestamps late) — gateway bug, confirmed. AlarmRecordTransitionMapper.ParseTransitionTimestampUtc treated wnwrap DATE+TIME as producer-local and added GMTOFFSET−DSTADJUST; DATE+TIME are already UTC. Evidence: (a) Runtime.dbo.Events on wonder-sql-vd03 has this raise at EventTimeUtc 2026-07-28 20:02:46.830 with EventTimeUTCOffsetMins −300 (this one record carries 300; siblings carry 240) → +300 min = exactly the 01:02:46.830Z the gateway reported; (b) the 2026-05-01 probe capture TIME 13:26 was committed at 09:44 EDT that morning, so it can only be UTC. Fix drops the offset application; tests updated + #226 regression; worker tests 767/0 on windev (x86), gateway tests 1440/0; mutation (re-adding +240) fails 8 tests.

Behaviour change for consumers on next deploy: all wnwrap alarm times move 4–5 h earlier (to correct UTC). OtOpcUa/ScadaBridge dedup keyed on raise time will see existing alarms once with the new time.

Obs 2 (still active+unacked) — not a gateway bug (likely). Gateway passes through wnwrap STATE and its reconcile drops cleared alarms. AVEVA history shows instance 0089005B cleared by 'set off scan' on 8/27, 10/5, 10/13, 10/22 with no new raise row each time, i.e. AVEVA silently re-arms the same instance on return to scan (last ~10:59 10/22). The 7/28 last-transition is the time on wnwrap's record.

Live check after the next DEV worker deploy: QueryActiveAlarms for Galaxy!CVDAisle_1.TableAlarms_008.RuntimeAlert should read 2026-07-28T20:02:46.830Z, and a fresh alarm's time should equal Events.EventTimeUtc. Closing; reopen if that check fails.

Fixed on main 892bdc1a. **Obs 1 (timestamps late) — gateway bug, confirmed.** AlarmRecordTransitionMapper.ParseTransitionTimestampUtc treated wnwrap DATE+TIME as producer-local and added GMTOFFSET−DSTADJUST; DATE+TIME are already UTC. Evidence: (a) Runtime.dbo.Events on wonder-sql-vd03 has this raise at EventTimeUtc 2026-07-28 20:02:46.830 with EventTimeUTCOffsetMins −300 (this one record carries 300; siblings carry 240) → +300 min = exactly the 01:02:46.830Z the gateway reported; (b) the 2026-05-01 probe capture TIME 13:26 was committed at 09:44 EDT that morning, so it can only be UTC. Fix drops the offset application; tests updated + #226 regression; worker tests 767/0 on windev (x86), gateway tests 1440/0; mutation (re-adding +240) fails 8 tests. **Behaviour change for consumers on next deploy:** all wnwrap alarm times move 4–5 h earlier (to correct UTC). OtOpcUa/ScadaBridge dedup keyed on raise time will see existing alarms once with the new time. **Obs 2 (still active+unacked) — not a gateway bug (likely).** Gateway passes through wnwrap STATE and its reconcile drops cleared alarms. AVEVA history shows instance 0089005B cleared by 'set off scan' on 8/27, 10/5, 10/13, 10/22 with no new raise row each time, i.e. AVEVA silently re-arms the same instance on return to scan (last ~10:59 10/22). The 7/28 last-transition is the time on wnwrap's record. Live check after the next DEV worker deploy: QueryActiveAlarms for Galaxy!CVDAisle_1.TableAlarms_008.RuntimeAlert should read 2026-07-28T20:02:46.830Z, and a fresh alarm's time should equal Events.EventTimeUtc. Closing; reopen if that check fails.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/mxaccessgw#226