Mobile data not always activated properly

Bug #1206888 reported by Dave Morley on 2013-07-31
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
touch-preview-images
Fix Released
Critical
Mathieu Trudel-Lapierre
network-manager (Ubuntu)
High
Mathieu Trudel-Lapierre

Bug Description

It's possible for the device to come up on first boot with no active mobile data connection.

When this happens, everything looks good from the ofono/rilmodem side of things ( ie. GPRS is attached and provisioning succeeded ), however NM never seems to activate the connection.

The following is Dave's original description:

I have done a --pending --wipe to try out some of the fixes for gprs. NM indicator is set to off Mobile data. I enable it and nothing. Below is the summary of what I hope is useful info.

root@ubuntu-phablet:/# ifconfig
lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:16436 Metric:1
          RX packets:524 errors:0 dropped:0 overruns:0 frame:0
          TX packets:524 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:39505 (39.5 KB) TX bytes:39505 (39.5 KB)

root@ubuntu-phablet:/# /usr/share/ofono/scripts/list-modems
[ /ril_0 ]
    Features = gprs sms net sim
    Emergency = 0
    Powered = 1
    Lockdown = 0
    Interfaces = org.ofono.ConnectionManager org.ofono.CallVolume org.ofono.SmartMessaging org.ofono.PushNotification org.ofono.MessageManager org.ofono.NetworkRegistration org.ofono.NetworkTime org.ofono.VoiceCallManager org.ofono.SimManager
    Online = 1
    Model = Fake Modem Model
    Revision = I9250XXLJ1
    Type = hardware
    Serial = 351554052322998
    Manufacturer = Fake Manufacturer
    [ org.ofono.ConnectionManager ]
        Attached = 1
        RoamingAllowed = 0
        Suspended = 0
        Powered = 1
    [ org.ofono.CallVolume ]
        Muted = 1
        SpeakerVolume = 0
        MicrophoneVolume = 0
    [ org.ofono.SmartMessaging ]
    [ org.ofono.PushNotification ]
    [ org.ofono.MessageManager ]
        Alphabet = default
        UseDeliveryReports = 0
        Bearer = cs-preferred
        ServiceCenterAddress =
    [ org.ofono.NetworkRegistration ]
        Status = registered
        Strength = 19
        Name = T-Mobile Orange
        LocationAreaCode = 3218
        Mode = auto
        MobileCountryCode = 234
        Technology = umts
        CellId = 210924067
        MobileNetworkCode = 33
    [ org.ofono.NetworkTime ]
    [ org.ofono.VoiceCallManager ]
        EmergencyNumbers = 112 999 911
    [ org.ofono.SimManager ]
        Retries =
        MobileCountryCode = 234
        FixedDialing = 0
        SubscriberNumbers = 07572378845
        PreferredLanguages = en
        BarredDialing = 0
        CardIdentifier = 8944302031557237537
        LockedPins =
        MobileNetworkCode = 30
        SubscriberIdentity = 234308342877614
        Present = 1
        PinRequired = none

root@ubuntu-phablet:/# dpkg -l | grep ofono
ii libofono-qt1 1.5+git20120419+bcf0c04-0ubuntu1 armhf Qt oFono library
ii ofono 1.12phablet11 armhf Mobile telephony stack (daemon)
ii ofono-scripts 1.12phablet11 armhf Mobile telephony stack (test and maintenance script files)
ii telepathy-ofono 0.2daily13.06.14.1-0ubuntu1 armhf telepathy oFono connection manager

Dave Morley (davmor2) wrote :

root@ubuntu-phablet:/# /usr/share/ofono/scripts/list-contexts
[ /ril_0 ]
    [ /ril_0/context1 ]
        Username = User
        Protocol = ip
        Name = Internet
        Settings = { }
        IPv6.Settings = { }
        Active = 0
        AccessPointName = general.t-mobile.uk
        Password = mms
        Type = internet

    [ /ril_0/context2 ]
        Username =
        Protocol = ip
        Name = Internet
        Settings = { }
        IPv6.Settings = { }
        Active = 0
        AccessPointName = general.t-mobile.uk
        Password =
        Type = internet

