Error 403 during sync CardDav with Egroupware



  • Hello,
    For a few days, adding contacts to the CardDav server has not worked.
    (I deliberately hid the account names and the server name)

    --- BEGIN DEBUG INFO ---
    Account name: Carnet d'adresses *** (**** uA)
    Authority: com.android.contacts
    
    HTTP REQUEST:
    Request{method=PUT, url=https://***.fr/egroup/groupdav.php/ameriau/addressbook/7b86fdc4-ec89-4f3f-9d51-edd47128e094.vcf, tags={}}
    BEGIN:VCARD
    VERSION:3.0
    PRODID:+//IDN bitfire.at//DAVx5/2.2.3.1-ose ez-vcard/0.10.5
    UID:7b86fdc4-ec89-4f3f-9d51-edd47128e094
    FN:Kiki
    N:;Kiki
    TEL;TYPE=cell:56838683564
    REV:2019-03-08T10:49:00Z
    END:VCARD
    
    
    HTTP RESPONSE:
    Response{protocol=http/1.1, code=403, message=Forbidden, url=https://***.fr/egroup/groupdav.php/ameriau/addressbook/7b86fdc4-ec89-4f3f-9d51-edd47128e094.vcf}
    
    
    
    LOCAL RESOURCE:
    at.bitfire.davdroid.resource.LocalContact@1b43589e[cachedGroupMemberships=[],groupMemberships=[],flags=0,addressBook=at.bitfire.davdroid.resource.LocalAddressBook@8e10f7f,contact=at.bitfire.vcard4android.Contact@15c67b4c[addresses=[],anniversary=<null>,birthDay=<null>,categories=[],displayName=Kiki,emails=[],familyName=<null>,givenName=Kiki,impps=[],jobDescription=<null>,jobTitle=<null>,members=[],middleName=<null>,nickName=<null>,note=<null>,organization=<null>,phoneNumbers=[LabeledProperty(property=ezvcard.property.Telephone [ group=null | parameters={TYPE=[cell]} | uri=null | text=56838683564 ], label=null)],phoneticFamilyName=<null>,phoneticGivenName=<null>,phoneticMiddleName=<null>,prefix=<null>,relations=[],suffix=<null>,uid=7b86fdc4-ec89-4f3f-9d51-edd47128e094,unknownProperties=<null>,urls=[],group=false],eTag=<null>,fileName=7b86fdc4-ec89-4f3f-9d51-edd47128e094.vcf,id=2035]
    
    REMOTE RESOURCE:
    https://***.fr/egroup/groupdav.php/ameriau/addressbook/7b86fdc4-ec89-4f3f-9d51-edd47128e094.vcf
    
    EXCEPTION:
    at.bitfire.dav4jvm.exception.ForbiddenException: HTTP 403 Forbidden
    	at at.bitfire.dav4jvm.DavResource.checkStatus(DavResource.kt:354)
    	at at.bitfire.dav4jvm.DavResource.checkStatus(DavResource.kt:338)
    	at at.bitfire.dav4jvm.DavResource.put(DavResource.kt:244)
    	at at.bitfire.davdroid.syncadapter.SyncManager$uploadDirty$1$1.invoke(SyncManager.kt:326)
    	at at.bitfire.davdroid.syncadapter.SyncManager$uploadDirty$1$1.invoke(SyncManager.kt:53)
    	at at.bitfire.davdroid.syncadapter.SyncManager.useRemote(SyncManager.kt:791)
    	at at.bitfire.davdroid.syncadapter.SyncManager$uploadDirty$1.invoke(SyncManager.kt:313)
    	at at.bitfire.davdroid.syncadapter.SyncManager$uploadDirty$1.invoke(SyncManager.kt:53)
    	at at.bitfire.davdroid.syncadapter.SyncManager.useLocal(SyncManager.kt:777)
    	at at.bitfire.davdroid.syncadapter.SyncManager.uploadDirty(SyncManager.kt:304)
    	at at.bitfire.davdroid.syncadapter.ContactsSyncManager.uploadDirty(ContactsSyncManager.kt:239)
    	at at.bitfire.davdroid.syncadapter.SyncManager$performSync$1.invoke(SyncManager.kt:126)
    	at at.bitfire.davdroid.syncadapter.SyncManager$performSync$1.invoke(SyncManager.kt:53)
    	at at.bitfire.davdroid.syncadapter.SyncManager.unwrapExceptions(SyncManager.kt:817)
    	at at.bitfire.davdroid.syncadapter.SyncManager.performSync(SyncManager.kt:112)
    	at at.bitfire.davdroid.syncadapter.ContactsSyncAdapterService$ContactsSyncAdapter.sync(ContactsSyncAdapterService.kt:64)
    	at at.bitfire.davdroid.syncadapter.SyncAdapterService$SyncAdapter.onPerformSync(SyncAdapterService.kt:73)
    	at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:259)
    
    SOFTWARE INFORMATION
    * at.bitfire.davdroid 2.2.3.1-ose (267) from org.fdroid.fdroid
    * com.android.providers.contacts 5.0.2-G850FXXS2CRK2 (19)
    * com.android.providers.calendar 5.0.2-G850FXXS2CRK2 (21)
    * com.android.contacts 5.0.2.3751131 (1704122144)
    * com.android.calendar 2.1.4.16060220 (16060220)
    
    CONNECTIVITY (at the moment)
    Active connection: WiFi, CONNECTED
    
    CONFIGURATION
    android.permission.READ_CONTACTS: granted
    android.permission.WRITE_CONTACTS: granted
    android.permission.READ_CALENDAR: granted
    android.permission.WRITE_CALENDAR: granted
    org.dmfs.permission.READ_TASKS: denied
    org.dmfs.permission.WRITE_TASKS: denied
    android.permission.ACCESS_COARSE_LOCATION: denied
    System-wide synchronization: automatically
    Account: ****
      Address book sync. interval: 15 min
      Calendar     sync. interval: 15 min
      OpenTasks    sync. interval: —
      WiFi only: false
      [CardDAV] Contact group method: GROUP_VCARDS
      [CalDAV] Time range (past days): 90
               Manage calendar colors: true
               Use event colors: false
    Address book account: Carnet d'adresses*** (*** uA)
      Main account: Account {name=***, type=bitfire.at.davdroid}
      URL: https://***.fr/egroup/groupdav.php/ameriau/addressbook/
      Sync automatically: true
    
    SQLITE DUMP
    android_metadata
    	|  locale |
    	|  fr_FR |
    ----------
    services
    	|  _id | accountName | service | principal |
    	|  1 | *** | carddav | https://***.fr/egroup/groupdav.php/principals/users/ameriau/ |
    	|  2 | *** | caldav | https://***.fr/egroup/groupdav.php/principals/users/ameriau/ |
    ----------
    sqlite_sequence
    	|  name | seq |
    	|  services | 2 |
    	|  homesets | 13 |
    	|  collections | 14 |
    ----------
    homesets
    	|  _id | serviceID | url |
    	|  4 | 2 | https://***.fr/egroup/groupdav.php/ameriau/ |
    	|  5 | 2 | https://***.fr/egroup/groupdav.php/Default/ |
    	|  12 | 1 | https://***.fr/egroup/groupdav.php/Default/ |
    	|  13 | 1 | https://***.fr/egroup/groupdav.php/ameriau/ |
    ----------
    collections
    	|  _id | serviceID | type | url | privWriteContent | privUnbind | forceReadOnly | displayName | description | color | timezone | supportsVEVENT | supportsVTODO | source | sync |
    	|  3 | 2 | CALENDAR | https://***.fr/egroup/groupdav.php/ameriau/calendar/ | 1 | 1 | 0 | Calendrier Aline Meriau | Aline Meriau | -27392 | <null> | 1 | 0 | <null> | 0 |
    	|  4 | 2 | CALENDAR | https://***.fr/egroup/groupdav.php/ameriau/infolog/ | 1 | 1 | 0 | InfoLog Aline Meriau | Tasks of Aline Meriau | -3378207 | <null> | 0 | 1 | <null> | 0 |
    	|  5 | 2 | CALENDAR | https://****.fr/egroup/groupdav.php/Default/calendar/ | 0 | 0 | 0 | Calendrier Groupe Default | Groupe Default | <null> | <null> | 1 | 0 | <null> | 0 |
    	|  6 | 2 | CALENDAR | https://***.fr/egroup/groupdav.php/Default/infolog/ | 0 | 0 | 0 | InfoLog Groupe Default | Tasks of Groupe Default | <null> | <null> | 0 | 1 | <null> | 0 |
    	|  13 | 1 | ADDRESS_BOOK | https://***.fr/egroup/groupdav.php/Default/addressbook/ | 1 | 1 | 0 | Carnet d'adresses Groupe Default | Carnet d'adresses Groupe Default | <null> | <null> | 0 | 0 | <null> | 0 |
    	|  14 | 1 | ADDRESS_BOOK | https://***.fr/egroup/groupdav.php/ameriau/addressbook/ | 1 | 1 | 0 | Carnet d'adresses Aline Meriau | Carnet d'adresses Aline Meriau | <null> | <null> | 0 | 0 | <null> | 1 |
    ----------
    
    SYSTEM INFORMATION
    Android version: 5.0.2 (LRX22G.G850FXXS2CRK2)
    Device: samsung SM-G850F (slte)
    
    --- END DEBUG INFO ---
    
    

    Contact deletion and modification works. On another user account everything works. This account has more than 1900 contacts.

    The CardDav server is egroupware 16.1.005, the apache log shows:

    xxx.xxx.xxx.176 - ameriau [08/Mar/2019:11:49:00 +0100] "PUT /egroup/groupdav.php/ameriau/addressbook/7b86fdc4-ec89-4f3f-9d51-edd47128e094.vcf HTTP/1.1" 403 477 "-" "DAVx5/2.2.3.1-ose (2019/01/27; dav4jvm; okhttp/3.12.1) Android/5.0.2"
    

    I really don’t see where to look for the problem, knowing that for other users everything works.
    Any ideas ?
    Thanks.


  • developer

    Hello,

    Seems that the CardDAV server rejects the upload with 403 Forbidden. Does your user have permission to upload contacts to this specific address book (see remote resource URL)?

    If yes, please ask your server support to find out why the server returns 403. DAVx⁵ just uploads the contact and receives 403.



  • Thank you for your answer.
    I don’t know, but I disabled the address book in DAVx5, made a sync, then re-enabled the address book and finally a sync, now i can add contacts…
    I have no explanation, to be continued …


Log in to reply
 

Similar topics