REV MUST NOT appear more than once in a VCARD component


  • developer

    Why does this happen

    Please read this thread.

    and how can I correct this problem?

    1. Please upgrade to a version of Nextcloud Contacts where the problem has been fixed.
    2. Make sure that your server doesn’t serve any VCard with the questionable REV time format.
    3. Synchronize all contacts again. You can delete the DAVdroid account and add it again (or de-select the address book, synchronize, select it again, synchronize).


  • Thank you for your answer but i confused to say that Nextcloud patch don’t solve issue.
    Here are the tests performed :

    1. Create contact on nextcloud
    2. Sync phone with davdroid

    2016-12-18 00:43:15 2 [HttpClient$1] Content-Type: text/vcard; version=4.0; charset=utf-8
    2016-12-18 00:43:15 2 [HttpClient$1]
    2016-12-18 00:43:15 2 [HttpClient$1] BEGIN:VCARD
    VERSION:4.0
    PRODID:-//Sabre//Sabre VObject 4.1.1//EN
    FN:AAA
    UID:5113db8d-c84b-41cd-9c76-57a742ccc595
    EMAIL;TYPE=HOME:0102030405
    REV:20161217T234249
    END:VCARD
    2016-12-18 00:43:15 2 [HttpClient$1] <-- END HTTP (178-byte body)

    1. Modify contact on the phone
    2. Sync with Davdroid (error 415 Unsupported Media Type)

    2016-12-18 00:59:05 1 [syncadapter.SyncAdapterService$SyncAdapter] Sync for com.android.contacts has been initiated
    2016-12-18 00:59:05 1 [AccountSettings] Account Vince has version 4, current version: 4
    2016-12-18 00:59:05 1 [AccountSettings] Account Vince has version 4, current version: 4
    2016-12-18 00:59:05 0 [cert4android.CustomCertManager$1] Connected to service
    2016-12-18 00:59:05 1 [syncadapter.SyncManager] Preparing synchronization
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering DAV property factories
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.AddressbookDescription$Factory for addressbook-description(urn:ietf:params:xml:ns:carddav)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.AddressbookHomeSet$Factory for addressbook-home-set(urn:ietf:params:xml:ns:carddav)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.AddressData$Factory for address-data(urn:ietf:params:xml:ns:carddav)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.CalendarColor$Factory for calendar-color(http://apple.com/ns/ical/)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.CalendarData$Factory for calendar-data(urn:ietf:params:xml:ns:caldav)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.CalendarDescription$Factory for calendar-description(urn:ietf:params:xml:ns:caldav)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.CalendarHomeSet$Factory for calendar-home-set(urn:ietf:params:xml:ns:caldav)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.CalendarProxyReadFor$Factory for calendar-proxy-read-for(http://calendarserver.org/ns/)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.CalendarProxyWriteFor$Factory for calendar-proxy-write-for(http://calendarserver.org/ns/)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.CalendarTimezone$Factory for calendar-timezone(urn:ietf:params:xml:ns:caldav)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.CalendarUserAddressSet$Factory for calendar-user-address-set(urn:ietf:params:xml:ns:caldav)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.CurrentUserPrincipal$Factory for current-user-principal(DAV:)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.CurrentUserPrivilegeSet$Factory for current-user-privilege-set(DAV:)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.DisplayName$Factory for displayname(DAV:)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.GetContentType$Factory for getcontenttype(DAV:)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.GetCTag$Factory for getctag(http://calendarserver.org/ns/)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.GetETag$Factory for getetag(DAV:)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.GetLastModified$Factory for getlastmodified(DAV:)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.GroupMembership$Factory for group-membership(DAV:)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.ResourceType$Factory for resourcetype(DAV:)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.SupportedAddressData$Factory for supported-address-data(urn:ietf:params:xml:ns:carddav)
    2016-12-18 00:59:05 1 [dav4android.PropertyRegistry] Registering at.bitfire.dav4android.property.SupportedCalendarComponentSet$Factory for supported-calendar-component-set(urn:ietf:params:xml:ns:caldav)
    2016-12-18 00:59:05 1 [syncadapter.SyncManager] Querying capabilities
    2016-12-18 00:59:05 1 [HttpClient$1] --> PROPFIND https://xxxxxxxxxxxxxxx/remote.php/dav/addressbooks/users/vince/contacts/ http/1.1
    2016-12-18 00:59:05 1 [HttpClient$1] Content-Type: application/xml; charset=utf-8
    2016-12-18 00:59:05 1 [HttpClient$1] Content-Length: 258
    2016-12-18 00:59:05 1 [HttpClient$1] Depth: 0
    2016-12-18 00:59:05 1 [HttpClient$1]
    2016-12-18 00:59:05 1 [HttpClient$1] <?xml version=‘1.0’ encoding=‘UTF-8’ ?><propfind xmlns=“DAV:” xmlns:CAL=“urn:ietf:params:xml:ns:caldav” xmlns:CARD=“urn:ietf:params:xml:ns:carddav”><prop><CARD:supported-address-data /><n0:getctag xmlns:n0=“http://calendarserver.org/ns/” /></prop></propfind>
    2016-12-18 00:59:05 1 [HttpClient$1] --> END PROPFIND (258-byte body)
    2016-12-18 00:59:05 1 [cert4android.CustomCertManager$CustomHostnameVerifier] Verifying certificate for xxxxxxxxxxxxxxx
    2016-12-18 00:59:05 1 [dav4android.BasicDigestAuthHandler] Trying Basic auth preemptively
    2016-12-18 00:59:05 1 [dav4android.BasicDigestAuthHandler] Adding Basic authorization header for https://xxxxxxxxxxxxxxx/remote.php/dav/addressbooks/users/vince/contacts/
    2016-12-18 00:59:06 1 [HttpClient$1] <-- 207 Multi-Status https://xxxxxxxxxxxxxxx/remote.php/dav/addressbooks/users/vince/contacts/ (288ms)
    2016-12-18 00:59:06 1 [HttpClient$1] Date: Sat, 17 Dec 2016 23:59:21 GMT
    2016-12-18 00:59:06 1 [HttpClient$1] Server: Apache
    2016-12-18 00:59:06 1 [HttpClient$1] Strict-Transport-Security: max-age=15768000; includeSubDomains; preload
    2016-12-18 00:59:06 1 [HttpClient$1] Set-Cookie: ocuki09hwg9i=sa42avn3moo7m7nf6diupd1nj0; path=/; HttpOnly
    2016-12-18 00:59:06 1 [HttpClient$1] Expires: Thu, 19 Nov 1981 08:52:00 GMT
    2016-12-18 00:59:06 1 [HttpClient$1] Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    2016-12-18 00:59:06 1 [HttpClient$1] Pragma: no-cache
    2016-12-18 00:59:06 1 [HttpClient$1] Set-Cookie: oc_sessionPassphrase=Tz6evWIZG6R86x8JyrCLZJRluMmMOuGDje2pJ7ZxoZIbB%2BX4QYU%2FnTyn3TpyabkoONaR8XtW3ElWXLTn2r1s2X1KmRfuRFdPPsyPxMB%2Bl69Jmf77fMkFRlba7EA8aQYS; path=/; secure; httponly
    2016-12-18 00:59:06 1 [HttpClient$1] Content-Security-Policy: default-src ‘none’;
    2016-12-18 00:59:06 1 [HttpClient$1] Set-Cookie: __Host-nc_sameSiteCookielax=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=lax
    2016-12-18 00:59:06 1 [HttpClient$1] Set-Cookie: __Host-nc_sameSiteCookiestrict=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=strict
    2016-12-18 00:59:06 1 [HttpClient$1] Set-Cookie: ocuki09hwg9i=5t5jp379l2gr3ncj8uc7ob5ce5; path=/; secure; HttpOnly
    2016-12-18 00:59:06 1 [HttpClient$1] Set-Cookie: cookie_test=test; expires=Sun, 18-Dec-2016 00:59:22 GMT; Max-Age=3600
    2016-12-18 00:59:06 1 [HttpClient$1] Vary: Brief,Prefer
    2016-12-18 00:59:06 1 [HttpClient$1] DAV: 1, 3, extended-mkcol, access-control, calendarserver-principal-property-search, calendar-access, calendar-proxy, calendar-auto-schedule, calendar-availability, calendarserver-subscribed, oc-resource-sharing, oc-calendar-publishing, calendarserver-sharing, addressbook
    2016-12-18 00:59:06 1 [HttpClient$1] X-Content-Type-Options: nosniff
    2016-12-18 00:59:06 1 [HttpClient$1] X-XSS-Protection: 1; mode=block
    2016-12-18 00:59:06 1 [HttpClient$1] X-Robots-Tag: none
    2016-12-18 00:59:06 1 [HttpClient$1] X-Frame-Options: SAMEORIGIN
    2016-12-18 00:59:06 1 [HttpClient$1] X-Download-Options: noopen
    2016-12-18 00:59:06 1 [HttpClient$1] X-Permitted-Cross-Domain-Policies: none
    2016-12-18 00:59:06 1 [HttpClient$1] Content-Length: 821
    2016-12-18 00:59:06 1 [HttpClient$1] Content-Type: application/xml; charset=utf-8
    2016-12-18 00:59:06 1 [HttpClient$1]
    2016-12-18 00:59:06 1 [HttpClient$1] <?xml version=“1.0”?>
    <d:multistatus xmlns:d=“DAV:” xmlns:s=“http://sabredav.org/ns” xmlns:cal=“urn:ietf:params:xml:ns:caldav” xmlns:cs=“http://calendarserver.org/ns/” xmlns:card=“urn:ietf:params:xml:ns:carddav” xmlns:oc=“http://owncloud.org/ns” xmlns:nc=“http://nextcloud.org/ns”>
    <d:response>
    <d:href>/remote.php/dav/addressbooks/users/vince/contacts/</d:href>
    <d:propstat>
    <d:prop>
    card:supported-address-data
    <card:address-data-type content-type=“text/vcard” version=“3.0”/>
    <card:address-data-type content-type=“text/vcard” version=“4.0”/>
    <card:address-data-type content-type=“application/vcard+json” version=“4.0”/>
    </card:supported-address-data>
    cs:getctag299</cs:getctag>
    </d:prop>
    <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    </d:response>
    </d:multistatus>

    2016-12-18 00:59:06 1 [HttpClient$1] <-- END HTTP (821-byte body)
    2016-12-18 00:59:06 1 [dav4android.DavResource] Received <response> for https://xxxxxxxxxxxxxxx/remote.php/dav/addressbooks/users/vince/contacts/
    PARAMETER #1 = [getctag(http://calendarserver.org/ns/😞 GetCTag(cTag=299), supported-address-data(urn:ietf:params:xml:ns:carddav): at.bitfire.dav4android.property.SupportedAddressData@13a65f51]
    2016-12-18 00:59:06 1 [syncadapter.ContactsSyncManager] Server advertises VCard/4 support: true
    2016-12-18 00:59:06 1 [syncadapter.ContactsSyncManager] Contact group method: GROUP_VCARDS
    2016-12-18 00:59:06 1 [syncadapter.SyncManager] Processing locally deleted entries
    2016-12-18 00:59:06 1 [syncadapter.SyncManager] Locally preparing dirty entries
    2016-12-18 00:59:06 1 [syncadapter.SyncManager] Looking for contacts/groups without file name
    2016-12-18 00:59:06 1 [syncadapter.ContactsSyncManager] Looking for changed group memberships of contact 5113db8d-c84b-41cd-9c76-57a742ccc595.vcf
    2016-12-18 00:59:06 1 [syncadapter.SyncManager] Uploading dirty entries
    2016-12-18 00:59:06 1 [syncadapter.ContactsSyncManager] Preparing upload of VCard 5113db8d-c84b-41cd-9c76-57a742ccc595.vcf
    PARAMETER #1 = Contact(uid=5113db8d-c84b-41cd-9c76-57a742ccc595, displayName=AAA, givenName=AAA, familyName=null)
    2016-12-18 00:59:06 1 [syncadapter.SyncManager] Uploading locally modified record 5113db8d-c84b-41cd-9c76-57a742ccc595.vcf
    2016-12-18 00:59:06 1 [HttpClient$1] --> PUT https://xxxxxxxxxxxxxxx/remote.php/dav/addressbooks/users/vince/contacts/5113db8d-c84b-41cd-9c76-57a742ccc595.vcf http/1.1
    2016-12-18 00:59:06 1 [HttpClient$1] Content-Type: text/vcard;version=4.0
    2016-12-18 00:59:06 1 [HttpClient$1] Content-Length: 294
    2016-12-18 00:59:06 1 [HttpClient$1] If-Match: “ba8496e3babe191f2c3c93c6dde6a067”
    2016-12-18 00:59:06 1 [HttpClient$1]
    2016-12-18 00:59:06 1 [HttpClient$1] BEGIN:VCARD
    VERSION:4.0
    PRODID:+//IDN bitfire.at//DAVdroid/1.3.4.1-ose vcard4android ez-vcard/0.10.
    0
    REV;VALUE=timestamp:20161217T234249
    UID:5113db8d-c84b-41cd-9c76-57a742ccc595
    FN:AAA
    N:;AAA;;;
    EMAIL;TYPE=home:0102030405
    EMAIL;TYPE=work:aaa@bbb.cc
    REV:20161217T235906Z
    END:VCARD

    2016-12-18 00:59:06 1 [HttpClient$1] --> END PUT (294-byte body)
    2016-12-18 00:59:06 1 [dav4android.BasicDigestAuthHandler] Adding Basic authorization header for https://xxxxxxxxxxxxxxx/remote.php/dav/addressbooks/users/vince/contacts/5113db8d-c84b-41cd-9c76-57a742ccc595.vcf
    2016-12-18 00:59:06 1 [HttpClient$1] <-- 415 Unsupported Media Type https://xxxxxxxxxxxxxxx/remote.php/dav/addressbooks/users/vince/contacts/5113db8d-c84b-41cd-9c76-57a742ccc595.vcf (195ms)
    2016-12-18 00:59:06 1 [HttpClient$1] Date: Sat, 17 Dec 2016 23:59:22 GMT
    2016-12-18 00:59:06 1 [HttpClient$1] Server: Apache
    2016-12-18 00:59:06 1 [HttpClient$1] Strict-Transport-Security: max-age=15768000; includeSubDomains; preload
    2016-12-18 00:59:06 1 [HttpClient$1] Expires: Thu, 19 Nov 1981 08:52:00 GMT
    2016-12-18 00:59:06 1 [HttpClient$1] Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    2016-12-18 00:59:06 1 [HttpClient$1] Pragma: no-cache
    2016-12-18 00:59:06 1 [HttpClient$1] Content-Security-Policy: default-src ‘none’;
    2016-12-18 00:59:06 1 [HttpClient$1] Set-Cookie: nc_username=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; secure; httponly
    2016-12-18 00:59:06 1 [HttpClient$1] Set-Cookie: nc_token=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; secure; httponly
    2016-12-18 00:59:06 1 [HttpClient$1] Set-Cookie: nc_session_id=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; secure; httponly
    2016-12-18 00:59:06 1 [HttpClient$1] Set-Cookie: nc_username=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; secure; httponly
    2016-12-18 00:59:06 1 [HttpClient$1] Set-Cookie: nc_token=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; secure; httponly
    2016-12-18 00:59:06 1 [HttpClient$1] Set-Cookie: nc_session_id=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; secure; httponly
    2016-12-18 00:59:06 1 [HttpClient$1] Set-Cookie: ocuki09hwg9i=p250kmsp726hurc4r1kiuk2u34; path=/; secure; HttpOnly
    2016-12-18 00:59:06 1 [HttpClient$1] Set-Cookie: ocuki09hwg9i=ulqbeve49d12m1d5ipm3k3op05; path=/; secure; HttpOnly
    2016-12-18 00:59:06 1 [HttpClient$1] X-Content-Type-Options: nosniff
    2016-12-18 00:59:06 1 [HttpClient$1] X-XSS-Protection: 1; mode=block
    2016-12-18 00:59:06 1 [HttpClient$1] X-Robots-Tag: none
    2016-12-18 00:59:06 1 [HttpClient$1] X-Frame-Options: SAMEORIGIN
    2016-12-18 00:59:06 1 [HttpClient$1] X-Download-Options: noopen
    2016-12-18 00:59:06 1 [HttpClient$1] X-Permitted-Cross-Domain-Policies: none
    2016-12-18 00:59:06 1 [HttpClient$1] Content-Length: 286
    2016-12-18 00:59:06 1 [HttpClient$1] Content-Type: application/xml; charset=utf-8
    2016-12-18 00:59:06 1 [HttpClient$1]
    2016-12-18 00:59:06 1 [HttpClient$1] <?xml version=“1.0” encoding=“utf-8”?>
    <d:error xmlns:d=“DAV:” xmlns:s=“http://sabredav.org/ns”>
    <s:exception>Sabre\DAV\Exception\UnsupportedMediaType</s:exception>
    <s:message>Validation error in vCard: REV MUST NOT appear more than once in a VCARD component</s:message>
    </d:error>

    2016-12-18 00:59:06 1 [HttpClient$1] <-- END HTTP (286-byte body)
    2016-12-18 00:59:06 1 [syncadapter.SyncManager] HTTP/DAV Exception during sync
    EXCEPTION at.bitfire.dav4android.exception.HttpException: 415 Unsupported Media Type
    at at.bitfire.dav4android.DavResource.checkStatus(DavResource.java:318)
    at at.bitfire.dav4android.DavResource.checkStatus(DavResource.java:291)
    at at.bitfire.dav4android.DavResource.put(DavResource.java:202)
    at at.bitfire.davdroid.syncadapter.SyncManager.uploadDirty(SyncManager.java:317)
    at at.bitfire.davdroid.syncadapter.SyncManager.performSync(SyncManager.java:147)
    at at.bitfire.davdroid.syncadapter.ContactsSyncAdapterService$ContactsSyncAdapter.onPerformSync(ContactsSyncAdapterService.java:66)
    at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:259)

    2016-12-18 00:59:06 1 [syncadapter.ContactsSyncAdapterService$ContactsSyncAdapter] Address book sync complete


  • developer

    You’re right, it’s not fixed. Starting from the beginning.



  • Hey people,

    thanks for reporting this problem again. As @rfc2822 already wrote, this problem is not yet fixed completely. Since DAVdroid is depending on ez-vcard for contact parsing this needs to be improved inside this lib. The good thing - the developer of ez-vcard is already working on it and we will incorporate the latest version into DAVdroid soon.

    In the meantime we recommend that you use any Nextcloud contacts app version except version 1.5.2. After we’ve released DAVdroid 1.3.5.1 you can again use the latest Nextcloud contacts app.



  • Thank you very much for your work


  • developer

    Should have been fixed in vcard4android/28140042 with ez-vcard 0.10.1 (thanks Mike) and thus work again in the next DAVdroid version.


  • developer

    DAVdroid 1.3.6 now understands timestamp values with milliseconds (and some other formats). If you have this problem (415 Unsupported Media Type with REV MUST NOT appear more than once in a VCARD component😞

    1. update to DAVdroid 1.3.6
    2. force re-download of all contacts by using one of these methods:
      • delete all DAVdroid accounts used for contacts and add them again, or
      • uninstall DAVdroid before installing DAVdroid 1.3.6 and install DAVdroid 1.3.6 / set it up again.


  • Hello, thanks for your great work.

    Unfortunately, the problems occurs with version 1.5.0.2-ose, too.
    Steps to reproduce:

    • installed 1.5.0.2 freshly
    • connect to nextcloud (woelkli.com in my case)
    • add number to existing contact
      Please see the attached debug file and let me know how I can help resolving this issue.

    Many thanks,
    Christoph Hagemann0_1491656613794_DAVdroid 1.5.0.2-ose debug info


  • developer

    @chr There’s an invalid REV value in the VCard sent by Nextcloud, which is then stored by DAVdroid as “unknown property” (because it’s not parseable by ez-vcard):

    unknownProperties=BEGIN:VCARD
    VERSION:4.0
    PRODID:ez-vcard 0.10.2
    X-EVOLUTION-FILE-AS:Hansen\, Olaf
    REV;VALUE=timestamp:2014-10-07T09:50:31Z(0)
    END:VCARD
    )
    

    DAVdroid will take this unknown property and send it along with its own REV value, so that in result, there are two REV properties, which is not allowed and not accepted by the server.

    Removing the invalid REV values from your Nextcloud contacts should fix that. It’s probably enough to edit the affected contacts in the Nextcloud GUI.



  • @rfc2822 Thanks a lot for your quick reply! You were right: Having edited the affected entry in the nextcloud GUI, subsequent edits one the mobile phone synced without a problem.

    Thanks again! Christoph



Similar topics