vdirsyncer icon indicating copy to clipboard operation
vdirsyncer copied to clipboard

NotFoundError with UID containing a slash

Open xaltsc opened this issue 11 months ago • 6 comments

  • 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 avatar Dec 24 '24 14:12 xaltsc

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.

xaltsc avatar Dec 24 '24 14:12 xaltsc

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

WhyNotHugo avatar Dec 24 '24 14:12 WhyNotHugo

I wonder if the slash needs to be escaped here.

WhyNotHugo avatar Dec 24 '24 14:12 WhyNotHugo

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.

xaltsc avatar Dec 24 '24 14:12 xaltsc

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.

WhyNotHugo avatar Dec 24 '24 14:12 WhyNotHugo

I have the same issue (a UID with a slash in it), and can confirm that pimsync handles this just fine.

jfly avatar Oct 03 '25 16:10 jfly