Bug 1382526

Summary: Wifi connection not brought up when system suspended on AC, resumed on battery
Product: [Fedora] Fedora Reporter: Adam Williamson <awilliam>
Component: NetworkManagerAssignee: Beniamino Galvani <bgalvani>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 24CC: awilliam, bgalvani, dcbw, fgiudici, iheim, lkundrak, psimerda, thaller
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: NetworkManager-1.2.6-1.fc24 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-20 18:18:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
journal extract covering the whole sequence
none
[PATCH] manager: fix state transition on resuming from sleep none

Description Adam Williamson 2016-10-06 23:17:49 UTC
I've noticed this multiple times over the last few weeks on my F24 laptop, with all current updates each time it's happened.

I do this quite often: suspend the laptop (by closing the lid) while it's on AC power, then unplug it - with the lid still closed - take it somewhere else, and open the lid to resume it.

When I do that, consistently, the wifi connection does not come back up. I have to close the lid again, wait for the system to suspend (which takes longer than usual, at this point), then open the lid once more to bring the wifi connection up.

I'll attach logs covering the whole sequence.

Comment 1 Adam Williamson 2016-10-06 23:20:15 UTC
Created attachment 1208057 [details]
journal extract covering the whole sequence

This journal extract runs from the initial suspend (with the system on AC), through the resume on battery where wifi doesn't appear, suspending again on battery, and resuming again on battery, up until the connection comes up properly after the second resume.

Comment 2 Thomas Haller 2016-10-07 12:27:54 UTC
any chance to gather a debug-logfile of NetworkManager?

configure /etc/NetworkManager/NetworkManager.conf with

  [logging]
  level=TRACE

restart NM, and reproduce.

Comment 3 Adam Williamson 2016-11-16 08:56:28 UTC
sorry I didn't get the info for this yet, it's on my todo list. It's actually not quite as deterministic as the original report says, but does happen frequently.

Comment 4 Beniamino Galvani 2016-11-16 12:43:00 UTC
Created attachment 1221132 [details]
[PATCH] manager: fix state transition on resuming from sleep

I think I found the issue and the attached patch should solve it.

Comment 5 Thomas Haller 2016-11-16 13:21:17 UTC
lgtm

Comment 6 Beniamino Galvani 2016-11-16 13:28:41 UTC
Scratch build:

http://koji.fedoraproject.org/koji/taskinfo?taskID=16474353

Comment 7 Francesco Giudici 2016-11-16 13:44:50 UTC
lgtm

Comment 8 Adam Williamson 2016-11-16 15:31:09 UTC
Sounds very plausible - I'll try it out. Thanks! This may also be the reason why sometimes my desktop loses its DNS config shortly after resuming, too?

Comment 9 Beniamino Galvani 2016-11-16 15:44:28 UTC
(In reply to Adam Williamson from comment #8)
> Sounds very plausible - I'll try it out. Thanks! This may also be the reason
> why sometimes my desktop loses its DNS config shortly after resuming, too?

It's hard to say without further information.

Do you have configured dns=dnsmasq in NM.conf? If so, maybe it's related to bug 1373485.

If not, does resolv.conf have the right name servers? Debug logs would be very helpful to understand the issue.

But I tend to think the DNS issue is not related to this one.

Comment 10 Adam Williamson 2016-11-16 15:47:41 UTC
Yeah, I'm using dnsmasq, but it's not quite the same symptom: the connection works for some seconds after resume, then suddenly stops resolving names, and /etc/resolv.conf is *empty*. I'll file a new bug for that if it doesn't go away.

Comment 11 Adam Williamson 2016-11-16 21:04:27 UTC
I've since upgraded the affected system to F25, so I did my own scratch build:

http://koji.fedoraproject.org/koji/taskinfo?taskID=16478583

I've installed that and I'll keep an eye out to see if the bug goes away.

Comment 12 Adam Williamson 2016-11-16 23:58:07 UTC
I tried a few suspend/resume cycles and it didn't happen, so looking good, but I'll keep an eye on it for a few days.

Comment 13 Beniamino Galvani 2016-11-29 16:41:52 UTC
(In reply to Adam Williamson from comment #12)
> I tried a few suspend/resume cycles and it didn't happen, so looking good,
> but I'll keep an eye on it for a few days.

Hi, did the issue happen again?

Comment 14 Adam Williamson 2016-11-29 16:56:56 UTC
Nope. And I got a new laptop in the mean time, and it seemed to have the same problem, but I loaded the scratch build onto *that* laptop and it seems OK too. So I think you nailed it. Thanks a lot for the fix! Let's do official builds :)

Comment 15 Itamar Heim 2016-11-29 17:10:20 UTC
just to update i installed the scratch f24 build on my laptop which had the same issue.

Comment 16 Beniamino Galvani 2016-11-29 17:25:59 UTC
(In reply to Adam Williamson from comment #14)
> Nope. And I got a new laptop in the mean time, and it seemed to have the
> same problem, but I loaded the scratch build onto *that* laptop and it seems
> OK too. So I think you nailed it. Thanks a lot for the fix! Let's do
> official builds :)

Thanks for testing. Patch applied to master branch:

https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=5f1e36e02612a565d653c2cd76e1f37fb8c9af8e

and nm-1-4:

https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?h=nm-1-4&id=ad4d3ba008e74f46f18905eb4c28295bf436bc3b

Comment 18 Itamar Heim 2016-12-18 19:04:15 UTC
another update: this stopped happening after i applied the scratch build. last night i upgraded to fedora 25 and hit it again.
I can take the one by Alex as a stopgap, but i hope this gets merged soon.

Comment 19 Adam Williamson 2016-12-19 06:06:44 UTC
it's merged upstream, but not built downstream yet. I'm re-running my f25 scratch build, for anyone who needs it, since the previous one has had its output deleted, I think. Here's the new one:

https://koji.fedoraproject.org/koji/taskinfo?taskID=16953199

Comment 20 Adam Williamson 2016-12-19 06:07:36 UTC
Ah, in fact, I see a 1.4.4-2.fc25 build in Koji now which probably has the fix:

https://koji.fedoraproject.org/koji/buildinfo?buildID=826019

Comment 21 Itamar Heim 2017-01-06 14:49:12 UTC
I'm traveling and in my current location this happens every other suspend... would be good to have it pushed formally. I doubt everyone track this bug for the koji build...
Thanks.

Comment 22 Thomas Haller 2017-01-10 14:58:53 UTC
regarding F25, this is fixed with NetworkManager-1.4.4-2.fc25.

Comment 23 Fedora Update System 2017-01-10 20:23:38 UTC
NetworkManager-1.2.6-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-78a478cd32

Comment 24 Fedora Update System 2017-01-11 03:49:38 UTC
NetworkManager-1.2.6-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-78a478cd32

Comment 25 Fedora Update System 2017-01-20 18:18:13 UTC
NetworkManager-1.2.6-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.