Exception when syncing "to much" data at once

  • I'm using DAVdroid 0.5.4-alpha (the version currently comming with F-Droid) and a sabredav 1.8.6 as server.
    When i'm doing a completely new sync of a quite big adressbook (just 82 contacts, but a lot of contacts with embedded pictures, so that the vcards have a size of 100-200kB) I get the following error (just the section that is important, I think):

    D/davdroid.SyncManager(12470): Adding 572b55fb-3b16-4d01-b06c-f972308baa96.vcf
    D/davdroid.SyncManager(12470): Adding 86427ff4-a1ee-46e3-bb62-448e9f1c8811.vcf
    D/davdroid.SyncManager(12470): Adding 71c333af-4224-48c6-92fb-a27272139749.vcf
    D/davdroid.SyncManager(12470): Adding 61d91dd2-4adc-41c3-8e17-cc3527f1b949.vcf
    D/davdroid.SyncManager(12470): Adding 298cce45-387a-4bb4-8cd1-8f4f86e1b699.vcf
    D/davdroid.SyncManager(12470): Adding ce79c505-305c-4ba3-8a05-6092ed4090b5.vcf
    D/davdroid.SyncManager(12470): Adding 3432c6fc-b7f8-4a43-b7dd-29f5a8cee9b0.vcf
    D/davdroid.SyncManager(12470): Adding 48243bc3-9eef-4d5e-be5b-d80122b7ce9e.vcf
    D/davdroid.LocalCollection(12470): Committing 190 operations
    E/JavaBinder(12470): !!! FAILED BINDER TRANSACTION !!!
    E/davdroid.DavSyncAdapter(12470): Local storage (content provider) exception
    E/davdroid.DavSyncAdapter(12470): at.bitfire.davdroid.resource.LocalStorageException: Couldn't access local content provider
    E/davdroid.DavSyncAdapter(12470): at at.bitfire.davdroid.resource.LocalCollection.commit(LocalCollection.java:230)
    E/davdroid.DavSyncAdapter(12470): at at.bitfire.davdroid.syncadapter.SyncManager.pullNew(SyncManager.java:177)
    E/davdroid.DavSyncAdapter(12470): at at.bitfire.davdroid.syncadapter.SyncManager.synchronize(SyncManager.java:75)
    E/davdroid.DavSyncAdapter(12470): at at.bitfire.davdroid.syncadapter.DavSyncAdapter.onPerformSync(DavSyncAdapter.java:69)
    E/davdroid.DavSyncAdapter(12470): at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:259)
    E/davdroid.DavSyncAdapter(12470): Caused by: android.os.TransactionTooLargeException
    E/davdroid.DavSyncAdapter(12470): at android.os.BinderProxy.transact(Native Method)
    E/davdroid.DavSyncAdapter(12470): at android.content.ContentProviderProxy.applyBatch(ContentProviderNative.java:510)
    E/davdroid.DavSyncAdapter(12470): at android.content.ContentProviderClient.applyBatch(ContentProviderClient.java:377)
    E/davdroid.DavSyncAdapter(12470): at at.bitfire.davdroid.resource.LocalCollection.commit(LocalCollection.java:227)
    E/davdroid.DavSyncAdapter(12470): ... 4 more
    D/SyncManager( 775): failed sync operation CalDav u0 (bitfire.at.davdroid), com.android.contacts, USER, latestRunTime 7401069, reason: 1000, SyncResult: databaseError: true stats []
    D/SyncManager( 775): not retrying sync operation because the error is a hard error: CalDav u0 (bitfire.at.davdroid), com.android.contacts, USER, latestRunTime 7421830, reason: 1000

    I don't have any experience with app developement for android, but as far as I can judge this, there is somewhere to much memory allocated (!!! FAILED BINDER TRANSACTION !!!) which throws this exception.

    Obviously it is because all vcards are transferred at once to the local storage, because the problem does not occure, when I add the contacts step by step (~20 contacts) to the carddav-server and always do a sync with davdroid in between.

    Maybe this issue is also connected with #134

  • developer

    Maybe I should reduce the limit of contacts/events transferred at once to only 25 instead of 35.

  • I think in my case even 25 contacts would be too much (I even got an error with 20 contacts when all contain a picture). Maybe this limit can be set dynamically according to the size of blob that should be transferred?

  • developer

    Omg that sounds complicated... I hate that I don't know what the maximum size of such a transaction is (it's not documented, at least haven't seen anything). How much RAM do you have?

  • It is a Nexus 5 (2GB), so the RAM should not be the problem.

  • developer

    Ok. Basically I see two options: Reducing the multi-get limit to 20 or 15, or commiting the transaction after every 10 contacts or so.

  • or commiting the transaction after every 10 contacts

    Sounds more suitable to me, as this is the real problem (as far as I understand) but you are the one, who knows the code ;-)

Log in to reply

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