Database error - caldav and carddav detected but sync doesn't work

  • Hello everybody !

    I’m new here, so thank you for this app 🙂

    I installed DAVdroid a couple of days ago on my Android device, and i encountered some issues. First I have a xiaomi device, and thanks to this topic I could solve the auto-start problem.

    Current Issue:
    (I looked for a similar issue on the forum but didn’t find)

    But I still cannot sync my calendars and contacts. Every time I click on the sync button, I obtain this notification:

    Address book synchronization failed (<account name>)
    Database error while downloading remote entries

    And when I click on the notification, it redirects to the debug info.


    I use ownCloud (NextCloud in fact but it doesn’t matter I think) on a zaclys server (associative and free server, respect of privay, etc).
    My device is a Xiaomi Redmi 2A (in the debug info below: HM 2A) with Android 4.4.4 (KTU84Q, I don’t know what it means) and MIUI 8 (version 6.10.27) and I installed the latest version of DAVDroid from F-Droid.

    What I tried:

    I tried a lot of different urls to see if it changes something, but I think it’s not the problem (no error messages, I can properly create my account, etc). Examples:

    And it seems it’s not a server configuration issue, because the app detects the calendars and the contacts, as you can see on this screenshot:

    Debug info

    Here is the debug info, I hope it will help.

    Thank you for your attention and your help 🙂

  • developer


    at.bitfire.vcard4android.ContactsStorageException: Couldn't apply batch operation
    	at at.bitfire.vcard4android.BatchOperation.commit(
    	at at.bitfire.vcard4android.AndroidContact.create(
    	at at.bitfire.davdroid.syncadapter.ContactsSyncManager.processVCard(
    	at at.bitfire.davdroid.syncadapter.ContactsSyncManager.downloadRemote(
    	at at.bitfire.davdroid.syncadapter.SyncManager.performSync(
    	at at.bitfire.davdroid.syncadapter.ContactsSyncAdapterService$ContactsSyncAdapter.onPerformSync(
    	at android.content.AbstractThreadedSyncAdapter$
    Caused by: android.content.OperationApplicationException: App op not allowed
    	at android.database.DatabaseUtils.readExceptionWithOperationApplicationExceptionFromParcel(
    	at android.content.ContentProviderProxy.applyBatch(
    	at android.content.ContentProviderClient.applyBatch(
    	at at.bitfire.vcard4android.BatchOperation.runBatch(
    	at at.bitfire.vcard4android.BatchOperation.commit(
    	... 6 more

    According to the error message, DAVdroid is not allowed to insert the contact into the address book.

    Android version: 4.4.4 (KTU84P)
    Device: Xiaomi HM 2A (lte26007)

    As far as I have heard, there is a special permission and privileges system for Xiaomi. Please check the app permissions, see also FAQ: [Xiaomi MIUI] How do I enable DAVdroid synchronization?.


    Ow… I feel so stupid…

    Sorry for the disturbance 😅 and thank you for your answer.

    I spent so much time and looked for so many solutions and I just forgot to give the app the permission to read and modify contacts and calendars 😑

    For those who don’t know how to manage the permissions in MIUI:

    Method 1: App Settings, scroll down, Permissions, Permissions, look for DAVDroid app, finally accept the permissions Modify and delete contacts, Read your contacts and Read calendar events.

    Method 2: App Security (may be in the folder Tools on the main homepage), Permissions, Permissions, look for DAVDroid app, finally accept the permissions Modify and delete contacts, Read your contacts and Read calendar events.

  • developer

    @TheFreeBeginner Thanks for confirming the solution.

Similar topics