Synology CardDAV server + DAVdroid only 1 way sync (phone to server)



  • Hello guys,

    So i set the davdroid on Android 6.0 and the result had been a little odd. From phone to server the sync is very good, but from the server to phone there's an error said: "<html><head><title>Internal Server Error</title></head><body><h1>Internal Server Error</h1>An error occurred rendering the requested page. More information is available in the server log.</body></html>"

    I write down the steps i made, but if anybody has an idea where i could see the Syno's CardDAV servers log for further investigation, it would be appriciated.

    So, the steps:

    1. exported my contacts from google addressbook
    2. created a user just for the CardDAV (the user is in the default user group, permission for only 1 folder, no quota, permission only for WebDAV, no speed limit)
    3. edited the default port number and set the http request to https always
    4. imported the vcf file to the CardSDAV server
    5. edited all of the contacts
    6. installed DAVdroid and Opentask from FDroid
    7. granted all permissions for the downloaded apps
    8. i started to add an account with URL (tried the described method: "http(s)://my_ddns_address:CardDAVs_port_in_DSM/addressbooks/users/MY_USERNAME"
      and with this format: "http(s)://my_ddns_address:CardDAVs_port_in_DSM") and user name
    9. account is created, and gave an email address for account name

    So when i want to sync my contacts the app gives me an error notification on the notification bar: "Addressbook synchronization failed (add..) Server error while downloading remote entries." It is interesting, because if i add a contact in the phone, it shows on the server (i have to make a manuallly started sync), but if i want to make a sync from the server it generates the described error.

    So first, if someone is familier with the CardDAV server on a synology and could give me a hint about where i can find the CardDAV server logs, and second if you need a log, just answer me and will upload to the paste.org.

    Thanks any help you can provide, and please be patient with my english!


  • developer

    Hello,

    This is a known problem which is caused by corrupt .vcf files generated by the Android Contacts app.

    Do not import .vcf files generated by Android directly into the Synology CardDAV server! It may break synchronization, because Android sometimes exports invalid vCard files.

    You can find this information and more at https://www.davdroid.com/tested-with/synology/

    Does it work when you delete this address book on your CardDAV server, then create a new one and use the recommended export/import method (use Android Contacts app to both export and import, see https://www.davdroid.com/faq/existing-contacts-are-not-synced/)?



  • Thanks for your quick answer!

    I read that i shouldn't use android generated vcf file, but i thought if i edit in the CardDAV server it's gonna be ok. Sorry for misunderstanding.

    I will check the suggested methods (mainly copy contacts) on the weekend, and will report back if they are working. If i'm not able to generate a valid vcf file with them, can i use some of these other methods:

    1. creating new contacts in google addressbook then export them to vcf file (does it generate a valid vcf file?), or
    2. creating new contacts on the CardDAV server itself (then exporting them to vcf file for safety)?

  • developer

    @theunknownx said in Synology CardDAV server + DAVdroid only 1 way sync (phone to server):

    I read that i shouldn't use android generated vcf file, but i thought if i edit in the CardDAV server it's gonna be ok. Sorry for misunderstanding.

    In theory, this should work, but the combination of corrupt Android .vcf files and Synology CardDAV server causes unexpected problems because the server imports the vCards, but can't process them later.

    I will check the suggested methods (mainly copy contacts) on the weekend, and will report back if they are working. If i'm not able to generate a valid vcf file with them, can i use some of these other methods:

    1. creating new contacts in google addressbook then export them to vcf file (does it generate a valid vcf file?), or
    2. creating new contacts on the CardDAV server itself (then exporting them to vcf file for safety)?

    I'd recommend the second method. However, it is also safe to use the Contacts app export feature when you only use the generated files to import them using the Contacts app again, see https://www.davdroid.com/faq/existing-contacts-are-not-synced/



  • Thanks again for your kind help!

    At the weekend i'm gonna check the methods, and will try to make carddav to sync with my phone. I will definitely report back about the result!



  • So i just tried it with some fake contacts, and it works great. One question though:

    I created on the synology carddav server these contacts: Probe1, Probe2, ..., Probe5 with phone number: 1234. Davdroid syncs the contacts to the phone. Then i tried it on my phone, and add these contacts: Probe6, Probe7, ..., Probe9 with phone numbers:1234. They just synced to the server, but they are a bit strange. I can see them on the carddav server in this order:

    Probe6 - 1 234
    Probe7 - 1 234
    Probe8 - 1 234
    Probe9 - 1 234
    Probe1 - 1234
    Probe2 - 1234
    Probe3 - 1234
    Probe4 - 1234
    Probe5 - 1234

    The contacts ordered alphabetical depending on which client was it created and no matter what i do they just won't be real alphabetical orders, with a slightly different phone number. Is it because of the android's strange contacts management?


  • developer

    @theunknownx said in Synology CardDAV server + DAVdroid only 1 way sync (phone to server):

    So i just tried it with some fake contacts, and it works great. One question though:

    I created on the synology carddav server these contacts: Probe1, Probe2, ..., Probe5 with phone number: 1234. Davdroid syncs the contacts to the phone. Then i tried it on my phone, and add these contacts: Probe6, Probe7, ..., Probe9 with phone numbers:1234. They just synced to the server, but they are a bit strange. I can see them on the carddav server in this order:

    Probe6 - 1 234
    Probe7 - 1 234
    Probe8 - 1 234
    Probe9 - 1 234
    Probe1 - 1234
    Probe2 - 1234
    Probe3 - 1234
    Probe4 - 1234
    Probe5 - 1234

    The contacts ordered alphabetical depending on which client was it created and no matter what i do they just won't be real alphabetical orders, with a slightly different phone number. Is it because of the android's strange contacts management?

    I don't know. DAVdroid has no influence on the way how GUIs sort entries. It just synchronizes the contacts, see the image on https://www.davdroid.com/faq/system-integration/



  • Ok! The main thing is that davdroid works very fine. You just found another customer to the app.

    Just keep up the good work and thanks all your help you provided for me!