root@ubuntu-phablet:/# nmcli dev
DEVICE TYPE STATE
/ril_0 gsm disconnected
wlan0 802-11-wireless connected
root@ubuntu-phablet:/#

Dave Morley (davmor2) wrote :
Download full text (47.3 KiB)

NetworkManager info from syslog:

root@ubuntu-phablet:/# cat /var/log/syslog | grep NetworkManager
Jul 31 11:18:40 ubuntu-phablet kernel: [ 19.801086] type=1400 audit(1375269520.817:3): apparmor="STATUS" operation="profile_load" parent=554 profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=556 comm="apparmor_parser"
Jul 31 11:18:41 ubuntu-phablet kernel: [ 20.114746] type=1400 audit(1375269521.130:6): apparmor="STATUS" operation="profile_replace" parent=614 profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=615 comm="apparmor_parser"
Jul 31 11:18:41 ubuntu-phablet kernel: [ 20.353363] type=1400 audit(1375269521.372:9): apparmor="STATUS" operation="profile_replace" parent=617 profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=622 comm="apparmor_parser"
Jul 31 11:18:45 ubuntu-phablet NetworkManager[933]: <info> NetworkManager (version 0.9.8.0) is starting...
Jul 31 11:18:45 ubuntu-phablet NetworkManager[933]: <info> Read config file /etc/NetworkManager/NetworkManager.conf
Jul 31 11:18:45 ubuntu-phablet NetworkManager[933]: <info> WEXT support is enabled
Jul 31 11:18:45 ubuntu-phablet NetworkManager[933]: <info> DNS: loaded plugin dnsmasq
Jul 31 11:18:45 ubuntu-phablet NetworkManager[933]: SCPlugin-Ifupdown: init!
Jul 31 11:18:45 ubuntu-phablet NetworkManager[933]: SCPlugin-Ifupdown: update_system_hostname
Jul 31 11:18:45 ubuntu-phablet NetworkManager[933]: SCPluginIfupdown: management mode: unmanaged
Jul 31 11:18:45 ubuntu-phablet NetworkManager[933]: SCPlugin-Ifupdown: devices added (path: /sys/devices/platform/omap/omap_hsmmc.4/mmc_host/mmc1/mmc1:0001/mmc1:0001:2/net/p2p0, iface: p2p0)
Jul 31 11:18:45 ubuntu-phablet NetworkManager[933]: SCPlugin-Ifupdown: device added (path: /sys/devices/platform/omap/omap_hsmmc.4/mmc_host/mmc1/mmc1:0001/mmc1:0001:2/net/p2p0, iface: p2p0): no ifupdown configuration found.
Jul 31 11:18:45 ubuntu-phablet NetworkManager[933]: SCPlugin-Ifupdown: devices added (path: /sys/devices/platform/omap/omap_hsmmc.4/mmc_host/mmc1/mmc1:0001/mmc1:0001:2/net/wlan0, iface: wlan0)
Jul 31 11:18:45 ubuntu-phablet NetworkManager[933]: SCPlugin-Ifupdown: device added (path: /sys/devices/platform/omap/omap_hsmmc.4/mmc_host/mmc1/mmc1:0001/mmc1:0001:2/net/wlan0, iface: wlan0): no ifupdown configuration found.
Jul 31 11:18:45 ubuntu-phablet NetworkManager[933]: SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/ifb0, iface: ifb0)
Jul 31 11:18:45 ubuntu-phablet NetworkManager[933]: SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/ifb0, iface: ifb0): no ifupdown configuration found.
Jul 31 11:18:45 ubuntu-phablet NetworkManager[933]: SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/ifb1, iface: ifb1)
Jul 31 11:18:45 ubuntu-phablet NetworkManager[933]: SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/ifb1, iface: ifb1): no ifupdown configuration found.
Jul 31 11:18:45 ubuntu-phablet NetworkManager[933]: SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/ip6tnl0, iface: ip6tnl0)
Jul 31 11:18:45 ubuntu-phablet NetworkManager[933]: SCPlugin-Ifupd...

