CardDAV Synching Fails when changing existing entry (403, Cannot change the UID in an existing resource)



  • Hi,

    i am running DAVDroid 1.3.6 on an Galaxy S7 Android 6.0.1.
    I installed the CardDAV-Package on my Synology DS215j (DSM 6.0.2-8451 Update 7).
    I exported my Contacts on my MacPro from the Contacts App in one big vCard-File and imported this file into the Synology.
    Then I synched with DAVDroid and everything looks great. All Contacts are there, I can even add new ones and they are synchronized fine.
    When I try to change an existing entry, everything stops working. DAVDroid throws the following Messages (excerpt):

    HTTP RESPONSE:
    http/1.1 403 Forbidden
    Connection: close
    Content-Length: 271
    Content-Type: text/xml
    Date: Wed, 04 Jan 2017 17:40:02 GMT
    DAV: 1, access-control, addressbook, extended-mkcol, calendarserver-principal-property-search, calendarserver-principal-search, calendarserver-home-sync
    Server: Twisted/13.0.0 TwistedWeb/9.0.0
    Strict-Transport-Security: max-age=604800
    
    <?xml version='1.0' encoding='UTF-8'?>[LF]
    <error xmlns='DAV:'>[CR][LF]
      <no-uid-conflict xmlns='urn:ietf:params:xml:ns:carddav'/>[CR][LF]
      <error-description xmlns='http://twistedmatrix.com/xml_namespace/dav/'>Cannot change the UID in an existing resource.</error-description>[CR][LF]
    </error>
    
    EXCEPTION:
    at.bitfire.dav4android.exception.HttpException: 403 Forbidden
    	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.sync(ContactsSyncAdapterService.java:64)
    	at at.bitfire.davdroid.syncadapter.SyncAdapterService$SyncAdapter.onPerformSync(SyncAdapterService.java:85)
    	at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:272)
    
    SOFTWARE INFORMATION
    Package: at.bitfire.davdroid
    Version: 1.3.6-gplay (131) Sun Jan 01 12:55:40 GMT+01:00 2017
    Installed from: com.android.vending
    JB Workaround installed: no
    

    "403, Cannot change the UID in an existing resource" seem to be the interesting bits here. Changing an existing UID is not allowed by the protocol, which is ok, but why does he even try to do that? To get things working again, I have to delete the account in DAVDroid and set it up again. Reverting the change in the adressbook, does not help here ...

    Any help anyone?

    Thanks,
    urbZZ


  • developer

    DAVdroid does not change the UID (intentionally). Please provide verbose logs of the upload process.



  • @rfc2822

    Debug Info:

    SOFTWARE INFORMATION
    Package: at.bitfire.davdroid
    Version: 1.3.6-gplay (131) Sun Jan 01 12:55:40 GMT+01:00 2017
    Installed from: com.android.vending
    JB Workaround installed: no
    
    CONFIGURATION
    System-wide synchronization: automatically
    Account: Familienkalender
      Address book sync. interval: —
      Calendar     sync. interval: 240 min
      OpenTasks    sync. interval: —
      WiFi only: false
      [CardDAV] Contact group method: GROUP_VCARDS
      [CalDAV] Time range (past days): 90
               Manage calendar colors: false
    Account: xxx Privat
      Address book sync. interval: —
      Calendar     sync. interval: 240 min
      OpenTasks    sync. interval: —
      WiFi only: false
      [CardDAV] Contact group method: GROUP_VCARDS
      [CalDAV] Time range (past days): 90
               Manage calendar colors: false
    Account: xxx@googlemail.com
      Address book sync. interval: 240 min
      Calendar     sync. interval: —
      OpenTasks    sync. interval: —
      WiFi only: false
      [CardDAV] Contact group method: CATEGORIES
      [CalDAV] Time range (past days): 90
               Manage calendar colors: true
    
    SQLITE DUMP
    android_metadata
    	|  locale |
    	|  de_DE |
    ----------
    settings
    	|  setting | value |
    	|  hint_BatteryOptimizations | 0 |
    	|  hint_OpenTasksNotInstalled | 0 |
    ----------
    services
    	|  _id | accountName | service | principal |
    	|  1 | xxx | caldav | <null> |
    	|  2 | xxx Privat | caldav | <null> |
    	|  6 | xxx@googlemail.com | carddav | https://x:8443/principals/__uids__/F25A1A23-42D6-5D07-9457-051A13779207/ |
    ----------
    sqlite_sequence
    	|  name | seq |
    	|  services | 6 |
    	|  homesets | 13 |
    	|  collections | 11 |
    ----------
    homesets
    	|  _id | serviceID | url |
    	|  2 | 1 | https://x:5006/Red1/Privat/Kalender/Familie/ |
    	|  5 | 2 | https://x:5006/Red1/Privat/Kalender/Rainer/ |
    	|  13 | 6 | https://x:8443/addressbooks/__uids__/F25A1A23-42D6-5D07-9457-051A13779207/ |
    ----------
    collections
    	|  _id | serviceID | url | readOnly | displayName | description | color | timezone | supportsVEVENT | supportsVTODO | sync |
    	|  1 | 1 | https://x:5006/Red1/Privat/Kalender/Familie/Familie/ | 0 | <null> | <null> | <null> | <null> | 1 | 1 | 1 |
    	|  3 | 2 | https://x:5006/Red1/Privat/Kalender/Rainer/Rainer/ | 0 | <null> | <null> | <null> | <null> | 1 | 1 | 1 |
    	|  11 | 6 | https://x:8443/addressbooks/__uids__/F25A1A23-42D6-5D07-9457-051A13779207/addressbook/ | 0 | <null> | <null> | <null> | <null> | <null> | <null> | 1 |
    ----------
    
    SYSTEM INFORMATION
    Android version: 6.0.1 (MMB29K.G935FXXU1BPLB)
    Device: Samsung SM-G935F (hero2lte)
    
    

    Full Upload Log (anonymized)

    SYNCHRONIZATION INFO
    Synchronization phase: 4
    Account name: xx@googlemail.com
    Authority: com.android.contacts
    
    HTTP REQUEST:
    PUT /addressbooks/__uids__/F25A1A23-42D6-5D07-9457-051A13779207/addressbook/3e4bbb3e-4303-46e1-8595-3e659d62b740.vcf
    If-Match: "7e7cf9ef9f9bff68c2e0d166f3b93b6f"
    
    BEGIN:VCARD[CR][LF]
    VERSION:3.0[CR][LF]
    PRODID:+//IDN bitfire.at//DAVdroid/1.3.6-gplay vcard4android ez-vcard/0.10.[CR][LF]
     1[CR][LF]
    X-ABUID:494CD43D-17EE-41EE-BF69-210A3D04F99D:ABPerson[CR][LF]
    UID:3cc8fa8f-159b-4f4e-83da-c04a0f896362[CR][LF]
    FN:xx xx[LF]
    N:xx;xx[CR][LF]
    TEL;TYPE=home,pref:+49 (8151) 6521037[CR][LF]
    TEL;TYPE=cell:+49 170-5800 966[CR][LF]
    EMAIL;TYPE=home,pref:x@x.org[CR][LF]
    ADR;TYPE=work:;;x. 24;x;;88888;Deutschland[CR][LF]
    LABEL;TYPE=work:x. 24\n88888 x\nDEUTSCHLAND[CR][LF]
    BDAY:1972-06-26[CR][LF]
    PHOTO;ENCODING=b;TYPE=jpeg:/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQEBAQIBAQEC[CR][LF]
     AgICAgQDAgICAgUEBAMEBgUGBgYFBgYGBwkIBgcJBwYGCAsICQoKCgoKBggLDAsKDAkKCgr/2w[CR][LF]
     BDAQICAgICAgUDAwUKBwYHCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoK[CR][LF]
     CgoKCgoKCgoKCgr/wAARCABIAEgDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAw[CR][LF]
     QFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0Kx[CR][LF]
     wRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3[CR][LF]
     R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW[CR][LF]
     19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQ[CR][LF]
     oL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAV[CR][LF]
     YnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eH[CR][LF]
     l6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna[CR][LF]
     4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD9/KKKKACiiigAooooAKKKKACiiigDN0[CR][LF]
     ue8ltQ1xJlj3AFWhKw+bGV9a5vR/E2nXltHdW8vyP/AMs9/StiDWLF4fkk/wA81pKnY5KFRS3Z[CR][LF]
     Ya553B2C+6V538Vf2n/hR8F9e0Lw54/8WrY3niW+e00m3aIkySLjO75f3fLKBk87hXcXuqWr20[CR][LF]
     rFflhXJ+fqK/PX9ujUvhF8UdL8KfHe91u1s9K8O/EbTf7Y8L+ILNLe2nWzurpZP9Iijdohv3GX[CR][LF]
     crZa2iVflDB3SpwS98VR1X8B94eF/Htn4y0O08R+HdVM9nf2aXFvJ5Y3bZPullxlNvvV2XWdW2[CR][LF]
     FVuMN/e2j/AAr8frD/AIOh/wBmv4J+Dx8N7X4Ra14q8VaTItteXWhrHHaXhHQ+cfmA+seK87T/[CR][LF]
     AIOw/GV/4+h8PXPwD0/T9PvFli8u4nLTW8m9nV9ytg4jKrzx361SqUGTbEH7X3/jTXrMP5d/5u[CR][LF]
     30iT/Cud1j4q+MYBi01Xb/ANsIz/NapeGPGXhr4ofDnTPih4B1611PSdc0+O90+4t3x5kLgNnn[CR][LF]
     uA+P+A15346+Jnhjw14n0vwXqF4yalrc0senQqpy4QM0jn/cCNj1r0KFOi94r7jgrSrx2kzp9V[CR][LF]
     +N3xQh8z7L4l2bf+nSA/zSivOdb1STeVz97/aorq+r0v5V9xwfWK/8z/8AApHlcH/Ba/8AYg0O[CR][LF]
     9TTPCXijxN4iuZWVFt9F8K3Tty2wnM6RrnP4V9j/AA++JWl+PPBmneN9AhuhY6tZxzW5vLUwyo[CR][LF]
     G7NG3KOPQ1/PXY/t5/Gz9n+41j4y/Cn4l+FfDltoWntpkn/CG/Ci3t4UCvuWM+fIypNuKnzSNv[CR][LF]
     7xf3teh+AP8AgrB+3vqvwi8SftF6h+2EtvollMdPW41Lwbp15LZyCCImYizUQ3QkuJVijKGTCt[CR][LF]
     5jZ2EV4x30Kq6H7r+O/Gy+GvDFzqS2dxcNHbtL9ls4syNHH94fNn73y+/zV/OH/wAFof2o9J/a[CR][LF]
     a/bQ1zTvhNdTQ6BoavBZyaewjFxcmYmV324wUcsPcxKevzV9BeEv21f+Ckurz6v42n/4KZ+G30[CR][LF]
     nT7e4ksprr4XW8n9pwR43bYt6Plst/Ev3f9mvgTTNE+IviLVNQ+JHhD4cXHiDSLnWLq5Gq2axR[CR][LF]
     xy4mcSOd0nAYL8meCeTzXBj6vsqUT28uj9YnNQTPpn9ib/glr8A9e+GNt4v+Jbrdz36/aLy3s3[CR][LF]
     YFT7nOT+Ne6at/wTO/Ye8SaQ3h6H4XSWy8bb6xvH3bgQfX2WvnXTf2/L79lj4fRXPif9mDx1Kr[CR][LF]
     Lv8AMa1RLHH/AF3+YfpXl2of8F7fHUmryavp/wABbO0topsW8Metybs/7fYfhXzyo46c/cmfbw[CR][LF]
     xnD+Dw0Y1lr/gP3z/Yg0vwp8M/2XPDfwl8G319c2fhW3OnxyagN8pRWySQOxLf+O8V88/H79qb[CR][LF]
     RvDX7dWk+INcjkl8O+E9Pu7S61COUHEzQug8v+/88rKSOuzJr86/Dn/Bdr9qG78OWvwt8M/spX[CR][LF]
     2nTeOdNS9s7211vy57u2t2mab7OTEF3OsTjpu+XheUx4P8WP8Agq747ju5IdT/AGSrrSJx/qT4[CR][LF]
     g1y4k29Oo+zxj+HqpFfX4Cs3h4qe5+fZrRgsZNYfbzP1X+M//BW74d+G4JH8I+BLq5CLlrnUL0[CR][LF]
     RDH+7H5hor8Ifiv+2v4w+JqXKS+BNL0syR7PtFtNcPIP8AvqQfyorv+tuOh48cFipK/Mj9N/2V[CR][LF]
     fDXwKT4feJPDD6BceKbHXLw3Gqx+IvCbtbXBP8AjMmXPueeF54GMX9nz4QaPD8IG0XXfDkep6H[CR][LF]
     pfjK/ujoN5DMfPiink8oCVlIC/J52CMFmya7H4VWmmaXpU0un2U0Xmw7490Wwr7DPf9a9I+BPg[CR][LF]
     W9uZJrG8sVjidibqS8YZAPXd/wA9Pwrim4z96EkXRi17skeV+IvDPxK0WPTfhL8MLb+y/DOvNP[CR][LF]
     8A2heLfiJraFw4jDd7hiZVcjgfL6Vo/CT4X/CXwL4Xtvhta6rbrbeHmmsLjTmvwY7xJVaYySMp[CR][LF]
     ZX2mQAAsWG3jFU/29/jr8FPg/wCFtV8Maxq8cev3Oh3UFjpFi2658uaDbFP5a8oSf42OB2UV+a[CR][LF]
     v7Ov7bfxR/Zi0eXwZBp2n6t4YvLxrqfR75dv75urpMAMH/AHga8+vluNzDB+1grPsz6TI81oZR[CR][LF]
     jJKp75+mPge8i1P4fR+DvE1ta3KWysnkTIGjIHt0ry74ifsJ/s6eI9Nu/Et14NUXf+vj0+znNv[CR][LF]
     A8n/TTaygLXgHwv/4KBaFrFwdLuoLiHfMdnmf3D1r2Hw58V/D3xsSPwvqfiqa2tt3myTRzxxmd[CR][LF]
     /wDnmeOntXzNWjjMPU7H2mGzbAYiF6iT9dTz/wDbf+O3gCw/Z60PS/CXw8m0jxH4W1BbDw3qUl[CR][LF]
     vGhtrcDbPEqxtwgVUI5xlfrXl3hX47/HSf4DHVvEPjjxzf6nHZSSWMUfiCe8gl3/cmZZklijC/[CR][LF]
     3FKk96+l7/4b+HrnwveW/iKC3vrRrfyI7Jr15I5D9rjbKliQXI4O3qKxtW+E+gReCVuPDbxn7V[CR][LF]
     JLHHp90mJXZEBLRN0kOXX0r38sahG1S+u33XPg+JMT7fGzlRStDcxvh2/7LHjYWGpfHvVdL1+/[CR][LF]
     ms0lmj1LRLeOeKYx8plbRXPzc8vRXhnxE/t7StfGls0yJuCeTIvzRgdOHBFFfQpUnsfHvFVrn6[CR][LF]
     keD9dstLtoF0TSVmmdULXV9hxk9fKX7v8A30DT/i58e/DP7PXwo1j4sa+kckekaeZLeD+/IxaO[CR][LF]
     GEenmSFVz1xRRXFlNCk8PT0/kPUxMpe1qan41+PPiP4l+I3iHVPG3ivVGuL/AFS8a5uGV/uluT[CR][LF]
     wePp6dsV718Xf+CVfiWw+EP/C1vB/xPsdRa0/Z00P4s61ZahZvFL9mv797J7eAoZBL5TIpy3lk[CR][LF]
     +ZRRX2mN9yloefg/dndHxXofiW70DV1vY03eW2Cklenv46stR1uPUfBun3GnWUaoJImuiztIep[CR][LF]
     xk4oor5Krh6Ve/OrnvYupPD0703Y/U7xL4X0iPwxBpMOlWqRW9vi2hW3AWJuOVGODwvI5rxzxT[CR][LF]
     4z8M3dhB4VtdYVr6K8upZLfYejCAHP4IaKKy9nDmj/X2Tya037KUurPOPF17A0m3xHpdvf26/d[CR][LF]
     a4UiSJ/wDroMMfxJooor0PqtFdDy/aSP/Z[CR][LF]
    REV:2017-01-04T20:31:47Z[CR][LF]
    END:VCARD[CR][LF]
    
    
    HTTP RESPONSE:
    http/1.1 403 Forbidden
    Connection: close
    Content-Length: 271
    Content-Type: text/xml
    Date: Wed, 04 Jan 2017 20:31:48 GMT
    DAV: 1, access-control, addressbook, extended-mkcol, calendarserver-principal-property-search, calendarserver-principal-search, calendarserver-home-sync
    Server: Twisted/13.0.0 TwistedWeb/9.0.0
    Strict-Transport-Security: max-age=604800
    
    <?xml version='1.0' encoding='UTF-8'?>[LF]
    <error xmlns='DAV:'>[CR][LF]
      <no-uid-conflict xmlns='urn:ietf:params:xml:ns:carddav'/>[CR][LF]
      <error-description xmlns='http://twistedmatrix.com/xml_namespace/dav/'>Cannot change the UID in an existing resource.</error-description>[CR][LF]
    </error>
    
    EXCEPTION:
    at.bitfire.dav4android.exception.HttpException: 403 Forbidden
    	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.sync(ContactsSyncAdapterService.java:64)
    	at at.bitfire.davdroid.syncadapter.SyncAdapterService$SyncAdapter.onPerformSync(SyncAdapterService.java:85)
    	at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:272)
    
    SOFTWARE INFORMATION
    Package: at.bitfire.davdroid
    Version: 1.3.6-gplay (131) Sun Jan 01 12:55:40 GMT+01:00 2017
    Installed from: com.android.vending
    JB Workaround installed: no
    
    CONFIGURATION
    System-wide synchronization: automatically
    Account: x
      Address book sync. interval: —
      Calendar     sync. interval: 240 min
      OpenTasks    sync. interval: —
      WiFi only: false
      [CardDAV] Contact group method: GROUP_VCARDS
      [CalDAV] Time range (past days): 90
               Manage calendar colors: false
    Account: x Privat
      Address book sync. interval: —
      Calendar     sync. interval: 240 min
      OpenTasks    sync. interval: —
      WiFi only: false
      [CardDAV] Contact group method: GROUP_VCARDS
      [CalDAV] Time range (past days): 90
               Manage calendar colors: false
    Account: x@googlemail.com
      Address book sync. interval: 240 min
      Calendar     sync. interval: —
      OpenTasks    sync. interval: —
      WiFi only: false
      [CardDAV] Contact group method: CATEGORIES
      [CalDAV] Time range (past days): 90
               Manage calendar colors: true
    
    SQLITE DUMP
    android_metadata
    	|  locale |
    	|  de_DE |
    ----------
    settings
    	|  setting | value |
    	|  hint_BatteryOptimizations | 0 |
    	|  hint_OpenTasksNotInstalled | 0 |
    ----------
    services
    	|  _id | accountName | service | principal |
    	|  1 | x | caldav | <null> |
    	|  2 | x Privat | caldav | <null> |
    	|  6 | x@googlemail.com | carddav | https://x:8443/principals/__uids__/F25A1A23-42D6-5D07-9457-051A13779207/ |
    ----------
    sqlite_sequence
    	|  name | seq |
    	|  services | 6 |
    	|  homesets | 13 |
    	|  collections | 11 |
    ----------
    homesets
    	|  _id | serviceID | url |
    	|  2 | 1 | https://x:5006/Red1/Privat/Kalender/Familie/ |
    	|  5 | 2 | https://x:5006/Red1/Privat/Kalender/Rainer/ |
    	|  13 | 6 | https://x:8443/addressbooks/__uids__/F25A1A23-42D6-5D07-9457-051A13779207/ |
    ----------
    collections
    	|  _id | serviceID | url | readOnly | displayName | description | color | timezone | supportsVEVENT | supportsVTODO | sync |
    	|  1 | 1 | https://x:5006/Red1/Privat/Kalender/Familie/Familie/ | 0 | <null> | <null> | <null> | <null> | 1 | 1 | 1 |
    	|  3 | 2 | https://x:5006/Red1/Privat/Kalender/Rainer/Rainer/ | 0 | <null> | <null> | <null> | <null> | 1 | 1 | 1 |
    	|  11 | 6 | https://x:8443/addressbooks/__uids__/F25A1A23-42D6-5D07-9457-051A13779207/addressbook/ | 0 | <null> | <null> | <null> | <null> | <null> | <null> | 1 |
    ----------
    
    SYSTEM INFORMATION
    Android version: 6.0.1 (MMB29K.G935FXXU1BPLB)
    Device: Samsung SM-G935F (hero2lte)
    

  • developer

    UID:3cc8fa8f-159b-4f4e-83da-c04a0f896362[CR][LF]

    Do you know which UID would be expected? Can you maybe look up the contact in the .vcf that you have imported into the CardDAV server?


  • developer

    I can't reproduce the problem with those steps:

    1. initialize a new address book on Synology CardDAV server 6.0.4-0080
    2. add a contact in the Synology CardDAV Web Interface
    3. sync with DAVdroid
    4. change the contact on the Android device
    5. sync with DAVdroid again

    In this case, everything works as expected. Maybe the problems are related to the imported contacts. Especially the X-ABUID fields look strange for me, maybe you should remove them before importing.

    In any case, I can't see a DAVdroid problem here.


Log in to reply
 

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