CardDAV problem with OC 9.0.4 & DAVDroid

Hi,

when I use DAVDroid on my cellphone for synchronising contacts, I have constantly an alert "synchronisation failed" with this log :

DavDroid error LOG
Synchronization phase: 9
Account name: id
Authority: com.android.contacts

HTTP REQUEST:
REPORT /owncloud/remote.php/dav/addressbooks/users/id/default/
Content-Length: 1271
Content-Type: application/xml; charset=utf-8
Depth: 0

<?xml version='1.0' encoding='UTF-8' ?>/owncloud/remote.php/dav/addressbooks/users/id/default/2612ffc0-c14b-4ba8-955b-f80e492f8173.vcf/owncloud/remote.php/dav/addressbooks/users/id/default/70858f3d-f074-4027-b628-2e7025b52137.vcf/owncloud/remote.php/dav/addressbooks/users/id/default/b8557955-d604-4cb4-8e54-8f739b8e6969.vcf/owncloud/remote.php/dav/addressbooks/users/id/default/811a9cb9-7aac-4b3d-a2cf-98ce6100ca3a.vcf/owncloud/remote.php/dav/addressbooks/users/id/default/c1285ebe-f0c1-495f-9ece-67f2cc749e98.vcf/owncloud/remote.php/dav/addressbooks/users/id/default/d3f3666e-f30d-4e6d-85c9-6942261f3e0d.vcf/owncloud/remote.php/dav/addressbooks/users/id/default/4cf33925-0d08-4467-a2a3-2072f60d7591.vcf/owncloud/remote.php/dav/addressbooks/users/id/default/401e6dd6-9d6e-439c-aff0-c16ada5e4f4c.vcf/owncloud/remote.php/dav/addressbooks/users/id/default/ada8bcb8-d7ca-43cb-9a96-004b31fd38c0.vcf

HTTP RESPONSE:
http/1.1 500 Internal Server Error
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection: close
Content-Length: 248
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *
Content-Type: application/xml; charset=utf-8
Date: Wed, 20 Jul 2016 16:23:38 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
Server: Apache/2.4.7 (Ubuntu)
Strict-Transport-Security: max-age=15768000
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Powered-By: PHP/5.5.9-1ubuntu4.17
X-Robots-Tag: none
X-XSS-Protection: 1; mode=block

<?xml version="1.0" encoding="utf-8"?>[LF]
[LF]
InvalidArgumentException[LF]
Only vCard 2.1, 3.0 and 4.0 are supported for the input data[LF]
[LF]

EXCEPTION:
at.bitfire.dav4android.exception.HttpException: 500 Internal Server Error
at at.bitfire.dav4android.DavResource.checkStatus(DavResource.java:316)
at at.bitfire.dav4android.DavResource.checkStatus(DavResource.java:289)
at at.bitfire.dav4android.DavAddressBook.multiget(DavAddressBook.java:109)
at at.bitfire.davdroid.syncadapter.ContactsSyncManager.downloadRemote(ContactsSyncManager.java:337)
at at.bitfire.davdroid.syncadapter.SyncManager.performSync(SyncManager.java:171)
at at.bitfire.davdroid.syncadapter.ContactsSyncAdapterService$ContactsSyncAdapter.onPerformSync(ContactsSyncAdapterService.java:66)
at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:272)

SOFTWARE INFORMATION
DAVdroid version: 1.2-gplay (109) Sat Jul 02 12:34:34 GMT+02:00 2016
Installed from: com.android.vending
JB Workaround installed: no

CONFIGURATION
System-wide synchronization: automatically
Account: id
Address book sync. interval: 240 min
Calendar sync. interval: 240 min
OpenTasks sync. interval: 240 min
Preemptive auth: true
WiFi only: false
[CardDAV] Contact group method: GROUP_VCARDS
RFC 6868 encoding: true
[CalDAV] Time range (past days): 90
Manage calendar colors: true

SQLITE DUMP
android_metadata
| locale |
| fr_FR |


settings
| setting | value |


services
| _id | accountName | service | principal |
| 1 | id | carddav | \https://www.mydomain.com/owncloud/remote.php/dav/principals/users/id/ |
| 2 | id | caldav | \https://www.mydomain.com/owncloud/remote.php/dav/principals/users/id/ |


sqlite_sequence
| name | seq |
| services | 2 |
| homesets | 3 |
| collections | 4 |


homesets
| _id | serviceID | url |
| 2 | 2 | \https://www.mydomain.com/owncloud/remote.php/dav/calendars/id/ |
| 3 | 1 | \https://www.mydomain.com/owncloud/remote.php/dav/addressbooks/users/id/ |


collections
| _id | serviceID | url | readOnly | displayName | description | color | timezone | supportsVEVENT | supportsVTODO | sync |
| 2 | 2 | \https://www.mydomain.com/owncloud/remote.php/dav/calendars/id/contact_birthdays/ | 1 | Contact birthdays | | -54 | | 1 | 1 | 0 |
| 3 | 2 | \https://www.mydomain.com/owncloud/remote.php/dav/calendars/id/default/ | 0 | default | | | | 1 | 1 | 0 |
| 4 | 1 | \https://www.mydomain.com/owncloud/remote.php/dav/addressbooks/users/id/default/ | 0 | default | | | | | | 1 |


SYSTEM INFORMATION
Android version: 6.0.1 (bacon-userdebug 6.0.1 MMB29V 53ca64dc6e test-keys)[/details]

I took the instructions of the link above.
https://forum.owncloud.org/viewtopic.php?f=17&t=7536
I installed Litmus and run it :

