I have an Intel NUC running Ubuntu 21.10 server. When testing my unattended-upgrades setup (via sudo unattended-upgrades --dry-run --debug
) I am receiving the following error:
System is on battery power, stopping
The NUC doesn't have a battery so there appears to be a system configuration error. After repeated searches I haven't found any reports of similar problems. Does anyone have an idea of what the issue is and how to fix it?
EDIT: Here is the output of the on_ac_power
script referenced below. I was unable to determine what is causing it to return false when the NUC is certainly on AC power:
deploy@deploy-nuc:~▶ ./on_ac_power.sh
+ OFF_LINE_P=no
+ [ -d /sys/class/power_supply/ ]
+ test -d /sys/class/power_supply/ucsi-source-psy-USBC000:001
+ test -r /sys/class/power_supply/ucsi-source-psy-USBC000:001/type
+ cat /sys/class/power_supply/ucsi-source-psy-USBC000:001/type
+ type=USB
+ [ -r /sys/class/power_supply/ucsi-source-psy-USBC000:001/online ]
+ cat /sys/class/power_supply/ucsi-source-psy-USBC000:001/online
+ online=0
+ [ 0 = 1 ]
+ [ 0 = 0 ]
+ OFF_LINE_P=yes
+ test -d /sys/class/power_supply/ucsi-source-psy-USBC000:002
+ test -r /sys/class/power_supply/ucsi-source-psy-USBC000:002/type
+ cat /sys/class/power_supply/ucsi-source-psy-USBC000:002/type
+ type=USB
+ [ -r /sys/class/power_supply/ucsi-source-psy-USBC000:002/online ]
+ cat /sys/class/power_supply/ucsi-source-psy-USBC000:002/online
+ online=0
+ [ 0 = 1 ]
+ [ 0 = 0 ]
+ OFF_LINE_P=yes
+ [ yes = yes ]
+ exit 1