pm-utils uses wrong interface for NetworkManager hook (should be org.freedesktop.NetworkManager.Sleep)

Bug #1007924 reported by Daniel Hahler
70
This bug affects 15 people
Affects Status Importance Assigned to Milestone
pm-utils
Won't Fix
Medium
pm-utils (Debian)
Confirmed
Unknown
pm-utils (Ubuntu)
Triaged
Medium
Unassigned
Nominated for Precise by Daniel Hahler

Bug Description

While looking at /var/log/pm-suspend.log I have noticed that the NetworkManager hooks fail:

 Running hook /usr/lib/pm-utils/sleep.d/55NetworkManager suspend suspend_hybrid:
 Having NetworkManager put all interaces to sleep...Failed.

 Running hook /usr/lib/pm-utils/sleep.d/55NetworkManager resume suspend_hybrid:
 Having NetworkManager wake interfaces back up...Failed.

Looking at the script is uses org.freedesktop.NetworkManager.sleep and org.freedesktop.NetworkManager.wake.

Calling this results in errors like this:
 % sudo dbus-send --print-reply --system --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.sleep
 Error org.freedesktop.DBus.Error.UnknownMethod: Method "sleep" with signature "" on interface "org.freedesktop.NetworkManager" doesn't exist

According to the documentation [1], the interface is different / has changed.

The correct usage would be to call org.freedesktop.NetworkManager.Sleep with a boolean value, like:

 sudo dbus-send --print-reply --system --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.Sleep boolean:true

1: http://projects.gnome.org/NetworkManager/developers/api/09/spec.htmlorg.freedesktop.NetworkManager.Sleep

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: pm-utils 1.4.1-9
ProcVersionSignature: Ubuntu 3.2.0-25.40-generic 3.2.18
Uname: Linux 3.2.0-25-generic x86_64
ApportVersion: 2.0.1-0ubuntu8
Architecture: amd64
Date: Sat Jun 2 21:36:40 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
PackageArchitecture: all
SourcePackage: pm-utils
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
In , Jklimes (jklimes) wrote :

Created attachment 39281
add '--print-reply' and use Sleep() method

The patch adds '--print-reply' to 55NetworkManager hook. This works around a bug that D-Bus loses messages for short-lived processes.
In reality this means that without '--print-reply' the message is not delivered to NetworkManager and it's not woken up on resume.
You can see these bugs for reference:
https://bugs.freedesktop.org/show_bug.cgi?id=896 (the core D-Bus bug)
https://bugzilla.redhat.com/show_bug.cgi?id=477964

Moreover the patch uses Sleep() method instead of deprecated sleep() and wake()
http://projects.gnome.org/NetworkManager/developers/spec-08.html

Revision history for this message
In , Michael Wild (themiwi) wrote :

pm/sleep.d/55NetworkManager calls the org.freedesktop.NetworkManager.sleep and org.freedesktop.NetworkManager.wake methods. However, since NetworkManager version 7 they don't exist any more, and have been replaced by org.freedesktop.NetworkManager.Sleep which takes a boolean argument.

Revision history for this message
In , Michael Wild (themiwi) wrote :

Created attachment 53060
Patch fixing the NetworkManager DBus calls

Revision history for this message
In , Bin Li (binli) wrote :

Victor,

 I've also met this issue in openSUSE, could you let it in upstream. Thanks!

Revision history for this message
In , Bin Li (binli) wrote :

Looks same with 30701.

*** This bug has been marked as a duplicate of bug 30701 ***

Revision history for this message
In , Bin Li (binli) wrote :

*** Bug 42500 has been marked as a duplicate of this bug. ***

Revision history for this message
Daniel Hahler (blueyed) wrote :
Revision history for this message
In , Freedesktop-bugs-thequod (freedesktop-bugs-thequod) wrote :

This is not a duplicate of bug 30701 - un-duplicating.

JFI: the bug is reported in Launchpad at: https://launchpad.net/bugs/1007924

Changed in pm-utils (Debian):
status: Unknown → Confirmed
Revision history for this message
In , Freedesktop-bugs-thequod (freedesktop-bugs-thequod) wrote :

Ok, looking at the patch for the other bug, it would fix this issue, too.

So much for fixing multiple issues with a single patch..

*** This bug has been marked as a duplicate of bug 30701 ***

Revision history for this message
In , Freedesktop-bugs-thequod (freedesktop-bugs-thequod) wrote :

*** Bug 42500 has been marked as a duplicate of this bug. ***

Changed in pm-utils:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Freedesktop-bugs-thequod (freedesktop-bugs-thequod) wrote :

The patch fixes two issues with the NetworkManager hook, whereas the interface is by now not only deprecated, but not available any more.
This is a currently unfixed issue in Debian/Ubuntu.

I am setting the bug status to NEW, in case the bug is just not being handled because of its NEEDINFO state.