root@serveur:/usr/src/litmus-0.13# litmus -k https://mydomain.com/owncloud/remote.php/webdav id #####
-> running basic':
0. init.................. pass
1. begin................. pass
2. options............... WARNING: server does not claim Class 2 compliance
...................... pass (with 1 warning)
3. put_get............... pass
4. put_get_utf8_segment.. pass
5. put_no_parent......... pass
6. mkcol_over_plain...... pass
7. delete................ pass
8. delete_null........... pass
9. delete_fragment....... pass
10. mkcol................. pass
11. mkcol_again........... pass
12. delete_coll........... pass
13. mkcol_no_parent....... pass
14. mkcol_with_body....... pass
15. finish................ pass
<- summary for
basic': of 16 tests run: 16 passed, 0 failed. 100.0%
-> 1 warning was issued.
-> running copymove':
0. init.................. pass
1. begin................. pass
2. copy_init............. pass
3. copy_simple........... pass
4. copy_overwrite........ pass
5. copy_nodestcoll....... pass
6. copy_cleanup.......... pass
7. copy_coll............. pass
8. copy_shallow.......... pass
9. move.................. pass
10. move_coll............. pass
11. move_cleanup.......... pass
12. finish................ pass
<- summary for
copymove': of 13 tests run: 13 passed, 0 failed. 100.0%
-> running props':
0. init.................. pass
1. begin................. pass
2. propfind_invalid...... pass
3. propfind_invalid2..... pass
4. propfind_d0........... pass
5. propinit.............. pass
6. propset............... pass
7. propget............... pass
8. propextended.......... pass
9. propmove.............. pass
10. propget............... pass
11. propdeletes........... pass
12. propget............... pass
13. propreplace........... pass
14. propget............... pass
15. propnullns............ pass
16. propget............... pass
17. prophighunicode....... pass
18. propget............... FAIL (Property {http://example.com/neon/litmus/}high-unicode had value , expected š€€)
19. propremoveset......... pass
20. propget............... pass
21. propsetremove......... pass
22. propget............... pass
23. propvalnspace......... pass
24. propwformed........... pass
25. propinit.............. pass
26. propmanyns............ pass
27. propget............... pass
28. propcleanup........... pass
29. finish................ pass
<- summary for
props': of 30 tests run: 29 passed, 1 failed. 96.7%
-> running locks':
0. init.................. pass
1. begin................. pass
2. options............... WARNING: server does not claim Class 2 compliance
...................... pass (with 1 warning)
3. precond............... SKIPPED (locking tests skipped,
server does not claim Class 2 compliance)
-> 1 test was skipped.
<- summary for
locks': of 3 tests run: 3 passed, 0 failed. 100.0%
-> 1 warning was issued.
-> running http':
0. init.................. pass
1. begin................. pass
2. expect100............. SKIPPED (skipping for SSL server)
3. finish................ pass
-> 1 test was skipped.
<- summary for
http': of 3 tests run: 3 passed, 0 failed. 100.0%
root@serveur:/usr/src/litmus-0.13#

Can you help me to find a solution?

Hi,

the litmus test looks good. However you're getting an 500 internal server error. This is just a generic error without any additional info. You need to have a look at your servers logfiles like described here:

to see the source of this issue.

Thanks for your advice. I found this into the log.

InvalidArgumentException: Only vCard 2.1, 3.0 and 4.0 are supported for the input data

0.    /var/www/owncloud/3rdparty/sabre/vobject/lib/Component/VCard.php - line 175: Sabre\VObject\VCardConverter->convert(Object(Sabre\VObject\Component\VCard), 6)

1.    /var/www/owncloud/3rdparty/sabre/dav/lib/CardDAV/Plugin.php - line 804: Sabre\VObject\Component\VCard->convert(6)

2.    /var/www/owncloud/3rdparty/sabre/dav/lib/CardDAV/Plugin.php - line 259: Sabre\CardDAV\Plugin->convertVCard('BEGIN VCARD??UI...', 'vcard4')

3.    /var/www/owncloud/3rdparty/sabre/dav/lib/CardDAV/Plugin.php - line 198: Sabre\CardDAV\Plugin->addressbookMultiGetReport(Object(Sabre\CardDAV\Xml\Request\AddressBookMultiGetReport))

4.    [internal function] Sabre\CardDAV\Plugin->report('{urn ietf param...', Object(Sabre\CardDAV\Xml\Request\AddressBookMultiGetReport), 'addressbooks/us...')

5.    /var/www/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)

6.    /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 716: Sabre\Event\EventEmitter->emit('report', Array)

7.    [internal function] Sabre\DAV\CorePlugin->httpReport(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))

8.    /var/www/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)

9.    /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 459: Sabre\Event\EventEmitter->emit('method REPORT', Array)

10.    /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 248: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))

11.    /var/www/owncloud/apps/dav/lib/server.php - line 150: Sabre\DAV\Server->exec()

12.    /var/www/owncloud/apps/dav/appinfo/v2/remote.php - line 29: OCA\DAV\Server->exec()

13.    /var/www/owncloud/remote.php - line 138: require_once('/var/www/ownclo...')

14.    {main}

Do you think the problem is one of my vcard contact file? I made several contacts on my macbook with apple contacts application.

Yes, that looks like an issue within one or more contacts / VCARDS.

Finaly it isn't contacts / VCARDS problem.
I deleted all contacts on the owncloud app and on my cellphone. I made two contacts for testing with the owncloud app and the problem is still here.
:frowning: I don't know what to do ...

Please report a new issue to https://github.com/owncloud/core/issues

Have you tried a different Sync app on your phone?
I use Caldavsync and have no problems syncing.

The link is to the paid version - but the author has a free version to which you can try.