FS#39876 - [upower] doesn't read battery information since update to 0.99.0-2

Attached to Project: Arch Linux
Opened by Eicke Herbertz (WolleTD) - Tuesday, 15 April 2014, 13:08 GMT
Last edited by Jan de Groot (JGC) - Monday, 21 April 2014, 08:42 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Jan de Groot (JGC)
Ionut Biru (wonder)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 15
Private No

Details

Description: upower -i /org/freedesktop/UPower/devices/battery_BAT0 doesn't show any battery information.
This results into cinnamon (and most likely other DEs too) not showing battery info.

Output:

[wolle ~]$ sudo upower -i /org/freedesktop/UPower/devices/battery_BATO
native-path: (null)
power supply: no
updated: Do 01 Jan 1970 01:00:00 CET (1397561195 seconds ago)
has history: no
has statistics: no
unknown
warning-level: unknown
icon-name: '(null)'

Version 0.99.0-1 works.

Additional info:
* upower 0.99.0-2

Steps to reproduce:
Install upower 0.99.0-2 and issue "upower -i /org/freedesktop/UPower/devices/battery_BAT0" when a battery is present in system.
This task depends upon

Closed by  Jan de Groot (JGC)
Monday, 21 April 2014, 08:42 GMT
Reason for closing:  Not a bug
Comment by Claire Farron (clfarron4) - Tuesday, 15 April 2014, 14:06 GMT
I have one observation:

Running MATE, I have this problem until I go to see the "Power Statistics", at which point the command runs fine and my battery is being watched fine.
Comment by Eicke Herbertz (WolleTD) - Tuesday, 15 April 2014, 14:10 GMT
I just discovered that version 0.99.0-1 doesn't work either. When I try to issue the command stated above, I get some other errors:

upower -i /org/freedesktop/UPower/devices/battery_BAT0

(upower:2672): libupower-glib-WARNING **: Couldn't connect to proxy: Fehler beim Aufruf von StartServiceByName für org.freedesktop.UPower: GDBus.Error:org.freedesktop.DBus.Error.TimedOut: Activation of org.freedesktop.UPower timed out
failed to set path: Fehler beim Aufruf von StartServiceByName für org.freedesktop.UPower: GDBus.Error:org.freedesktop.DBus.Error.TimedOut: Activation of org.freedesktop.UPower timed out
Comment by Eicke Herbertz (WolleTD) - Tuesday, 15 April 2014, 14:24 GMT
Okay, now things got weird.
Chronological list of things I did:

1. Discovered that my battery icon in the cinnamon taskbar is missing
2. Discovered that upower 0.99.0-2 doesn't show any information
3. Downgraded to upower 0.99.0-1 and tried again. Got the desired information
4. Reboot in hope of battery icon being in the taskbar again
5. No battery icon, tried issuing upower (0.99.0-1) and got the above error
6. Upgraded to upower 0.99.0-2 again, still the same error
7. Reboot again, just to see what will happen
8. upower 0.99.0-2 working without any problems
9. Still no battery icon
10. Power management in cinnamon settings isn't working.

Python module
Could not find bluetooth module; is the cinnamon-control-center package installed?
Could not find wacom module; is the cinnamon-control-center package installed?
Loading Power module
/usr/bin/python2: symbol lookup error: /usr/lib/cinnamon-control-center-1/panels/libpower.so: undefined symbol: up_client_get_can_hibernate