Tony Espy (awe) on 2013-07-31
Changed in touch-preview-images:
assignee: nobody → Tony Espy (awe)
Tony Espy (awe) wrote :

@Dave

Did you play around with the network indicator's "Mobile data" toggle switch? The only difference between my maguro and yours, is that in your log file I see:

Jul 31 11:19:04 ubuntu-phablet NetworkManager[933]: <info> WWAN now enabled by management service
Jul 31 11:31:15 ubuntu-phablet NetworkManager[933]: <info> WWAN now disabled by management service
Jul 31 11:31:16 ubuntu-phablet NetworkManager[933]: <info> WWAN now enabled by management service

Whereas on my phone, I only see a single enabled message.

Note, we just landed a fix for the indicator mobile data toggle switch this morning ( see bug # ), so it will be in tomorrow's image. You can manually install by running 'apt-get update; apt-get install chewie. The fix landed in version 0.2.10.

Could you reflash using --wipe, then update chewie and give it another try?

Tony Espy (awe) wrote :

Sorry, the mobile data bug is bug #1204661.

Changed in touch-preview-images:
status: New → In Progress
Dave Morley (davmor2) wrote :

Yeap when it didn't connect after the 12 minutes I knocked it off and on again incase it hadn't registered the initial turn on.

Dave Morley (davmor2) wrote :

This morning I did a phablet-flash --pending and got 20130801 image installed. Gprs worked fine. Note no --wipe.

This afternoon I did a phablet-flash --pending --wipe still got 20130801 but the gprs didn't function until the device was rebooted.

Tony Espy (awe) wrote :

@Dave

Can you still reproduce this with the latest image? GPRS seems to be working pretty consistently for me this week?

Changed in touch-preview-images:
status: In Progress → Incomplete
assignee: Tony Espy (awe) → Dave Morley (davmor2)
Dave Morley (davmor2) wrote :
Download full text (97.2 KiB)

So today I did a phablet-flash --pending --wipe I get the following:

root@ubuntu-phablet:/# /usr/share/ofono/scripts/list-modems
[ /ril_0 ]
    Features = sms net gprs sim
    Emergency = 0
    Powered = 1
    Lockdown = 0
    Interfaces = org.ofono.CallVolume org.ofono.SmartMessaging org.ofono.PushNotification org.ofono.MessageManager org.ofono.NetworkRegistration org.ofono.ConnectionManager org.ofono.NetworkTime org.ofono.SimManager org.ofono.VoiceCallManager
    Online = 1
    Model = Fake Modem Model
    Revision = I9250XXLJ1
    Type = hardware
    Serial = 351554052322998
    Manufacturer = Fake Manufacturer
    [ org.ofono.CallVolume ]
        Muted = 1
        SpeakerVolume = 0
        MicrophoneVolume = 0
    [ org.ofono.SmartMessaging ]
    [ org.ofono.PushNotification ]
    [ org.ofono.MessageManager ]
        Alphabet = default
        UseDeliveryReports = 0
        Bearer = cs-preferred
        ServiceCenterAddress =
    [ org.ofono.NetworkRegistration ]
        Status = registered
        Strength = 22
        Name = T-Mobile Orange
        LocationAreaCode = 3218
        Mode = auto
        MobileCountryCode = 234
        Technology = umts
        CellId = 210924067
        MobileNetworkCode = 33
    [ org.ofono.ConnectionManager ]
        Attached = 1
        RoamingAllowed = 0
        Suspended = 0
        Powered = 1
    [ org.ofono.NetworkTime ]
    [ org.ofono.SimManager ]
        Retries =
        MobileCountryCode = 234
        FixedDialing = 0
        SubscriberNumbers = 07572378845
        PreferredLanguages = en
        BarredDialing = 0
        CardIdentifier = 8944302031557237537
        LockedPins =
        MobileNetworkCode = 30
        SubscriberIdentity = 234308342877614
        Present = 1
        PinRequired = none
    [ org.ofono.VoiceCallManager ]
        EmergencyNumbers = 112 999 911

root@ubuntu-phablet:/# nmcli c
NAME UUID TYPE TIMESTAMP-REAL
/234308342877614/context1 344e5cdc-0bbf-7588-5cc6-61138f7c6b94 gsm never
root@ubuntu-phablet:/# /usr/share/ofono/scripts/list-contexts
[ /ril_0 ]
    [ /ril_0/context1 ]
        Username = User
        Protocol = ip
        Name = Internet
        Settings = { }
        IPv6.Settings = { }
        Active = 0
        AccessPointName = general.t-mobile.uk
        Password = mms
        Type = internet

root@ubuntu-phablet:/# ifconfig
lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:16436 Metric:1
          RX packets:72 errors:0 dropped:0 overruns:0 frame:0
          TX packets:72 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:5408 (5.4 KB) TX bytes:5408 (5.4 KB)

root@ubuntu-phablet:/# cat /var/log/syslog | grep NetworkManager
Aug 9 12:15:50 ubuntu-phablet kernel: [ 21.026702] type=1400 audit(1376050550.116:3): apparmor="STATUS" operation="profile_load" parent=623 profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=627 comm="apparmor_pars...

Changed in touch-preview-images:
status: Incomplete → Confirmed
assignee: Dave Morley (davmor2) → Tony Espy (awe)
Tony Espy (awe) wrote :

I finally managed to hit this myself running today's image ( 20130812 ), and I think I know what's happening as well.

Basically on first boot, there's a race between NetworkManager's ofono settings plugin and ofono's provision plugin.

If the former runs first, it finds no data contexts and gives up. As far as I can tell looking at the code ( NM's add_ofono_settings_support.patch ) and my log file, this is what's going on.

This could be fixed by ensuring that NM starts after ofono, however that probably isn't reliable enough. My guess is that changing the plugin code to watch the ofono settings directory for changes is probably a better approach.

Also, one other thing that I noticed while looking at the settings plugin code, is that it appears to iterate over any IMSI directories it finds in /var/lib/ofono, vs. only reading from the active IMSI directory.

Changed in touch-preview-images:
importance: Undecided → Critical
assignee: Tony Espy (awe) → Mathieu Trudel-Lapierre (mathieu-tl)
summary: - Maguro: 20130731 image no gprs
+ Mobile data not always activated properly
description: updated
Tony Espy (awe) wrote :

Here's my full syslog from my maguro device.

Note, the following log messages:

Aug 12 14:46:21 ubuntu-phablet NetworkManager[883]: SCPlugin-Ofono: init!
Aug 12 14:46:21 ubuntu-phablet NetworkManager[883]: SCPlugin-Ofono: end _init.
Aug 12 14:46:21 ubuntu-phablet NetworkManager[883]: <info> Loaded plugin (null): (null)
Aug 12 14:46:21 ubuntu-phablet NetworkManager[883]: Ifupdown: get unmanaged devices count: 0
Aug 12 14:46:21 ubuntu-phablet NetworkManager[883]: SCPlugin-Ifupdown: (8025016) ... get_connections.
Aug 12 14:46:21 ubuntu-phablet NetworkManager[883]: SCPlugin-Ifupdown: (8025016) ... get_connections (managed=false): return empty list.
Aug 12 14:46:21 ubuntu-phablet NetworkManager[883]: SCPlugin-Ofono: (1105210552) ... get_connections.
Aug 12 14:46:21 ubuntu-phablet NetworkManager[883]: SCPlugin-Ofono: (1105210552) connections count: 0
Aug 12 14:46:21 ubuntu-phablet NetworkManager[883]: Ifupdown: get unmanaged devices count: 0
Aug 12 14:46:21 ubuntu-phablet ofonod[792]: Network time: Registered inteface org.ofono.NetworkTime, path /ril_0

Nothing in the attached logs contains any debugging information from NM. Please make sure to start NM manually with

/usr/sbin/NetworkManager --no-daemon --log-level=debug

Before attaching a copy of syslog to this bug report. There is no indication of any attempt or reason why the device should get started in the current attachment.

I identified the issue, it's being worked on. NM only reads the connections from ofono's config files once, when the plugin starts. It's possible that at that moment ofono's provisioning hasn't run yet to create the necessary files.

NM should be able to reread the config once we get a signal that there was a new context added.

Changed in network-manager (Ubuntu):
importance: Undecided → High
status: New → Triaged
assignee: nobody → Mathieu Trudel-Lapierre (mathieu-tl)
Changed in touch-preview-images:
status: Confirmed → Triaged
Changed in network-manager (Ubuntu):
status: Triaged → In Progress
Changed in touch-preview-images:
status: Triaged → In Progress
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package network-manager - 0.9.8.0-0ubuntu17

---------------
network-manager (0.9.8.0-0ubuntu17) saucy; urgency=low

  * Rework oFono context parsing into NM Connections. (LP: #1206888)
    * debian/patches/add_ofono_settings_support.patch: listen to inotify events
      for ofono settings file additions and changes.
    * debian/patches/add_ofono_settings_support.patch: refactor settings parsing
      to extract the read step on a per-IMSI basis; make that function callable
      via DBus.
    * debian/patches/add_ofono_support.patch: listen for ContextAdded from oFono
      and call the ReadImsiContexts function from the settings plugin to make
      sure we have all the latest connections from oFono.
 -- Mathieu Trudel-Lapierre <email address hidden> Tue, 20 Aug 2013 21:13:13 -0400

Changed in network-manager (Ubuntu):
status: In Progress → Fix Released
Tony Espy (awe) wrote :

Here's my log from maguro and today's freshly flashed image.

After the initial install, everything worked fine and mobile data was activated.

To try and trigger the bug, I stopped NM & ofono, and then manually removed the existing context from the /<IMSI>/gprs settings file.

At this point I rebooted the phone, and the mobile data connection did not come active.

 Here's the output of ofono's 'list-contexts':

root@ubuntu-phablet:/usr/share/ofono/scripts# ./list-contexts
[ /ril_0 ]
    [ /ril_0/context1 ]
        Username =
        Protocol = ip
        Name = MEdia Net (phones)
        Settings = { }
        IPv6.Settings = { }
        Active = 0
        AccessPointName = wap.cingular
        Password =
        Type = internet

Here's the contents of the <IMSI> gprs settings file:

root@ubuntu-phablet:/var/lib/ofono/310410315414121# more gprs
[Settings]
Powered=true
RoamingAllowed=false

[context1]
Name=MEdia Net (phones)
AccessPointName=wap.cingular
Username=
Password=
Type=internet
Protocol=ip

Dave Morley (davmor2) wrote :

I just rechecked by doing a phablet-flash cdimage-touch --pending --wipe and I get the following:
root@ubuntu-phablet:/# /usr/share/ofono/scripts/list-contexts
[ /ril_0 ]
    [ /ril_0/context1 ]
        Username = User
        Protocol = ip
        Name = Internet
        Settings = { }
        IPv6.Settings = { }
        Active = 0
        AccessPointName = general.t-mobile.uk
        Password = mms
        Type = internet

root@ubuntu-phablet:/# nmcli c
NAME UUID TYPE TIMESTAMP-REAL
root@ubuntu-phablet:/# /usr/share/ofono/scripts/list-modems
[ /ril_0 ]
    Features = sms net gprs sim
    Emergency = 0
    Powered = 1
    Lockdown = 0
    Interfaces = org.ofono.CallVolume org.ofono.MessageManager org.ofono.NetworkRegistration org.ofono.ConnectionManager org.ofono.NetworkTime org.ofono.VoiceCallManager org.ofono.SimManager
    Online = 1
    Model = Fake Modem Model
    Revision = I9250XXLJ1
    Type = hardware
    Serial = 351554052322998
    Manufacturer = Fake Manufacturer
    [ org.ofono.CallVolume ]
        Muted = 1
        SpeakerVolume = 0
        MicrophoneVolume = 0
    [ org.ofono.MessageManager ]
    [ org.ofono.NetworkRegistration ]
        Status = registered
        Strength = 19
        Name = T-Mobile Orange
        LocationAreaCode = 3218
        Mode = auto
        MobileCountryCode = 234
        Technology = umts
        CellId = 210924067
        MobileNetworkCode = 33
    [ org.ofono.ConnectionManager ]
        Powered = 1
        Attached = 1
        Bearer = none
        Suspended = 0
        RoamingAllowed = 0
    [ org.ofono.NetworkTime ]
    [ org.ofono.VoiceCallManager ]
        EmergencyNumbers = 112 999 911
    [ org.ofono.SimManager ]
        Retries =
        MobileCountryCode = 234
        FixedDialing = 0
        SubscriberNumbers = 07572378845
        PreferredLanguages = en
        BarredDialing = 0
        CardIdentifier = 8944302031557237537
        LockedPins =
        MobileNetworkCode = 30
        SubscriberIdentity = 234308342877614
        Present = 1
        PinRequired = none

root@ubuntu-phablet:/# dpkg -l | grep network-manager
ii network-manager 0.9.8.0-0ubuntu17 armhf network management framework (daemon and userspace tools)

Dave Morley (davmor2) wrote :

When I reboot the device I get the following:
root@ubuntu-phablet:/# /usr/share/ofono/scripts/list-contexts
[ /ril_0 ]
    [ /ril_0/context1 ]
        Username = User
        Protocol = ip
        Name = Internet
        Settings = { }
        IPv6.Settings = { }
        Active = 0
        AccessPointName = general.t-mobile.uk
        Password = mms
        Type = internet

root@ubuntu-phablet:/# nmcli c
NAME UUID TYPE TIMESTAMP-REAL
/234308342877614/context1 344e5cdc-0bbf-7588-5cc6-61138f7c6b94 gsm never
root@ubuntu-phablet:/# /usr/share/ofono/scripts/list-modems
[ /ril_0 ]
    Features = sms net gprs sim
    Emergency = 0
    Powered = 1
    Lockdown = 0
    Interfaces = org.ofono.CallVolume org.ofono.MessageManager org.ofono.NetworkRegistration org.ofono.ConnectionManager org.ofono.NetworkTime org.ofono.VoiceCallManager org.ofono.SimManager
    Online = 1
    Model = Fake Modem Model
    Revision = I9250XXLJ1
    Type = hardware
    Serial = 351554052322998
    Manufacturer = Fake Manufacturer
    [ org.ofono.CallVolume ]
        Muted = 1
        SpeakerVolume = 0
        MicrophoneVolume = 0
    [ org.ofono.MessageManager ]
    [ org.ofono.NetworkRegistration ]
        Status = registered
        Strength = 22
        Name = T-Mobile Orange
        LocationAreaCode = 3218
        Mode = auto
        MobileCountryCode = 234
        Technology = umts
        CellId = 210924067
        MobileNetworkCode = 33
    [ org.ofono.ConnectionManager ]
        Powered = 1
        Attached = 1
        Bearer = none
        Suspended = 0
        RoamingAllowed = 0
    [ org.ofono.NetworkTime ]
    [ org.ofono.VoiceCallManager ]
        EmergencyNumbers = 112 999 911
    [ org.ofono.SimManager ]
        Retries =
        MobileCountryCode = 234
        FixedDialing = 0
        SubscriberNumbers = 07572378845
        PreferredLanguages = en
        BarredDialing = 0
        CardIdentifier = 8944302031557237537
        LockedPins =
        MobileNetworkCode = 30
        SubscriberIdentity = 234308342877614
        Present = 1
        PinRequired = none

root@ubuntu-phablet:/# dpkg -l | grep network-manager
ii network-manager 0.9.8.0-0ubuntu17 armhf network management framework (daemon and userspace tools)

Tony Espy (awe) on 2013-09-13
Changed in touch-preview-images:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers