Ok, so I’ll close this. If this issue persists and if you think that DAVdroid could do something better, please post here again and I’ll re-open.
Contact sync fails: Record not found in local content provider
DAVdroid version 0.8.1 from FDroid
Nexus 4 (and Nexus 7) running Android 5.1.1
ownCloud 8.1 DAV server
I’m having an issue with DavDroid syncing my contacts from ownCloud. This has worked in the past, and then suddenly started doing this. On two different android devices, I suddenly started getting failures with contacts with the error:
Record not found in local content provider
This can be seen at the bottom of log 1. Log 1 represents what happens on the device where I haven’t touched anything.
Snippet from end of log 1:
V/davdroid.URIUtils(32542): Normalized URI /owncloud/remote.php/carddav/addressbooks/USER/contacts/20140710204535.OHNhYHAhGSgrKzFsjgylng4@host.domain.com.vcf -> /owncloud/remote.php/carddav/addressbooks/USER/contacts/20140710204535.OHNhYHAhGSgrKzFsjgylng4@host.domain.com.vcf assuming that it was an URI or path name E/davdroid.DavSyncAdapter(32542): Local storage (content provider) exception E/davdroid.DavSyncAdapter(32542): at.bitfire.davdroid.resource.RecordNotFoundException: Record not found in local content provider E/davdroid.DavSyncAdapter(32542): at at.bitfire.davdroid.resource.LocalCollection.findByRemoteName(LocalCollection.java:252) E/davdroid.DavSyncAdapter(32542): at at.bitfire.davdroid.resource.LocalCollection.updateByRemoteName(LocalCollection.java:287) E/davdroid.DavSyncAdapter(32542): at at.bitfire.davdroid.syncadapter.SyncManager.pullChanged(SyncManager.java:201) E/davdroid.DavSyncAdapter(32542): at at.bitfire.davdroid.syncadapter.SyncManager.synchronize(SyncManager.java:88) E/davdroid.DavSyncAdapter(32542): at at.bitfire.davdroid.syncadapter.DavSyncAdapter.onPerformSync(DavSyncAdapter.java:137) E/davdroid.DavSyncAdapter(32542): at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:259) I/davdroid.DavSyncAdapter(32542): Sync complete for com.android.contacts D/davdroid.DavSyncAdapter(32542): Closing httpClient
Full log 1 download: https://dl.dropboxusercontent.com/u/11404738/github/Log1.txt
Device 2 (log 2) was doing the same thing as device 1, but I tried removing and re-adding the account. Now, device 2 has about 10 random contacts synchronized. When I force the sync, the Contacts app shows the contacts loading (about 400), but in the middle of synchronizing, it bombs out, and rolls back to the 10 random contacts. No error message is displayed on screen, but log 2 has everything in it.
Snippet from end of log 2:
D/davdroid.SyncManager( 5222): Adding 20140710204532.ybgGmZeS-u4Palzk8Brm3g1@host.domain.com.vcf D/davdroid.Collection( 5222): Committing 4 operations ... D/davdroid.Collection( 5222): ... 0 row(s) affected I/davdroid.SyncManager( 5222): Fetching 0 updated remote resource(s) I/davdroid.SyncManager( 5222): Removing non-dirty resources that are not present remotely anymore I/davdroid.SyncManager( 5222): Sync complete, fetching new CTag I/davdroid.DavSyncAdapter( 5222): Sync complete for com.android.contacts D/davdroid.DavSyncAdapter( 5222): Closing httpClient
Full log 2 download: https://dl.dropboxusercontent.com/u/11404738/github/Log2.txt
thanks for the bug report. It seems this is a duplicate of #578
To fix it please delete the “urlencode” in lib/carddav/backend.php in you Owncloud. Alternatively you can wait for the already existing oc patch to come live with an updated version of owncloud. Also please use DAVdroid 0.8.3, which is the latest version, to avoid other incompatibilities.
No good. I’m running DAVDroid 0.8.3 and Owncloud 8.1.0. I fixed apps/contacts/lib/carddav/backend.php as instructed, but I’m still getting this error.
Updated to OC 8.1.1 to no avail.
All right, my problem was solved by disabling Cyanogenmod’s Privacy Guard for DAVDroid.
Great that you found out!
@devvv4ever, thanks! Sorry to have located an ownCloud issue and represent it as a Dav one. Your recommendation has fixed things for me, so I’m going to close this out. Thanks again.
You’re welcome. Thanks for the update
I have the same problem since today …
Nothing is changed at owncloud or my phone, I only added 2 phone numbers to a contact.
What should i fix here:
[code]cat /var/www/owncloud/apps/contacts/lib/carddav/backend.php | grep urlencode
‘uri’ => urlencode($contact[‘uri’]),
Deleting contacts at the phone and resyncing is working, but no contacts are synced.
I completely removed the contact app folder and reinstalled it at owncloud.
At the owncloud log are also no errors about this sync failure and the davdroid app is also syncing successfully.