I think there is a huge mess in the repos.
Comment by sb56637 (sb56637) - Thursday, 17 April 2014, 14:36 GMT
This must be related to some other package that upower depends on, because I downgraded upower to 0.9.23-2, which used to work fine, but now it doesn't work either.
Comment by Rino Del Campo (ismo) - Friday, 18 April 2014, 07:50 GMT
I have notice that battery-applet icon fails to appear on first boot of laptop. It only appears if I send my laptop to suspend or hibernate status and then resume it. But after this, the applet is not responsive to power-status change; I need do restart Cinnamon to reload applet at the right status. For example, I can't view the percentage go down when the battery is discharging.
Looking glass error logs show the applet being loaded into the systray and nothing more.
Comment by Eicke Herbertz (WolleTD) - Friday, 18 April 2014, 08:01 GMT
Confirming exactly what Rino said.
Comment by Jan de Groot (JGC) - Friday, 18 April 2014, 08:37 GMT
This is not an upower bug, but change in API.
Applications that don't update are listening to the wrong signals, upower no longer emits DeviceChanged and Changed signals, but uses PropertyChanged signals now.
Applications with symbol lookup errors are linking to the old glib bindings (up_client_get_can_hibernate has been removed, in 0.9 that function is a dummy and if you get that message with 0.99 it's your own fault because you are symlinking sobumped libraries).

Further, if you have a 0.9 daemon running and you try to connect to that with 0.99 client, it will fail. The other way around is probably also the case. Be sure the old running daemon is killed after upgrading/downgrading upower versions.
Comment by sb56637 (sb56637) - Friday, 18 April 2014, 14:03 GMT
But if this is all due to changes in the upower package, I don't understand why upower still doesn't work after downgrading it to 0.9.23-2. My Cinnamon desktop power manager no longer works with 0.99.0-2 or with 0.9.23-2, and not even "upower -i /org/freedesktop/UPower/devices/battery_BAT0" works with either of the two upower version.
Comment by João Felipe Santos (jfsantos) - Friday, 18 April 2014, 15:37 GMT
upower 1.0 has breaking changes in its API. If Cinnamon was updated to handle the new API, it probably won't work with the old one unless they added a workaround to detect upower's version (and it seems they didn't).

These are some upstream bug reports related to the power applet and suspending with Cinnamon. The first one mentions upower API changes.

https://github.com/linuxmint/Cinnamon/issues/2913
https://github.com/linuxmint/Cinnamon/issues/3068
https://github.com/linuxmint/Cinnamon/issues/3054
Comment by sb56637 (sb56637) - Friday, 18 April 2014, 15:48 GMT
@jfsantos: Hmm, I see. But then why doesn't the "upower -i /org/freedesktop/UPower/devices/battery_BAT0" command work at least?
Comment by Rino Del Campo (ismo) - Saturday, 19 April 2014, 10:07 GMT
@sb56637 I have no problem with the command "upower -i /org/freedesktop/UPower/devices/battery_BAT0", it works. The only problem is with cinnamon-power-manager.
Comment by João Felipe Santos (jfsantos) - Saturday, 19 April 2014, 13:04 GMT
@sb56637 Just to complement @ismo's message, in my case the correct command is "upower -i /org/freedesktop/UPower/devices/battery_BAT1" (and not BAT0) for some reason.
Comment by sb56637 (sb56637) - Saturday, 19 April 2014, 15:38 GMT
Huh, strange, I must have typed the device interface wrong before or an update must have fixed it, because the command (with BAT0) works now. Thanks for the tips.
Comment by FiX (fix) - Sunday, 20 April 2014, 08:13 GMT
upower command isn't working for me with BAT0 or BAT1:
$ LANG=C upower -i /org/freedesktop/UPower/devices/battery_BAT0
native-path: (null)
power supply: no
updated: ?? 01 ??? 1970 03:00:00 (1397981426 seconds ago)
has history: no
has statistics: no
unknown
warning-level: unknown
icon-name: '(null)'

With BAT1 output is the same.

acpi output:
$ acpi --battery --details
Battery 0: Unknown, 0%
Battery 0: design capacity 2500 mAh, last full capacity 1726 mAh = 69%
Battery 1: Charging, 13%, 01:27:46 until charged
Battery 1: design capacity 6200 mAh, last full capacity 4483 mAh = 72%
Comment by Jan de Groot (JGC) - Monday, 21 April 2014, 08:42 GMT
Running upower -i on a non-existing device will print null output. Use upower -e to enumerate devices, those can be used to get information from with upower -i.

As this bugreport is about upower not reading battery information, which it does, I'm closing this bug. This is not an upower bug.

Loading...