pimutils / pimutils/vdirsyncer

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

Open
#1,007 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

mod: Google
Dominant language
Python
Stars
1.9k
Forks
185
Avg merge
11h 49m
Merged PRs (30d)
1

Description

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", "name@example.com", "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/name@example.com/events/idj879l08i1jpn7i5j4qm0g4qs_R20211026T130000@google.com.ics
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/name@example.com/events/idj879l08i1jpn7i5j4qm0g4qs_R20211026T130000@google.com.ics</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/name@example.com/events/hsko8ourfkjtf63bv0cp5qjnds_R20211022T143000@google.com.ics</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/name@example.com/events/hsko8ourfkjtf63bv0cp5qjnds_R20201002T143000@google.com.ics</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/name@example.com/events/hsko8ourfkjtf63bv0cp5qjnds_R20211015T143000@google.com.ics</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/name@example.com/events/hsko8ourfkjtf63bv0cp5qjnds_R20201120T153000@google.com.ics</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/name@example.com/events/hsko8ourfkjtf63bv0cp5qjnds@google.com.ics</D:href>\n  <D:status>HTTP/1.1 404 Not Found</D:status>\n </D:response>\n</D:multistatus>\n

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the supplied google_calendar configuration and bounded start_date/end_date values. Read sync/init.py around prepare_new_status and storage/dav.py around get_multi, then trace how the Google Calendar storage produces or handles the listed 404 hrefs. Done means syncing this configuration no longer fails on those 404 responses while date filtering remains active.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.