OK, so there are two low-level problems:

1. InProgress error returned by SetProperty('Active',true) call to ofono
for a gprs-context.

Alfonso's first syslog shows that this can happen, but I'm not sure
exactly how to reproduce.  NM would've had to start activation, then
Attached bounced down and back up again, without ofono canceling the
context activation.  The next time NM tried to activate, in theory it'd
be returned InProgress.

Right now, NMModemOfono::stage1_prepare_done() always emits a failed
MODEM_PREPARE_RESULT for any error returned by ofono in response to the
SetProperty call.

The fix is to check explicitly for error == InProgress, and just return
without emitting a result ( this is the same thing that happens if no
error is returned ).

2. The context in question is already active.

This can be reproduced by killing NetworkManager, when it restarts, it
gets stuck in the Prepare stage.

This is because ofono doesn't send an error if SetProperty('Active',
true) would have no effect on the property's value ( ie. if it's already
true ).  Furthermore, as the context 'Settings' property is already
populated, context_property_changed() is never invoked for the
'Settings', so a MODEM_PREPARE_RESULT is never sent, true or false, so
the device is stuck in PREPARE state.

The fix involves the following changes to NMModemOfono:

do_context_activate() should check the cached value of 'Active', and if
true, should call a new function called process_context_settings(),
which should be based on the current context_property_changed().  This
will result in a PREPARE_RESULT being generated, and thus the device
should no longer get stuck in PREPARE state.

In theory this should work, as NM should just deal with any EEXISTS
errors when it tries to re-configure the IP address, routing table
entries, and DNS nameservers.  It this *doesn't* just work, then we may
need some upstream assistance.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to network-manager in Ubuntu.
https://bugs.launchpad.net/bugs/1565717

Title:
  No connection after returning from area without coverage

Status in Canonical System Image:
  Confirmed
Status in network-manager package in Ubuntu:
  In Progress

Bug description:
  After moving in an out of my own "faraday cage" an ubuntu phone, NM
  got into an state where *both* WiFi and cellular data were
  disconnected and NM was not able to recover.

  ****************
  * This still happens with network-manager 1.1.93-0ubuntu1~vivid3, in

  phablet@ubuntu-phablet:~$ system-image-cli -i
  current build number: 336
  device name: krillin
  channel: ubuntu-touch/rc-proposed/bq-aquaris.en
  last update: 2016-05-17 09:19:51
  version version: 336
  version ubuntu: 20160517
  version device: 20160329-a9bacdb
  version custom: 20160505-975-38-9
  ****************

  Originally reported for:

  NM version:
  network-manager                                      0.9.10.0-4ubuntu15.1.11

  root@ubuntu-phablet:/home/phablet# system-image-cli -i
  current build number: 298
  device name: krillin
  channel: ubuntu-touch/rc-proposed/bq-aquaris.en
  last update: 2016-03-30 16:58:21
  version version: 298
  version ubuntu: 20160330
  version device: 20160323-1467d3c
  version custom: 20160324--36-54-vivid

  phablet@ubuntu-phablet:~$ nmcli d
  DEVICE   TYPE      STATE                 CONNECTION
  ril_0    gsm       connecting (prepare)  /214050030479893/context1
  wlan0    wifi      disconnected          --
  ril_1    gsm       unavailable           --
  ifb0     ifb       unmanaged             --
  ifb1     ifb       unmanaged             --
  lo       loopback  unmanaged             --
  ip6tnl0  unknown   unmanaged             --
  sit0     unknown   unmanaged             --
  tunl0    unknown   unmanaged             --

  phablet@ubuntu-phablet:~$ nmcli c
  NAME                       UUID                                  TYPE         
    DEVICE
  WLAN_1609                  fe9b17ad-88fa-43b7-bcab-8fbc1985ce42  
802-11-wireless  --
  Wireless                   98ff5b6f-b0d9-471a-b867-8a7be51e12c2  
802-11-wireless  --
  Ubuntu                     549c352f-8a2b-4e48-b8c8-eb7ab0e53089  
