Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yandex carddav failed - vdirsyncer doesn't understand #1159

Open
axet opened this issue Jan 25, 2025 · 7 comments
Open

yandex carddav failed - vdirsyncer doesn't understand #1159

axet opened this issue Jan 25, 2025 · 7 comments

Comments

@axet
Copy link

axet commented Jan 25, 2025

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
@WhyNotHugo
Copy link
Member

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
Copy link
Member

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.

@axet
Copy link
Author

axet commented Jan 27, 2025

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/

@WhyNotHugo
Copy link
Member

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
Copy link
Member

WhyNotHugo commented Jan 27, 2025

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.

@axet
Copy link
Author

axet commented Jan 27, 2025

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.

@WhyNotHugo
Copy link
Member

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"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants