Sync Accounts are removed when connection is unstable



  • Could it be that a connectivity drop (i.e. no packets can be sent, while the wifi connection itself is still perfectly fine) causes the DAV account to be removed?

    I have a weird problem with the Android 4.4.2 device I have.
    After a few minutes the connection stops working.
    When I disable and re-enable the WiFi, it works again.
    The problem is very reproducable and occurs after only a few minutes.

    I found out that the default gateway is deleted.
    First, it is
    shell@thl__T11 $ ip route show
    default via 10.183.252.1 dev wlan0
    10.183.252.0/24 dev wlan0 scope link
    10.183.252.0/24 dev wlan0 proto kernel scope link src 10.183.252.254 metric$
    10.183.252.1 dev wlan0 scope link
    shell@thl__T11 $

    Then, after a few minutes, it is:
    shell@thl__T11 $ ip route show
    10.183.252.0/24 dev wlan0 proto kernel scope link src 10.183.252.254 metric$
    shell@thl__T11 $

    Anyway, after a short while, the DAV account seems to be deleted from the Android system along with the contacts and calendar entries.


  • developer

    Could it be that a connectivity drop (i.e. no packets can be sent, while the wifi connection itself is still perfectly fine) causes the DAV account to be removed?

    No.

    Anyway, after a short while, the DAV account seems to be deleted from the Android system along with the contacts and calendar entries.

    Did you install DAVdroid via Play Store? If so, did you try the DAVdroid JB Workaround?



  • no. I installed it via f-droid. I can try to get my hands on the JB Workaround though and test.


  • developer

    no. I installed it via f-droid. I can try to get my hands on the JB Workaround though and test.

    The workaround is only required for the Play Store version due to a DRM bug in some Play Store versions.

    Can you fetch logs for the time when the account is removed?



  • I've just experienced this issue after a reboot.
    To trigger this problem, I create the DAVDroid account as usual.
    Then I wait for the initial sync to be finished.
    I then wait for the Internet connection to drop (note that only the default gateway is deleted. The WiFi connection itself is fine).
    Then I reboot.
    Once the system is booted, the DAVDroid account is gone along with all contacts and calendar entries.

    Now that I can reproduce the problem, I can try the JB workaround, although it shouldn't be necessary as I don't have the for-pay version.


  • developer

    Then I reboot.

    Why?

    Do you think the problem is related to the reboot or to the unstable connection?

    May the "account is deleted on reboot" Android bug has been "extended" to non-encrypted versions (i.e. versions not from Play Store), too.



  • Now, I think the problem is much more related to rebooting rather than the unstable connection.

    Here is the log. I selected reboot on the phone. So the first half of the log is during shutdown.

    >./adb.linux logcat | egrep davdroid
    D/PowerManagerService(  712): acquireWakeLockInternal: lock=1188275272, flags=0x1, tag="*sync*/com.android.calendar/bitfire.at.davdroid/m", ws=WorkSource{10090}, uid=1000, pid=712
    D/PowerManagerNotifier(  712): onWakeLockAcquired: flags=1, tag="*sync*/com.android.calendar/bitfire.at.davdroid/m", packageName=android, ownerUid=1000, ownerPid=712, workSource=WorkSource{10090}
    D/ActivityThread( 4824): SVC-Creating service: CreateServiceData{token=android.os.BinderProxy@41e18db0 className=at.bitfire.davdroid.syncadapter.CalendarsSyncAdapterService packageName=at.bitfire.davdroid intent=null}
    D/ActivityThread( 4824): SVC-CREATE_SERVICE handled : 0 / CreateServiceData{token=android.os.BinderProxy@41e18db0 className=at.bitfire.davdroid.syncadapter.CalendarsSyncAdapterService packageName=at.bitfire.davdroid intent=null}
    D/ActivityThread( 4824): SVC-BIND_SERVICE handled : 0 / BindServiceData{token=android.os.BinderProxy@41e18db0 intent=Intent { act=android.content.SyncAdapter cmp=at.bitfire.davdroid/.syncadapter.CalendarsSyncAdapterService }}
    I/davdroid.SyncManager( 4824): Uploading 0 modified resource(s) (if not changed)
    E/davdroid.DavSyncAdapter( 4824): I/O error (Android will try again later)
    I/davdroid.DavSyncAdapter( 4824): Sync complete for com.android.calendar
    D/PowerManagerService(  712): releaseWakeLockInternal: lock=1188275272 [*sync*/com.android.calendar/bitfire.at.davdroid/m], flags=0x0, total_time=66ms
    D/PowerManagerNotifier(  712): onWakeLockReleased: flags=1, tag="*sync*/com.android.calendar/bitfire.at.davdroid/m", packageName=android, ownerUid=1000, ownerPid=712, workSource=WorkSource{10090}
    D/ActivityThread( 4824): SVC-UNBIND_SERVICE handled : 0 / BindServiceData{token=android.os.BinderProxy@41e18db0 intent=Intent { act=android.content.SyncAdapter cmp=at.bitfire.davdroid/.syncadapter.CalendarsSyncAdapterService }}
    D/ActivityThread( 4824): SVC-Destroying service: at.bitfire.davdroid.syncadapter.CalendarsSyncAdapterService@41e34e20
    D/davdroid.DavSyncAdapter( 4824): Closing httpClient
    D/SyncManager(  712): failed sync operation m u0 (bitfire.at.davdroid), com.android.calendar, POLL, latestRunTime 1212204, reason: AccountsUpdated, SyncResult: stats [ numIoExceptions: 1]
    I/AccountTypeManager( 1456): the   type is bitfire.at.davdroid the auth is = AuthenticatorDescription {type=bitfire.at.davdroid}
    D/AccountTypeManager( 1456): Registering external account type=bitfire.at.davdroid, packageName=at.bitfire.davdroid
    D/ActivityThread( 5725): BDC-Calling onReceive: intent=Intent { act=android.intent.action.ACTION_SHUTDOWN flg=0x10 cmp=at.bitfire.davdroid.jbworkaround/.ShutdownReceiver (has extras) }, ordered=true, receiver=at.bitfire.davdroid.jbworkaround.ShutdownReceiver@41dffe70
    I/davdroid.workaround( 5725): Re-enabling workaround authenticator
    D/ActivityThread( 5725): BDC-RECEIVER handled : 0 / ReceiverData{intent=Intent { act=android.intent.action.ACTION_SHUTDOWN flg=0x10 cmp=at.bitfire.davdroid.jbworkaround/.ShutdownReceiver (has extras) } packageName=at.bitfire.davdroid.jbworkaround resultCode=0 resultData=null resultExtras=null}
    
    I/AccountTypeManager( 1456): the   type is bitfire.at.davdroid the auth is = AuthenticatorDescription {type=bitfire.at.davdroid}
    D/AccountTypeManager( 1456): Registering external account type=bitfire.at.davdroid, packageName=at.bitfire.davdroid
    I/AccountTypeManager( 1456): the   type is bitfire.at.davdroid the auth is = AuthenticatorDescription {type=bitfire.at.davdroid}
    D/AccountTypeManager( 1456): Registering external account type=bitfire.at.davdroid, packageName=at.bitfire.davdroid
    
    
    D/SocketClient(  146): SocketClient msg = at.bitfire.davdroid-1
    D/SocketClient(  146): SocketClient sendDatalocked done: 111 79 at.bitfire.davdroid-1
    D/SocketClient(  146): SocketClient msg = at.bitfire.davdroid.jbworkaround-1
    D/SocketClient(  146): SocketClient sendDatalocked done: 111 79 at.bitfire.davdroid.jbworkaround-1
    D/VoldConnector(  712): RCV <- {111 79 at.bitfire.davdroid-1}
    D/VoldConnector(  712): RMV <- {111 79 at.bitfire.davdroid-1}
    D/VoldConnector(  712): RCV <- {111 79 at.bitfire.davdroid.jbworkaround-1}
    D/VoldConnector(  712): RMV <- {111 79 at.bitfire.davdroid.jbworkaround-1}
    D/VoldConnector(  712): SND -> {82 asec fspath at.bitfire.davdroid-1}
    D/FrameworkListener(  146): dispatchCommand data = (82 asec fspath at.bitfire.davdroid-1)
    D/VoldCmdListener(  146): asec fspath at.bitfire.davdroid-1
    D/SocketClient(  146): SocketClient msg = /mnt/secure/asec/at.bitfire.davdroid-1.asec
    D/SocketClient(  146): SocketClient sendDatalocked done: 211 82 /mnt/secure/asec/at.bitfire.davdroid-1.asec
    D/VoldConnector(  712): RCV <- {211 82 /mnt/secure/asec/at.bitfire.davdroid-1.asec}
    D/VoldConnector(  712): RMV <- {211 82 /mnt/secure/asec/at.bitfire.davdroid-1.asec}
    D/VoldConnector(  712): SND -> {83 asec path at.bitfire.davdroid-1}
    D/FrameworkListener(  146): dispatchCommand data = (83 asec path at.bitfire.davdroid-1)
    D/VoldCmdListener(  146): asec path at.bitfire.davdroid-1
    D/SocketClient(  146): SocketClient msg = /mnt/asec/at.bitfire.davdroid-1
    D/SocketClient(  146): SocketClient sendDatalocked done: 211 83 /mnt/asec/at.bitfire.davdroid-1
    D/VoldConnector(  712): RCV <- {211 83 /mnt/asec/at.bitfire.davdroid-1}
    D/VoldConnector(  712): RMV <- {211 83 /mnt/asec/at.bitfire.davdroid-1}
    D/VoldConnector(  712): SND -> {100 asec fspath at.bitfire.davdroid.jbworkaround-1}
    D/FrameworkListener(  146): dispatchCommand data = (100 asec fspath at.bitfire.davdroid.jbworkaround-1)
    D/VoldCmdListener(  146): asec fspath at.bitfire.davdroid.jbworkaround-1
    D/SocketClient(  146): SocketClient msg = /mnt/secure/asec/at.bitfire.davdroid.jbworkaround-1.asec
    D/SocketClient(  146): SocketClient sendDatalocked done: 211 100 /mnt/secure/asec/at.bitfire.davdroid.jbworkaround-1.asec
    D/VoldConnector(  712): RCV <- {211 100 /mnt/secure/asec/at.bitfire.davdroid.jbworkaround-1.asec}
    D/VoldConnector(  712): RMV <- {211 100 /mnt/secure/asec/at.bitfire.davdroid.jbworkaround-1.asec}
    D/VoldConnector(  712): SND -> {101 asec path at.bitfire.davdroid.jbworkaround-1}
    D/FrameworkListener(  146): dispatchCommand data = (101 asec path at.bitfire.davdroid.jbworkaround-1)
    D/VoldCmdListener(  146): asec path at.bitfire.davdroid.jbworkaround-1
    D/SocketClient(  146): SocketClient msg = /mnt/asec/at.bitfire.davdroid.jbworkaround-1
    D/SocketClient(  146): SocketClient sendDatalocked done: 211 101 /mnt/asec/at.bitfire.davdroid.jbworkaround-1
    D/VoldConnector(  712): RCV <- {211 101 /mnt/asec/at.bitfire.davdroid.jbworkaround-1}
    D/VoldConnector(  712): RMV <- {211 101 /mnt/asec/at.bitfire.davdroid.jbworkaround-1}
    I/ActivityManager(  712): Force stopping at.bitfire.davdroid.jbworkaround appid=10099 user=-1: uninstall pkg
    I/ActivityManager(  712): Killing 5725:at.bitfire.davdroid.jbworkaround/u0a99 (adj 11): stop at.bitfire.davdroid.jbworkaround
    I/ActivityManager(  712): Force stopping at.bitfire.davdroid appid=10090 user=-1: uninstall pkg
    I/ActivityManager(  712): Killing 4824:at.bitfire.davdroid:sync/u0a90 (adj 9): stop at.bitfire.davdroid
    I/ActivityManager(  712):   Force finishing activity ActivityRecord{471a5558 u0 at.bitfire.davdroid/.MainActivity t7}
    I/WindowState(  712): WIN DEATH: Window{476d6788 u0 at.bitfire.davdroid/at.bitfire.davdroid.MainActivity}
    I/ActivityManager(  712): Force stopping at.bitfire.davdroid.jbworkaround appid=10099 user=0: storage unmount
    I/ActivityManager(  712): Force stopping at.bitfire.davdroid appid=10090 user=0: storage unmount
    W/AccountManagerService(  712): deleting account m because type bitfire.at.davdroid no longer has a registered authenticator
    D/MobileManagerService(  712): handlePackageAvaliable() package: at.bitfire.davdroid.jbworkaround appId: 0
    D/MobileManagerService(  712): handlePackageAvaliable() package: at.bitfire.davdroid appId: 0
    D/CalendarProvider2( 2267): removing data for removed account Account {name=m, type=bitfire.at.davdroid}
    W/AccountTypeManager( 1456): No authenticator found for type=bitfire.at.davdroid, ignoring it.
    D/ProviderSimCardUtils(  939): account bitfire.at.davdroid is not SIM account
    D/ContactsProvider(  939): removing data for removed account AccountWithDataSet {name=m, type=bitfire.at.davdroid, dataSet=null}
    D/Launcher.Model( 1097): mAllAppsList.removePackage at.bitfire.davdroid.jbworkaround
    D/Launcher3( 1097): AllAppsList, removePackage: packageName = at.bitfire.davdroid.jbworkaround, data size = 41
    D/Launcher.Model( 1097): mAllAppsList.removePackage at.bitfire.davdroid
    D/Launcher3( 1097): AllAppsList, removePackage: packageName = at.bitfire.davdroid, data size = 36
    D/Launcher3( 1097): Launcher, bindComponentsRemoved: packageNames = [at.bitfire.davdroid.jbworkaround, eu.siacs.conversations, org.birthdayadapter, cm.aptoide.pt, com.sonelli.juicessh, at.bitfire.davdroid, org.tomdroid, com.iPass.OpenMobile, org.sufficientlysecure.viewer, com.google.zxing.client.android, com.noinnion.android.greader.readerpro], appInfos = [ApplicationInfo(title=DAVdroid JB Workaround id=-1 type=0 container=-1 screen=-1 cellX=-1 cellY=-1 spanX=1 spanY=1 dropPos=null pos = 0 isVisible = true), ApplicationInfo(title=Conversations id=-1 type=0 container=-1 screen=-1 cellX=-1 cellY=-1 spanX=1 spanY=1 dropPos=null pos = 0 isVisible = true), ApplicationInfo(title=Birthday Adapter id=-1 type=0 container=-1 screen=-1 cellX=-1 cellY=-1 spanX=1 spanY=1 dropPos=null pos = 0 isVisible = true), ApplicationInfo(title=Aptoide id=-1 type=0 container=-1 screen=-1 cellX=-1 cellY=-1 spanX=1 spanY=1 dropPos=null pos = 0 isVisible = true), ApplicationInfo(title=JuiceSSH id=-1 type=0 container=-1 screen=-1 cellX=-1 cellY=-1 spanX=1 spanY=1 dropPos=null pos = 0 isVisible = true), ApplicationInfo(title=DAVdroid id=-1 type=0 container=-1 screen=-1 cellX=-1 cellY=-1 spanX=1 spanY=1 dropPos=null pos = 0 isVisible = true), ApplicationInfo(title=Tomdroid id=-1 type=0 container=-1 screen=-1 cellX=-1 cellY=-1 spanX=1 spanY=1 dropPos=null pos = 0 isVisible = true), ApplicationInfo(title=iPass id=-1 type=0 container=-1 screen=-1 cellX=-1 cellY=-1 spanX=1 spanY=1 dropPos=null pos = 0 isVisible = true), ApplicationInfo(title=Document Viewer id=-1 type=0 container=-1 screen=-1 cellX=-1 cellY=-1 spanX=1 spanY=1 dropPos=null pos = 0 isVisible = true), ApplicationInfo(title=Barcode Scanner id=-1 type=0 container=-1 screen=-1 cellX=-1 cellY=-1 spanX=1 spanY=1 dropPos=null pos = 0 isVisible = true), ApplicationInfo(title=gReader Pro id=-1 type=0 container=-1 screen=-1 cellX=-1 cellY=-1 spanX=1 spanY=1 dropPos=null pos = 0 isVisible = true)], packageRemoved = false, permanent = false
    D/VoldConnector(  712): SND -> {102 asec unmount at.bitfire.davdroid.jbworkaround-1 force}
    D/FrameworkListener(  146): dispatchCommand data = (102 asec unmount at.bitfire.davdroid.jbworkaround-1 force)
    D/VoldCmdListener(  146): asec unmount at.bitfire.davdroid.jbworkaround-1 force
    ^[[1;2AD/VoldConnector(  712): SND -> {107 asec unmount at.bitfire.davdroid-1 force}
    D/FrameworkListener(  146): dispatchCommand data = (107 asec unmount at.bitfire.davdroid-1 force)
    D/VoldCmdListener(  146): asec unmount at.bitfire.davdroid-1 force
    W/VolumeManager(  146): at.bitfire.davdroid-1 unmount attempt 1 failed (Device or resource busy)
    E/ProcessKiller(  146): Process com.android.settings (1190) has open file /mnt/asec/at.bitfire.davdroid-1/pkg.apk
    E/ProcessKiller(  146): Process com.android.contacts (1456) has open file /mnt/asec/at.bitfire.davdroid-1/pkg.apk
    W/VolumeManager(  146): at.bitfire.davdroid-1 unmount attempt 2 failed (Device or resource busy)
    E/ProcessKiller(  146): Process com.android.settings (1190) has open file /mnt/asec/at.bitfire.davdroid-1/pkg.apk
    E/ProcessKiller(  146): Process com.android.contacts (1456) has open file /mnt/asec/at.bitfire.davdroid-1/pkg.apk
    W/VolumeManager(  146): at.bitfire.davdroid-1 unmount attempt 3 failed (Device or resource busy)
    E/ProcessKiller(  146): Process com.android.settings (1190) has open file /mnt/asec/at.bitfire.davdroid-1/pkg.apk
    E/ProcessKiller(  146): Process com.android.contacts (1456) has open file /mnt/asec/at.bitfire.davdroid-1/pkg.apk
    E/VoldConnector(  712): NDC Command {107 asec unmount at.bitfire.davdroid-1 force} took too long (5020ms)
    
    
    >./adb.linux logcat | egrep davdroid
    - waiting for device -
    W/PackageSettings(  718): Skipping PackageSetting{41e9a6a8 at.bitfire.davdroid.jbworkaround/10099} due to missing metadata
    W/PackageSettings(  718): Skipping PackageSetting{41e4c1d0 at.bitfire.davdroid/10090} due to missing metadata
    D/PackageController(  718): Installed packageName: at.bitfire.davdroid.jbworkaround appId: -1
    W/PackageController(  718): Pending the un-ready package: at.bitfire.davdroid.jbworkaround
    D/PackageController(  718): Installed packageName: at.bitfire.davdroid appId: -1
    W/PackageController(  718): Pending the un-ready package: at.bitfire.davdroid
    W/PackageSettings(  718): Skipping PackageSetting{41e9a6a8 at.bitfire.davdroid.jbworkaround/10099} due to missing metadata
    W/PackageSettings(  718): Skipping PackageSetting{41e4c1d0 at.bitfire.davdroid/10090} due to missing metadata
    I/AppOps  (  718): Pruning old package at.bitfire.davdroid/10090: new uid=-1
    D/DatabaseManager(  830): databaseMap = at.bitfire.davdroid
    E/DatabaseManager(  830): removedPkgList = [com.iPass.OpenMobile, com.sonelli.juicessh, org.sufficientlysecure.viewer, cm.aptoide.pt, eu.siacs.conversations, com.google.zxing.client.android, org.birthdayadapter, org.tomdroid, at.bitfire.davdroid, com.noinnion.android.greader.readerpro] check whether it installed under sdcard
    D/SocketClient(  146): SocketClient msg = at.bitfire.davdroid-1
    D/SocketClient(  146): SocketClient sendDatalocked done: 111 6 at.bitfire.davdroid-1
    D/SocketClient(  146): SocketClient msg = at.bitfire.davdroid.jbworkaround-1
    D/SocketClient(  146): SocketClient sendDatalocked done: 111 6 at.bitfire.davdroid.jbworkaround-1
    D/VoldConnector(  718): RCV <- {111 6 at.bitfire.davdroid-1}
    D/VoldConnector(  718): RMV <- {111 6 at.bitfire.davdroid-1}
    D/VoldConnector(  718): RCV <- {111 6 at.bitfire.davdroid.jbworkaround-1}
    D/VoldConnector(  718): RMV <- {111 6 at.bitfire.davdroid.jbworkaround-1}
    D/VoldConnector(  718): SND -> {11 asec fspath at.bitfire.davdroid-1}
    D/FrameworkListener(  146): dispatchCommand data = (11 asec fspath at.bitfire.davdroid-1)
    D/VoldCmdListener(  146): asec fspath at.bitfire.davdroid-1
    D/SocketClient(  146): SocketClient msg = /mnt/secure/asec/at.bitfire.davdroid-1.asec
    D/SocketClient(  146): SocketClient sendDatalocked done: 211 11 /mnt/secure/asec/at.bitfire.davdroid-1.asec
    D/VoldConnector(  718): RCV <- {211 11 /mnt/secure/asec/at.bitfire.davdroid-1.asec}
    D/VoldConnector(  718): RMV <- {211 11 /mnt/secure/asec/at.bitfire.davdroid-1.asec}
    D/VoldConnector(  718): SND -> {12 asec path at.bitfire.davdroid-1}
    D/FrameworkListener(  146): dispatchCommand data = (12 asec path at.bitfire.davdroid-1)
    D/VoldCmdListener(  146): asec path at.bitfire.davdroid-1
    D/SocketClient(  146): SocketClient msg = /mnt/asec/at.bitfire.davdroid-1
    D/SocketClient(  146): SocketClient sendDatalocked done: 211 12 /mnt/asec/at.bitfire.davdroid-1
    D/VoldConnector(  718): RCV <- {211 12 /mnt/asec/at.bitfire.davdroid-1}
    D/VoldConnector(  718): RMV <- {211 12 /mnt/asec/at.bitfire.davdroid-1}
    D/VoldConnector(  718): SND -> {29 asec fspath at.bitfire.davdroid.jbworkaround-1}
    D/FrameworkListener(  146): dispatchCommand data = (29 asec fspath at.bitfire.davdroid.jbworkaround-1)
    D/VoldCmdListener(  146): asec fspath at.bitfire.davdroid.jbworkaround-1
    D/SocketClient(  146): SocketClient msg = /mnt/secure/asec/at.bitfire.davdroid.jbworkaround-1.asec
    D/SocketClient(  146): SocketClient sendDatalocked done: 211 29 /mnt/secure/asec/at.bitfire.davdroid.jbworkaround-1.asec
    

    I noticed this line:
    W/AccountManagerService( 712): deleting account m because type bitfire.at.davdroid no longer has a registered authenticator
    note that this happens during shutdown.

    As you can see, I tried to use the JB workaround. But it doesn't help.


  • developer

    W/AccountManagerService( 712): deleting account m because type bitfire.at.davdroid no longer has a registered authenticator

    Funny…… sounds like another Android bug :+1:

    I'll investigate when I find time for it.



  • I've experimented a little. Just after rebooting (which caused the DAVDroid Account to be deleted) I noticed that when I quickly open the settings, the red JB workaround account button was available and got replaced with the green DAVDroid account after a few seconds.

    This led me to be believe that Android thinks the app has been removed
    I reinstalled from f-droid (I think I originally installed via adb) and I also move DAVDroid to the Phone storage. Since then the account is not removed when rebooting.

    So I guess Android doesn't like it when DAVDroid is not in phone storage.


  • developer

    So I guess Android doesn't like it when DAVDroid is not in phone storage.

    How were you able to move it to the SD card? DAVdroid sets the "install to internal storage only" field.



  • as I've said, via adb.


  • developer

    So this is the cause. DAVdroid may only be installed to internal storage.

    I guess I can close this issue now?


  • developer

    If the problem persists, please post here and I'll open the issue again.


Log in to reply
 

Looks like your connection to Bitfire App Forums was lost, please wait while we try to reconnect.