802-11-wireless  --
  /234304107917083/context1  1f192cdc-ccea-2dc3-fa13-619ed3053828  gsm          
    --
  /214321010036211/context1  0992421f-2369-0765-ceaa-ba2a3091e111  gsm          
    --
  /214050030479893/context1  d30e4f19-9d00-ab1f-ab43-6d9c1b628556  gsm          
    ril_0
  /214019301737411/context1  88b28978-e2fc-6336-8665-b0ae78d321ae  gsm          
    --

  phablet@ubuntu-phablet:~$ /usr/share/ofono/scripts/list-contexts
  [ /ril_1 ]
  [ /ril_0 ]
      [ /ril_0/context1 ]
          Settings = { Gateway=10.50.83.25 
DomainNameServers=80.58.61.250,80.58.61.254, Interface=ccmni0 
Address=10.50.83.25 Method=static Netmask=255.255.255.0 }
          Name = Pepephone
          Type = internet
          AccessPointName = gprs.pepephone.com
          Active = 1
          Protocol = ip
          AuthenticationMethod = chap
          Password =
          Preferred = 0
          Username =
          IPv6.Settings = { }

      [ /ril_0/context2 ]
          Name = MMS Pepephone
          Type = mms
          Active = 0
          Settings = { }
          MessageCenter = http://www.pepephone.com
          MessageProxy = 10.138.255.43:8080
          Preferred = 0
          Password =
          AccessPointName = gprs.pepephone.com
          Protocol = ip
          AuthenticationMethod = chap
          Username =
          IPv6.Settings = { }

  phablet@ubuntu-phablet:~$ ifconfig
  ccmni0    Link encap:Ethernet  HWaddr 46:23:7c:fb:73:cb
            inet addr:10.50.83.25  Mask:255.0.0.0
            UP RUNNING NOARP  MTU:1500  Metric:1
            RX packets:1995 errors:0 dropped:0 overruns:0 frame:0
            TX packets:2299 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:1000
            RX bytes:603432 (603.4 KB)  TX bytes:193513 (193.5 KB)

  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:11189 errors:0 dropped:0 overruns:0 frame:0
            TX packets:11189 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:0
            RX bytes:1733281 (1.7 MB)  TX bytes:1733281 (1.7 MB)

  wlan0     Link encap:Ethernet  HWaddr b8:64:91:47:21:b6
            UP BROADCAST MULTICAST  MTU:1500  Metric:1
            RX packets:3184 errors:0 dropped:0 overruns:0 frame:0
            TX packets:1626 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:1000
            RX bytes:308130 (308.1 KB)  TX bytes:172906 (172.9 KB)

  phablet@ubuntu-phablet:~$ /usr/share/ofono/scripts/list-modems
  [ /ril_1 ]
      Serial = 354142069998062
      Features = rat sim
      Revision = MOLY.WR8.W1315.MD.WG.MP.V37.P5, 2014/05/15 11:49
      Manufacturer = Fake Manufacturer
      Powered = 1
      Lockdown = 0
      Interfaces = org.ofono.RadioSettings org.ofono.SimManager 
org.ofono.MtkSettings org.ofono.CallVolume org.ofono.VoiceCallManager 
org.ofono.NetworkTime
      Type = hardware
      Model = Fake Modem Model
      Online = 1
      Emergency = 0
      [ org.ofono.RadioSettings ]
          TechnologyPreference = gsm
          AvailableTechnologies = gsm
          FastDormancy = 0
      [ org.ofono.SimManager ]
          Present = 0
      [ org.ofono.MtkSettings ]
          Has3G = 0
      [ org.ofono.CallVolume ]
          MicrophoneVolume = 0
          SpeakerVolume = 0
          Muted = 0
      [ org.ofono.VoiceCallManager ]
          EmergencyNumbers = 08 000 999 110 112 911 118 119
      [ org.ofono.NetworkTime ]

  [ /ril_0 ]
      Serial = 354140069999981
      Features = gprs ussd net sms rat sim
      Revision = MOLY.WR8.W1315.MD.WG.MP.V37.P5, 2014/05/15 11:49
      Manufacturer = Fake Manufacturer
      Powered = 1
      Lockdown = 0
      Interfaces = org.ofono.ConnectionManager org.ofono.Phonebook 
