Phone with an APN specifying Username/Password, not re-connecting to mobile data until rebooting

Bug #1450790 reported by Michael Zanetti on 2015-05-01
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Canonical System Image
High
Tony Espy
network-manager (Ubuntu)
Critical
Tony Espy
network-manager (Ubuntu RTM)
Critical
Tony Espy
ofono (Ubuntu)
Critical
Unassigned

Bug Description

Whenever I walk out of WiFi range, my phone does not connect to mobile data. Toggling flight mode does not help. I have to reboot the phone. When then I finally manage to connect after rebooting, if the signal strength drops and the phone would want to switch from 3G to 2G, it disconnects and I have to reboot again to get mobile data.

$ system-image-cli -i
current build number: 200
device name: krillin
channel: ubuntu-touch/devel-proposed
alias: ubuntu-touch/vivid-proposed
last update: 2015-04-30 11:07:21
version version: 200
version ubuntu: 20150429
version device: 20150326-f0c5ba5
version custom: 20150429

Attached you'll find the output of the forensics script

Related branches

Michael Zanetti (mzanetti) wrote :
affects: ofono → ofono (Ubuntu)
Changed in ofono (Ubuntu):
importance: Undecided → Critical
summary: - Phone not connecting to 3G until rebooting
+ Phone not connecting to mobile data until rebooting
Tony Espy (awe) on 2015-05-01
Changed in canonical-devices-system-image:
assignee: nobody → Tony Espy (awe)
Changed in network-manager (Ubuntu):
assignee: nobody → Tony Espy (awe)
Changed in ofono (Ubuntu):
assignee: nobody → Tony Espy (awe)

@Michael

Thanks for the logs...

If you can reproduce reliably, could you add the output of 'list-modems' ( found in /usr/share/ofono/scripts ) and 'list-contexts'?

The error logs you provided show a couple of weird things...

First, I saw a whole bunch of SIM PIN errors reported by ofono. It appears that you have two SIMs installed in the phone as well, are either of these SIMs PIN-locked? The indicator-network log shows an error unlocking a SIM too.

Also, from the syslog it appears that at some point you used the APN Editor, and there's a custom Internet APN with a blank AccessPointName defined. This APN looks to be the same APN that's returning errors when NM tries to activate it ( see errors for context3 in the syslog ).

Could you try the following and see if it resolves your problems?

As root:

# stop ofono
# cd /var/lib/ofono

There should be at least two directories that are a long string of numbers. The numbers are the SubscriberIdentity from your SIM cards. Ignore the dirs with trailing "-", and cd into the other directories and remove the files named 'gprs'. Or if you'd like, you can edit these files and just remove the offending __custom_internet_apn context.

# reboot

This will cause your phone to reprovision itself, and get rid of the offending APN.

We actually spent quite a bit of time this past week at our sprint working on the APN editor, and hopefully can roll out some improvements ( including the ability to force re-provisioning from the UI ) soon.

Changed in network-manager (Ubuntu):
status: New → Incomplete
Changed in ofono (Ubuntu):
status: New → Incomplete
assignee: Tony Espy (awe) → Michael Zanetti (mzanetti)
Michael Zanetti (mzanetti) wrote :

Hi Tony,

No, I only have one SIM in there. That one is indeed PIN-locked.

list-modems: http://paste.ubuntu.com/10966553/
list-contexts: http://paste.ubuntu.com/10966559/

Also you're right that I did enter the SIM PIN wrong every once in a while, as I often reboot during walking outside I made some typos in entering the pin. However, IIRC I always entered the correct PIN on the second attempt at latest.

I don't recall using the APN editor, at least I didn't enter some APN setting somewhere. I did try to manually select the network operator hoping I could get a connection without having to reboot - without success.

I'll do the proposed "reset" now and will report back the results tomorrow.

Michael Zanetti (mzanetti) wrote :

I deleted all the gprs files as instructed. Still no change. Had to reboot every time I needed mobile data. Attached the latest forensics logs.

Changed in network-manager (Ubuntu):
status: Incomplete → New
Changed in ofono (Ubuntu):
status: Incomplete → New
assignee: Michael Zanetti (mzanetti) → nobody
Tony Espy (awe) wrote :

@Michael

Thanks for the updates to the bug. I mentioned the custom APN as when I examined your syslog, it appeared that Network Manager was only trying to activate context3, which was the __ubuntu_custom_internet_apn.

Regarding the APN editor, it's been in rough shape, and one bug ( now fixed ) was that if you just happened to visit the settings page, but didn't do anything, a custom APN would be created automatically. We actually spent time working on APN editor improvements at a sprint last week.

Finally after looking at your logs, a couple of observations:

1. You're roaming, and have enabled data roaming

2. At times ( 14:11, 15:30, 22:29, 22:35 - 23:14 ) it looks like you have poor cell reception as your phone is dropping of GPRS quite a bit, and usually when the phone re-attaches, NM fails to activate context1 every time, and the error is 'no-secrets'. Note, GPRS detaching and re-attaching usually means you're losing a connection from your operator, but as we don't log operator registration itself, I can't tell if it's just GPRS that's dropping.

3. The only time NM succeeds activating context1 is after reboots, which I can see from your syslog.

4. Are you aware that your phone tried to attach to a LasarJet printer?? ;)-

Finally, I think this may be related to bug #1435776 as it deals with an APN with 'Username', but no 'Password', but that's just because both involve secrets.

