pimutils / pimutils/vdirsyncer
When syncing with Google Calendar, if the GCal side is empty, vdirsyncer errors with "Storage was completely emptied" (on local side)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 185
- Avg merge
- 11h 49m
- Merged PRs (30d)
- 1
Description
I have a Google Calendar account with a sub calendar that tracks an .ICS file from a third-party provider. After events are complete, this provider deletes the .ICS entries, which results in Google Calendar removing all entries on the sub calendar. It seems vdirsyncer interprets an empty directory on the local side as being a possible error condition (which it would be normally), except that the remote side is also completely empty.
I run vdirsyncer as a systemd timer and this issue causes a non-zero return code, which then is flagged as a failed unit in systemd.
Things to include in your bugreport:
-
Your vdirsyncer version
0.19.2 -
If applicable, which server software (and which version) you're using
Google Calendar -
Your Python version
3.11 -
Your operating system
nixos -
Your config file
[general]
status_path = "~/.calendars/status/"
[pair gcal_sync]
a = "gcal"
b = "gcallocal"
collections = ["from a", "from b"]
conflict_resolution = "a wins"
metadata = ["color"]
[storage gcal]
type = "google_calendar"
token_file = "~/.calendars/gcal_token_file"
[storage gcallocal]
type = "filesystem"
path = "~/.calendars/gcal"
fileext = ".ics"
# secrets redacted
- Debug output
$ vdirsyncer -v DEBUG sync
debug: Sending request...
Syncing gcal_sync/xxxxxxxxxxxxxx@import.calendar.google.com
debug: ====================
debug: PROPFIND https://apidata.googleusercontent.com/caldav/v2/xxxxxxxxxxxxxx%40import.calendar.google.com/events/
debug: {'User-Agent': 'xxxxxxxx.apps.googleusercontent.com', 'Content-Type': 'application/xml; charset=UTF-8', 'Depth': '1'}
debug: b'<?xml version="1.0" encoding="utf-8" ?>\n <propfind xmlns="DAV:">\n <prop>\n <resourcetype/>\n <getcontenttype/>\n <getetag/>\n </prop>\n </propfind>\n '
debug: Sending request...
debug: 207
debug: <CIMultiDictProxy('Pragma': 'no-cache', 'Expires': 'Mon, 01 Jan 1990 00:00:00 GMT', 'Date': 'Tue, 05 Dec 2023 17:59:27 GMT', 'Content-Type': 'text/xml; charset=UTF-8', 'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate', 'Vary': 'Origin', 'Vary': 'X-Origin', 'Vary': 'Referer', 'Content-Encoding': 'gzip', 'Server': 'ESF', 'X-XSS-Protection': '0', 'X-Frame-Options': 'SAMEORIGIN', 'X-Content-Type-Options': 'nosniff', 'Alt-Svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000', 'Transfer-Encoding': 'chunked')>
debug: <StreamReader 858 bytes eof>
debug: Already normalized: '/caldav/v2/xxxxxxxxxxxxxx@import.calendar.google.com/events/'
debug: Skipping '/caldav/v2/xxxxxxxxxxxxxx@import.calendar.google.com/events/', is collection.
error: gcal_sync/xxxxxxxxxxxxxx@import.calendar.google.com: Storage "gcal/xxxxxxxxxxxxxx@import.calendar.google.com" was completely emptied. If you want to delete ALL entries on BOTH sides, then use `vdirsyncer sync --force-delete gcal_sync/xxxxxxxxxxxxxx@import.calendar.google.com`. Otherwise delete the files for gcal_sync/xxxxxxxxxxxxxx@import.calendar.google.com in your status directory.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the case with the supplied vdirsyncer configuration and run vdirsyncer -v DEBUG sync against a Google Calendar subcalendar that is empty on both sides. Trace the code path producing the “Storage was completely emptied” error; done means an empty remote and local calendar sync without a non-zero exit code, while the existing safety check remains for one-sided deletion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100