vdirsyncer icon indicating copy to clipboard operation
vdirsyncer copied to clipboard

yandex carddav failed - vdirsyncer doesn't understand

Open axet opened this issue 10 months ago • 7 comments

I'm tyring to setup new yandex carddav url, I setup it using:

[storage local_contacts_ya]
type = "filesystem"
path = "~/encfs/cfg/contacts"
fileext = ".vcf"

[storage yandex_contacts]
type = "carddav"
token_file = "~/.config/vdirsyncer/yandex_con"
url = "https://carddav.yandex.ru/addressbook/[email protected]/1/"
username = "[email protected]"
password = "PASS"

[pair contacts_ya]
a = "yandex_contacts"
b = "local_contacts_ya"
collections = ["from a", "from b"]
metadata = ["displayname"]

Here is a result of discover command:

# vdirsyncer discover contacts_ya
Discovering collections for pair contacts_ya
yandex_contacts:
  - "1"
local_contacts_ya:
  - "default"
warning: No collection "1" found for storage local_contacts_ya.
Should vdirsyncer attempt to create it? [y/N]: y
warning: No collection "default" found for storage yandex_contacts.
Should vdirsyncer attempt to create it? [y/N]: y
error: The server returned something vdirsyncer doesn't understand. Error message: InvalidXMLResponse("Couldn't find home-set.")
error: While this is most likely a serverside problem, the vdirsyncer devs are generally interested in such bugs. Please report it in the issue tracker at https://github.com/pimutils/vdirsyncer/issues

axet avatar Jan 25 '25 14:01 axet

Can you try using the URL https://carddav.yandex.ru/addressbook/[email protected]/ instead?

If that doesn't work, I need to understand your scenario a bit better:

  • Do you already have contacts in your local storage?
  • Do you already have contacts in the remote storage?

WhyNotHugo avatar Jan 27 '25 11:01 WhyNotHugo

Debug logs would also be useful here, since the server is returning a response that vdirsyncer is not understanding:

error: The server returned something vdirsyncer doesn't understand. Error message: InvalidXMLResponse("Couldn't find home-set.")

Seeing this response might help better understand what's up.

WhyNotHugo avatar Jan 27 '25 12:01 WhyNotHugo

This is a new sync. Storage path has 'default' folder which should not be used. 1 remote contact.

Debug output, no cookies

https://paste.debian.net/1347040/

axet avatar Jan 27 '25 12:01 axet

The "storage" path is the directory where all your address books are contained. Each directory inside of it is a separate address book.

If you create directory ~/encfs/cfg/contacts/1 and delete directory ~/encfs/cfg/contacts/default, all should work fine.

WhyNotHugo avatar Jan 27 '25 14:01 WhyNotHugo

The root of the issue here is that vdirsyncer can't determine the home path from your provider (e.g.: the server returns an empty <c:addressbook-home-set />, so it doesn't know where to create the "default" address book that it's seeing locally.

WhyNotHugo avatar Jan 27 '25 14:01 WhyNotHugo

Right. It works. I'm syncing google into contacts/default and yandex into contacs/1, which causing the issue. I had to create separate dirrectories for google and yandex.

axet avatar Jan 27 '25 14:01 axet

Vdirsyncer is trying to default in yandex because you're telling it to sync all collections found in storage b and all collections found in storage a. If you only want to sync the collection that already exists in yandex, use:

[pair contacts_ya]
a = "yandex_contacts"
b = "local_contacts_ya"
collections = ["from a"]  # don't include "from b" here
metadata = ["displayname"]

WhyNotHugo avatar Jan 27 '25 15:01 WhyNotHugo