Daniel Hahler (blueyed)
Changed in pm-utils (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
In , Jklimes (jklimes) wrote :

(In reply to comment #4)
> The patch fixes two issues with the NetworkManager hook, whereas the interface
> is by now not only deprecated, but not available any more.
> This is a currently unfixed issue in Debian/Ubuntu.

What interface do you mean, whole pm-utils?
Then yes, there are other ways how to handle sleep/resume now, e.g. UPower daemon.
NetworkManager listen to UPower's Sleeping and Resuming D-Bus signals too. So, the patch for pm-utils is not vital for NM. But still it would be nice to fix the script as it is broken, and some can use it.

http://projects.gnome.org/NetworkManager/developers/api/09/spec.html#org.freedesktop.NetworkManager

Changed in pm-utils:
status: Confirmed → Invalid
Daniel Hahler (blueyed)
Changed in pm-utils:
importance: Medium → Unknown
status: Invalid → Unknown
Revision history for this message
In , Freedesktop-bugs-thequod (freedesktop-bugs-thequod) wrote :

> What interface do you mean, whole pm-utils?

I am referring to the NetworkManager DBUS interface, where pm-utils uses a non-existent interface method: see bug 42500.

Revision history for this message
In , Jklimes (jklimes) wrote :

(In reply to comment #6)
> > What interface do you mean, whole pm-utils?
>
> I am referring to the NetworkManager DBUS interface, where pm-utils uses a
> non-existent interface method: see bug 42500.

But, the patch fixes that too - e.g. uses Sleep() instead of sleep() and wake() (it's written in the Description :).

Changed in pm-utils:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
Dirk Möbius (dmoebius-deactivatedaccount-deactivatedaccount) wrote :

I had exactly the same problem, and using the patch from https://bugs.freedesktop.org/show_bug.cgi?id=30701 (especially using the Sleep method) fixed it.

Revision history for this message
Dirk Möbius (dmoebius-deactivatedaccount-deactivatedaccount) wrote :

Btw. I suggest changing the subject of this bug to "NetworkManager doesn't re-enable network devices after suspend/resume" so that it is easier to find for other users.

Revision history for this message
In , David Edwards (purple52) wrote :

Would be great to get this fixed; the patch already attached still applies cleanly to git master and fixes the problem for me in Ubuntu. Without this, the network is lost on resume when using pm-utils.

Revision history for this message
In , J Hughes (jonnybignote) wrote :

Can someone tell me how to apply this patch - I have the log errors mentioned so I figured I'd try it to see if it fixed my crashing on suspend/resume. I can't get the patched code in without encountering a syntax error in the logs.

Thanks

Revision history for this message
Brian J. Murrell (brian-interlinx) wrote :

This problem exists in LTS 12.04. It causes machines coming back from resume to use illegal IP addresses since it uses the address that it had when it suspended and does not renew it on resume. This means if the lease expired while suspended, it is against network and security policies (of some/many corporate networks) to use it.

When will this problem be fixed?

Revision history for this message
In , Brian J. Murrell (brian-interlinx) wrote :

Can we get a comment from the maintainer whether this patch is or will (not) be applied and explanation as to why not if not?

This bug is percolating to many downstream consumers of this package. It's not really reasonable to ignore it here and expect them all to fix it themselves.

Revision history for this message
In , Catalin Patulea (cpatulea) wrote :

ping - are there any specific issues blocking merging this?

Revision history for this message
Andreas Mohr (andi) wrote :

Can we PLEASE get this resolved very soonish, in an important LTS version, of all things holy?

It took me ages (~1h) to figure out the exact reason for use of an illegal(!!) stale dhclient DHCP lease IP after suspend / resume / hibernate via Internet research (which keywords would YOU use to discover sufficiently relevant topics? they all seem to fail...),
and according to my log that is exactly the problem here on 12.04LTS:

(as currently executed by /usr/lib/pm-utils/sleep.d/55NetworkManager of pm-utils 1.4.1-9fix.ubuntu12.04)
# dbus-send --print-reply --system --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.sleep
Error org.freedesktop.DBus.Error.UnknownMethod: Method "sleep" with signature "" on interface "org.freedesktop.NetworkManager" doesn't exist

(corrected syntax as suggested by this report, working!)
# dbus-send --print-reply --system --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.Sleep boolean:true
method return sender=:1.5 -> dest=:1.972 reply_serial=2

# dbus-send --print-reply --system --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.Sleep boolean:false

This report of a CRUCIAL suspend/resume breakage bug (my usual keyword for such annoyingly frequent cases: "YASB") on a LONG-TERM-SUPPORT distro is now more than THREE years old (fdo report), with a confirmed working solution that is now 1.5 YEARS old. Please do (or communicate some suggestions) what is necessary to finally have this high-profile illegal-behaviour SHOW-STOPPER bug get resolved. Thank you. [I somehow hate having to spell things out that clearly, but... anyway, please accept my apologies]

Revision history for this message
Daniel Hahler (blueyed) wrote :

@Andreas Mohr:

1. I would suggest poking the upstream bug report (possibly e-mailing Victor Lowther (at gmail) directly, who did the latest commits for pm-utils, see "git log" of git://anongit.freedesktop.org/git/pm-utils).

2. Since there are no Ubuntu related changes, it makes sense to fix it in Debian (see the Debian bug report).

3. For updating released packages, e.g. for 12.04, see the procedure at https://wiki.ubuntu.com/StableReleaseUpdates .

Revision history for this message
Oliver R. (oliverr) wrote :

Has anyone tried to get the patch into an update for 12.04 in the past seven months?

Revision history for this message
In , Ajax-a (ajax-a) wrote :

pm-utils hasn't been touched in eight years, none of this is likely to get addressed. Closing bugs and disabling the bz product.

Changed in pm-utils:
status: Confirmed → Won't Fix
Changed in pm-utils (Debian):
status: Confirmed → Fix Released
Changed in pm-utils (Debian):
status: Fix Released → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.