system.info: boottime timestamp wrong

Description

When running the "system.info" API call to the middleware, the timestamps within the return are not self-consistent:

The "boottime" timestamp appears to be consistently about 7h off from the "uptime" or "uptime_seconds" fields if you calculate the datetime - boottime difference.

{
"version": "TrueNAS-12.0-U3.1",
"buildtime": {"$date": 1620062467000},
"hostname": "hydra003.ds.ixsystems.net",
"physmem": 4238970880,
"model": "Intel(R) Atom(TM) CPU C2750 @ 2.40GHz",
"cores": 2,
"loadavg": [0.39111328125, 0.53125, 0.40869140625],
"uptime": "6:10AM up 10 mins, 1 user",
"uptime_seconds": 595.2389583587646,
"system_serial": "30e321b4-0032-840b-ca5f-feba7858b216",
"system_product": "HVM domU",
"system_product_version": "4.13",
"license": null,
"boottime": {"$date": 1621922438000},
"datetime": {"$date": 1621948233480},
"birthday": {"$date": 1620249124772},
"timezone": "America/Los_Angeles",
"system_manufacturer": "Xen",
"ecc_memory": true
}

datetime - boottime ~= 25795s (7.16h), not the 595s listed in the "uptime_seconds" field.

Problem/Justification

None

Impact

None

SmartDraw Connector

Katalon Manual Tests (BETA)

Activity

Show:

William Gryzbowski 
May 27, 2021 at 6:39 PM

12.0 PR will be merged later

Bug Clerk 
May 25, 2021 at 7:00 PM

Bug Clerk 
May 25, 2021 at 5:40 PM

Ken Moore 
May 25, 2021 at 2:35 PM

I just pushed a fix to TC to calculate the boottime based on the (datetime - uptime_seconds) returns from this API instead of using the provided boottime.

That might be a really easy fix for you guys too - if you are already getting a reliable and accurate measure of uptime, just calculate the boottime instead of having to worry about realtime/UTC issues with the BIOS timestamps (your datetime system already accounts for the BIOS timestamp format if NTP is not enabled I would assume).

Ken Moore 
May 25, 2021 at 1:59 PM

I have run this API several times - the last one there was 10 minutes after boot - plenty of time for NTP to sync post-boot first.

The errors are very consistent, and 7h is the right offset if the BIOS was reporting the boottime in localtime (UTC -7 in this case) but the middleware was assuming it was reporting in UTC. My hunch is that there is a just a localtime/UTC conversion error in the middleware someplace.

Complete

Details

Assignee

Reporter

Components

Affects versions

Priority

More fields

Katalon Platform

Created May 25, 2021 at 1:35 PM
Updated July 6, 2022 at 9:00 PM
Resolved May 27, 2021 at 6:39 PM