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

NotFoundError with UID containing a slash #1154

Open
xaltsc opened this issue Dec 24, 2024 · 5 comments
Open

NotFoundError with UID containing a slash #1154

xaltsc opened this issue Dec 24, 2024 · 5 comments

Comments

@xaltsc
Copy link

xaltsc commented Dec 24, 2024

  • vdirsyncer 0.19.3
  • on Void-Linux but installed via Home-Manager (Nix)
  • python 3.12 (via Nix)
  • Config file:
[general]
status_path = "/home/me/.local/share/vdirsyncer/status"

### Pairs

[pair calendar]
a = "calendar_remote"
b = "calendar_local"
collections = ["from a", "from b"]
metadata = ["color", "displayname", "description", "order"]


### Local storages

[storage calendar_local]
fileext = ".ics"
path = "/home/me/calendar/calendar"
type = "filesystem"

### Remote storages

[storage calendar_remote]
password.fetch = ["command", "get", "pwd"]
type = "caldav"
url = "https://zimbra.tld/dav/[email protected]"
username = "[email protected]"
  • vdirsyncer -vdebug sync output (last lines)
debug: Skipping '/dav/[email protected]/zimbra_name_for_distant_cal/distant_cal/87.ics', properties are missing.
error: Unknown error occurred for calendar/distant_cal: /dav/[email protected]/zimbra_name_for_distant_cal/distant_cal/130.ics
error: Use `-vdebug` to see the full traceback.
debug:   File "/nix/store/hv0b6ks5dgmq0g3iykw51jbaw0d7fp71-python3.12-vdirsyncer-0.19.3/lib/python3.12/site-packages/vdirsyncer/cli/tasks.py", line 74, in sync_collection
debug:     await sync.sync(
debug:   File "/nix/store/hv0b6ks5dgmq0g3iykw51jbaw0d7fp71-python3.12-vdirsyncer-0.19.3/lib/python3.12/site-packages/vdirsyncer/sync/__init__.py", line 149, in sync
debug:     a_nonempty = await a_info.prepare_new_status()
debug:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
debug:   File "/nix/store/hv0b6ks5dgmq0g3iykw51jbaw0d7fp71-python3.12-vdirsyncer-0.19.3/lib/python3.12/site-packages/vdirsyncer/sync/__init__.py", line 69, in prepare_new_status
debug:     async for href, item, etag in self.storage.get_multi(prefetch):
debug:   File "/nix/store/hv0b6ks5dgmq0g3iykw51jbaw0d7fp71-python3.12-vdirsyncer-0.19.3/lib/python3.12/site-packages/vdirsyncer/storage/dav.py", line 553, in get_multi
debug:     raise exceptions.NotFoundError(href)

Hey, I'm having an issue trying to sync a calendar I'm subscribed to on a zimbra account. Here, zimbra_name_for_distant_cal refers to the calendar on the Zimbra server that is subscribed to distant_cal, however, it looks like there are no subfolder distant_cal, it's just that items have UID distant_cal/num, with the slash character included. I'm guessing this is the cause for the NotFoundError, as / here is not a path separator.

@xaltsc
Copy link
Author

xaltsc commented Dec 24, 2024

Mounting zimbra.tld/dav/[email protected] with other stuff (DAVx5, davfs) show that files indeed have a / in them, davfs replaces them with a -slash- whereas DAVx5 just leaves it as is.

@WhyNotHugo
Copy link
Member

The UID should not affect the URL on which we request the item. The href determines the URL of the item.

@WhyNotHugo
Copy link
Member

I wonder if the slash needs to be escaped here.

@xaltsc
Copy link
Author

xaltsc commented Dec 24, 2024

I wonder if the slash needs to be escaped here.

That's what I'm thinking, given that it shows up with the slash on Android, and with -slash- with davfs.

@WhyNotHugo
Copy link
Member

WhyNotHugo commented Dec 24, 2024

I have the impression that the server returns items which contain / in the URL. It's possible that the / needs to be escaped when requesting these items.

This can probably be confirmed with davcli, using:

export DAVCLI_BASE_URL=https://zimbra.tld/dav/
export DAVCLI_USERNAME=XXX
export DAVCLI_PASSWORD=YYY
davcli --caldav list-items /dav/[email protected]/zimbra_name_for_distant_cal/

If this is a new setup, consider using
pimsync instead, which is a re-implementation of
vdirsyncer and deals with escaping unusual characters a lot better.

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