org.ofono.CallBarring org.ofono.CallForwarding org.ofono.CallSettings 
org.ofono.SupplementaryServices org.ofono.NetworkRegistration 
org.ofono.PushNotification org.ofono.MessageManager org.ofono.MessageWaiting 
org.ofono.RadioSettings org.ofono.SimManager org.ofono.MtkSettings 
org.ofono.CallVolume org.ofono.VoiceCallManager org.ofono.NetworkTime
      Type = hardware
      Model = Fake Modem Model
      Online = 1
      Emergency = 0
      [ org.ofono.ConnectionManager ]
          Bearer = gprs
          Attached = 1
          RoamingAllowed = 0
          Powered = 1
          Suspended = 0
      [ org.ofono.Phonebook ]
      [ org.ofono.CallBarring ]
          VoiceIncoming = disabled
          VoiceOutgoing = disabled
      [ org.ofono.CallForwarding ]
          VoiceNoReply =
          VoiceNoReplyTimeout = 20
          VoiceNotReachable = +346808934593085
          VoiceUnconditional =
          VoiceBusy = +346808934593085
          ForwardingFlagOnSim = 0
      [ org.ofono.CallSettings ]
          CalledLinePresentation = disabled
          CallingLineRestriction = disabled
          ConnectedLineRestriction = unknown
          VoiceCallWaiting = disabled
          CallingLinePresentation = enabled
          ConnectedLinePresentation = unknown
          CallingNamePresentation = unknown
          HideCallerId = default
      [ org.ofono.SupplementaryServices ]
          State = idle
      [ org.ofono.NetworkRegistration ]
          Technology = gsm
          Status = registered
          Mode = auto
          CellId = 4321
          MobileCountryCode = 214
          Strength = 41
          MobileNetworkCode = 07
          LocationAreaCode = 2824
          Name = pepephone
      [ org.ofono.PushNotification ]
      [ org.ofono.MessageManager ]
          ServiceCenterAddress = +34609090909
          UseDeliveryReports = 0
          Bearer = cs-preferred
          Alphabet = default
      [ org.ofono.MessageWaiting ]
          VoicemailWaiting = 0
          VoicemailMessageCount = 0
          VoicemailMailboxNumber =
      [ org.ofono.RadioSettings ]
          TechnologyPreference = umts
          AvailableTechnologies = gsm umts
          FastDormancy = 0
      [ org.ofono.SimManager ]
          FixedDialing = 0
          LockedPins =
          Retries = [puk = 10] [pin2 = 3] [pin = 3] [puk2 = 10]
          SubscriberNumbers =
          PreferredLanguages = es
          MobileNetworkCode = 05
          ServiceNumbers = [Buzon de Voz (Roaming)] = '+34717700177' [SMS 
(Configura Internet)] = '22050' [Atencion al cliente ADSL] = '1214' [Buzon de 
Voz] = '22177' [Atencion al cliente] = '1212'
          SubscriberIdentity = 214050030479893
          CardIdentifier = 8934075782002298987
          MobileCountryCode = 214
          Present = 1
          BarredDialing = 0
          PinRequired = none
      [ org.ofono.MtkSettings ]
          Has3G = 1
      [ org.ofono.CallVolume ]
          MicrophoneVolume = 0
          SpeakerVolume = 0
          Muted = 0
      [ org.ofono.VoiceCallManager ]
          EmergencyNumbers = 112 911
      [ org.ofono.NetworkTime ]

  phablet@ubuntu-phablet:~$ ip route
  phablet@ubuntu-phablet:~$

  phablet@ubuntu-phablet:~$ nmcli d show
  GENERAL.DEVICE:                         ril_0
  GENERAL.TYPE:                           gsm
  GENERAL.HWADDR:                         (unknown)
  GENERAL.MTU:                            0
  GENERAL.STATE:                          40 (connecting (prepare))
  GENERAL.CONNECTION:                     /214050030479893/context1
  GENERAL.CON-PATH:                       
/org/freedesktop/NetworkManager/ActiveConnection/47

  GENERAL.DEVICE:                         wlan0
  GENERAL.TYPE:                           wifi
  GENERAL.HWADDR:                         B8:64:91:47:21:B6
  GENERAL.MTU:                            1500
  GENERAL.STATE:                          30 (disconnected)
  GENERAL.CONNECTION:                     --
  GENERAL.CON-PATH:                       --
  ...

To manage notifications about this bug go to:
https://bugs.launchpad.net/canonical-devices-system-image/+bug/1565717/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to