#9121·osquery

`battery` table breaks on macOS 27 Golden Gate

Author: harrisonravazzoloCreated Sep 30, 2026Updated Sep 30, 2026

Bug report

What operating system and version are you using?

macOS 27.2 (build 26B5091g)

What version of osquery are you using?

5.23.1 (deployed via Fleet; also reproduced running osqueryi locally)

What steps did you take to reproduce the issue?

On a MacBook running macOS 27.2, run:

sql
   SELECT * FROM battery;

Several columns come back empty: designed_capacity, max_capacity, current_capacity, health.

What did you expect to see?

All columns filled in, as they are on macOS 26 and earlier.

What did you see instead?

The columns above are NULL/empty.

Additional context

It looks like macOS 27 moved the AppleSmartBattery properties that the table reads. In osquery/tables/system/darwin/battery.mm, genAdvancedBatteryInfo reads DesignCapacity, AppleRawMaxCapacity and AppleRawCurrentCapacity from the top level of the AppleSmartBattery registry entry. On 27.2 those keys aren't at the top level any more.

ioreg -l -w0 -r -c AppleSmartBattery on 27.2 shows:

"BatteryData" = {"CurrentCapacity"=82,"AppleRawMaxCapacity"=5122,"AppleRawCurrentCapacity"=4003,"AbsoluteCapacity"=0,"AvgTimeToEmpty"=298,"DesignCapacity"=6075,"NominalChargeCapacity"=5272,"FullChargeCapacity"=5122,"MaxCapacity"=100,"FullyCharged"=0,"RemainingCapacity"=4003,"BatteryPower"=18446744073709540027,"TrueRemainingCapacity"=0}

health normally comes from IOPSCopyPowerSourcesInfo I think? (kIOPSBatteryHealthKey), so it being blank suggests the power sources dictionary changed too.