On 06.05.2015 02:30, Tony Espy wrote:
> 1. You're roaming, and have enabled data roaming

Yes, I've been in London for the weekend. I bought a 1 week
international data flat. Anyhow, I can still reproduce this 100% now
that I'm back home.

>
> 2. At times ( 14:11, 15:30, 22:29, 22:35 - 23:14 ) it looks like you
> have poor cell reception as your phone is dropping of GPRS quite a bit,
> and usually when the phone re-attaches, NM fails to activate context1
> every time, and the error is 'no-secrets'. Note, GPRS detaching and re-
> attaching usually means you're losing a connection from your operator,
> but as we don't log operator registration itself, I can't tell if it's
> just GPRS that's dropping.

Looks like the times I entered metro stations :) So yes... Basically I
had to reboot every time after I exited the metro, because cell
reception dropped, mobile data disconnected and wouldn't reconnect until
rebooting.

>
> 3. The only time NM succeeds activating context1 is after reboots, which
> I can see from your syslog.

yep, exactly.

>
> 4. Are you aware that your phone tried to attach to a LasarJet printer??
> ;)-

Yeah, I think I tapped that in order to force the list to update as it
wouldn't show the hotel network for a while after being back in the
hotel. But that's a different (not so critical) issue.

>
> Finally, I think this may be related to bug #1435776 as it deals with an
> APN with 'Username', but no 'Password', but that's just because both
> involve secrets.

Can't judge that. Please let me know if I can provide more
logs/details/testing. We really need to get this nailed down as it's the
most important thing on a phone after being able to do voice calls.

Tony Espy (awe) on 2015-05-06
Changed in network-manager (Ubuntu):
status: New → In Progress
Changed in ofono (Ubuntu):
status: New → Incomplete

@Michael

Thanks for the detailed response.

As for its importance, I agree this is Critical and am working on it as we speak. I have a hunch there may be a previously undiscovered race condition in the NM ofono connection activation code that's causing this problem.

Would you be willing to install a test package on your phone ( which requires making the root fs write-able )? If not, it might be possible to run NM in the foreground from /tmp...

Michael Zanetti (mzanetti) wrote :

@Tony, sure, whatever I can do to help with this, let me know. No problem with installing packages.

Tony Espy (awe) wrote :

@Michael

Great, I'll let you know when I have a test package ready!

Tony Espy (awe) on 2015-05-07
summary: - Phone not connecting to mobile data until rebooting
+ Phone with n APN specifying Username/Password, not re-connecting to
+ mobile data until rebooting
summary: - Phone with n APN specifying Username/Password, not re-connecting to
+ Phone with an APN specifying Username/Password, not re-connecting to
mobile data until rebooting
Tony Espy (awe) wrote :

@Michael

Can you install the version ( 0.9.10.0-4ubuntu15.1~awe4 ) of network-manager in the phablet-team's telephony PPA and see if it resolves your problem?

As I mentioned in comment #5, I think your issue is related to bug #1435776 ( APNs with a Username, but no Password fail ), for which I now have a fix for. Essentially, the NM ofono settings plugin is adding the Username and Password properties of the APN to an internal settings object. As these properties aren't actually needed by NM, my fix removes them completely.

Michael Zanetti (mzanetti) wrote :

Just tested it after installing the suggested package. It seems to work fine now. It successfully switched from wifi to 3G. Also enabling and disabling flight mode made it reconnect immediately.

syslog attached.

Tony Espy (awe) wrote :

Changed ofono task to Invalid, as the bug is confirmed to be network-manager only.

Changed in canonical-devices-system-image:
status: New → In Progress
Changed in ofono (Ubuntu):
status: Incomplete → Invalid
Tony Espy (awe) wrote :

Note, as I've been using the phablet-team telephony PPA for other testing, so although the version in the PPA has the fix, it has some other experimental changes, so it might cause other problems when testing. Use at your own risk...

If all goes well, we should have this in a silo in the next day or so.

Changed in canonical-devices-system-image:
milestone: none → ww22-2015
importance: Undecided → High
tags: added: connectivity
Tony Espy (awe) on 2015-05-20
Changed in network-manager (Ubuntu RTM):
status: New → Fix Committed
Changed in network-manager (Ubuntu):
status: In Progress → Fix Committed
Changed in network-manager (Ubuntu RTM):
importance: Undecided → Critical
assignee: nobody → Tony Espy (awe)
Tony Espy (awe) on 2015-05-22
Changed in canonical-devices-system-image:
status: In Progress → Fix Committed
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
Andrea Bernabei (faenil) wrote :

on Meizu device with NM 0.9.10.0-4ubuntu15.1.1 I still can't get mobile data connection after I enable/disable flight mode.

Disabling and reenabling mobile data doesn't help.

Andrea Bernabei (faenil) wrote :

My operator has both username and password defined

Andrea Bernabei (faenil) wrote :

After flashing r5 on meizu I still have the issue with flight mode, but enabling/disabling mobile data this time fixes it.

But that's already tracked in bug #1445080 :)

Tony Espy (awe) wrote :

Changed the status of the Ubuntu task, as this has not yet been merged for wily.

Changed in network-manager (Ubuntu RTM):
status: Fix Committed → Fix Released
Changed in network-manager (Ubuntu):
status: Fix Committed → In Progress
Aron Xu (happyaron) on 2016-12-20
tags: added: nm-touch
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers