vdirsyncer icon indicating copy to clipboard operation
vdirsyncer copied to clipboard

404s when trying to sync from google cal with start_date and end_date

Open FrederikP opened this issue 3 years ago • 7 comments

When I'm using start_date and end_date then vdirsyncer cannot sync and fails with 404 errors. Kind of like google is listing non-existing calendar events when those parameters are supplied. If I'm commenting the fields out, then syncing works. I don't know how to workaround this issue other than just syncing everything.

  • vdirsyncer version: 0.18.0
  • python version: 3.10.7
  • operating system: latest alpine docker image

Config:

[general]
status_path = "./status/"

[pair workcal]
a = "work"
b = "wolke"
collections = [["work", "[email protected]", "arbeit"]]
conflict_resolution = "a wins"

[storage work]
type = "google_calendar"
token_file = "./googleoathtoken"
client_id = "---"
client_secret = "---"
start_date = "datetime.now()"
end_date = "datetime.now() + timedelta(days=365)"
read_only = true

[storage wolke]
type = "caldav"
url = "https://nextcloud.example.com/remote.php/dav"
username = "username"
password = "----"

Log:

error: Unknown error occurred for workcal/work: /caldav/v2/[email protected]/events/[email protected]
error: Use `-vdebug` to see the full traceback.
debug:   File "/usr/local/lib/python3.10/site-packages/vdirsyncer/cli/tasks.py", line 71, in sync_collection
debug:     sync.sync(
debug:   File "/usr/local/lib/python3.10/site-packages/vdirsyncer/sync/__init__.py", line 140, in sync
debug:     a_nonempty = a_info.prepare_new_status()
debug:   File "/usr/local/lib/python3.10/site-packages/vdirsyncer/sync/__init__.py", line 61, in prepare_new_status
debug:     for href, item, etag in self.storage.get_multi(prefetch) if prefetch else ():
debug:   File "/usr/local/lib/python3.10/site-packages/vdirsyncer/storage/dav.py", line 505, in get_multi
debug:     raise exceptions.NotFoundError(href)

And a little bit above:

[...]DESCRIPTION:This is an event reminder\nTRIGGER:-P0DT0H10M0S\nEND:VALARM\nEND:VEVENT\nEND:VCALENDAR\n</caldav:calendar-data>\n   </D:prop>\n  </D:propstat>\n </D:response>\n <D:response xmlns:carddav="urn:ietf:params:xml:ns:carddav" xmlns:cm="http://cal.me.com/_namespace/" xmlns:md="urn:mobileme:davservices">\n  <D:href>/caldav/v2/[email protected]/events/[email protected]</D:href>\n  <D:status>HTTP/1.1 404 Not Found</D:status>\n </D:response>\n <D:response xmlns:carddav="urn:ietf:params:xml:ns:carddav" xmlns:cm="http://cal.me.com/_namespace/" xmlns:md="urn:mobileme:davservices">\n  <D:href>/caldav/v2/[email protected]/events/[email protected]</D:href>\n  <D:status>HTTP/1.1 404 Not Found</D:status>\n </D:response>\n <D:response xmlns:carddav="urn:ietf:params:xml:ns:carddav" xmlns:cm="http://cal.me.com/_namespace/" xmlns:md="urn:mobileme:davservices">\n  <D:href>/caldav/v2/[email protected]/events/[email protected]</D:href>\n  <D:status>HTTP/1.1 404 Not Found</D:status>\n </D:response>\n <D:response xmlns:carddav="urn:ietf:params:xml:ns:carddav" xmlns:cm="http://cal.me.com/_namespace/" xmlns:md="urn:mobileme:davservices">\n  <D:href>/caldav/v2/[email protected]/events/[email protected]</D:href>\n  <D:status>HTTP/1.1 404 Not Found</D:status>\n </D:response>\n <D:response xmlns:carddav="urn:ietf:params:xml:ns:carddav" xmlns:cm="http://cal.me.com/_namespace/" xmlns:md="urn:mobileme:davservices">\n  <D:href>/caldav/v2/[email protected]/events/[email protected]</D:href>\n  <D:status>HTTP/1.1 404 Not Found</D:status>\n </D:response>\n <D:response xmlns:carddav="urn:ietf:params:xml:ns:carddav" xmlns:cm="http://cal.me.com/_namespace/" xmlns:md="urn:mobileme:davservices">\n  <D:href>/caldav/v2/[email protected]/events/[email protected]</D:href>\n  <D:status>HTTP/1.1 404 Not Found</D:status>\n </D:response>\n</D:multistatus>\n

FrederikP avatar Oct 07 '22 08:10 FrederikP

Is this linked with https://github.com/pimutils/vdirsyncer/issues/760? Seeing the same issue while trying to link an existing fastmail cal.

It looks like any event with @ in it's name will error.

supermarin avatar Dec 22 '22 19:12 supermarin

I can't seem to figure out how to get a non-404 response from Fastmail CalDAV for events with at-signs in their UIDs. I've submitted a support ticket with Fastmail inquiring about the behavior.

raxod502 avatar May 24 '23 00:05 raxod502

I can't seem to figure out how to get a non-404 response from Fastmail CalDAV for events with at-signs in their UIDs. I've submitted a support ticket with Fastmail inquiring about the behavior.

Sounds like an issue in vdirsyncer to be honest, we have some issues with regards to un-encoding UIDs with escaped characters.

This is a separate issue though. I think there is a ticket for it somewhere.

I'll go ahead and make sure I test the new implementation for this specific sitution.

WhyNotHugo avatar Jul 04 '23 15:07 WhyNotHugo

I should have posted this follow-up (I haven't had a chance to look into it myself yet), but the Fastmail folks say this is a bug on the vdirsyncer side, and have a convincing argument for why:

image

raxod502 avatar Jul 19 '23 23:07 raxod502

In my testing, https://github.com/pimutils/vdirsyncer/commit/889183ec89ba807177ee7a276d6f9113df09e7ac resolves this issue (I did a bisect after finding the error was gone in the latest revision).

raxod502 avatar Oct 29 '23 02:10 raxod502

That patch was included in 0.19.0 (Dec 2022). Please upgrade

WhyNotHugo avatar Oct 29 '23 10:10 WhyNotHugo

Yep, I did so once I realized the issue had been resolved, and the new version works perfectly. Ubuntu 22.04 doesn't ship a recent enough version so I packaged it myself.

raxod502 avatar Oct 29 '23 22:10 raxod502