pimutils / vdirsyncer

📇 Synchronize calendars and contacts.

Home Page:https://vdirsyncer.pimutils.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When syncing with Google Calendar, if the GCal side is empty, vdirsyncer errors with "Storage was completely emptied" (on local side)

presto8 opened this issue · comments

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.