pimutils / pimutils/vdirsyncer

Error 403 when syncing to Google Calendar

Open
#843 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

  • Your vdirsyncer version: 0.16.8 (installed with pip)
  • If applicable, which server software (and which version) you're using: google calendar, and an ICS from Office 365
  • Your Python version: Python 3.8.5
  • Your operating system: Debian sid
  • Your config file:
status_path = "./status"

[storage o365]
type = "http"
url = "https://outlook.office365.com/owa/calendar/xx/xx/xx/reachcalendar.ics"

[storage gcal]
type = "google_calendar"
token_file = "gcal_token"
client_id="CLIENT_ID"
client_secret="CLIENT_SECRET"

[pair sync_o365_gcal]
a = "o365"
b = "gcal"
collections = [["calendar", null , "identifier@group.calendar.google.com"]]

Debug:

Copying (updating) item 9f50c6c1842c89541928ddb9fe8068bfb6c19c905e573dae75ffb10fc8377e9d to gcal/id@group.calendar.google.com
debug: Already normalized: '/caldav/v2/id@group.calendar.google.com/events/9f50c6c1842c89541928ddb9fe8068bfb6c19c905e573dae75ffb10fc8377e9d.ics'
debug: PUT https://apidata.googleusercontent.com/caldav/v2/id@group.calendar.google.com/events/9f50c6c1842c89541928ddb9fe8068bfb6c19c905e573dae75ffb10fc8377e9d.ics
debug: {'User-Agent': '973737131245-15cckkfme2da386qmvjkt74bic3gfk50.apps.googleusercontent.com', 'Content-Type': 'text/calendar', 'If-Match': '"63734152930"'}
debug: b'BEGIN:VCALENDAR\r\nPRODID:Microsoft Exchange Server 2010\r\nVERSION:2.0\r\nX-WR-CALNAME:Calendar\r\nBEGIN:VEVENT\r\nRRULE:FREQ=WEEKLY;UNTIL=20201101T230000Z;INTERVAL=3;BYDAY=MO;WKST=SU\r\nSUMMARY:Mec\r\nDTSTART;VALUE=DATE:20200831\r\nDTEND;VALUE=DATE:20200905\r\nCLASS:PUBLIC\r\nPRIORITY:5\r\nDTSTAMP:20200826T195637Z\r\nTRANSP:TRANSPARENT\r\nSTATUS:CONFIRMED\r\nSEQUENCE:0\r\nLOCATION:\r\nX-MICROSOFT-CDO-APPT-SEQUENCE:0\r\nX-MICROSOFT-CDO-BUSYSTATUS:FREE\r\nX-MICROSOFT-CDO-INTENDEDSTATUS:BUSY\r\nX-MICROSOFT-CDO-ALLDAYEVENT:TRUE\r\nX-MICROSOFT-CDO-IMPORTANCE:1\r\nX-MICROSOFT-CDO-INSTTYPE:1\r\nX-MICROSOFT-DONOTFORWARDMEETING:FALSE\r\nX-MICROSOFT-DISALLOW-COUNTER:FALSE\r\nUID:9f50c6c1842c89541928ddb9fe8068bfb6c19c905e573dae75ffb10fc8377e9d\r\nEND:VEVENT\r\nBEGIN:VEVENT\r\nRECURRENCE-ID;TZID=Romance Standard Time:20201012T000000\r\nSUMMARY:Mec\r\nDTSTART;VALUE=DATE:20201015\r\nDTEND;VALUE=DATE:20201017\r\nCLASS:PUBLIC\r\nPRIORITY:5\r\nDTSTAMP:20200826T195637Z\r\nTRANSP:TRANSPARENT\r\nSTATUS:CONFIRMED\r\nSEQUENCE:0\r\nLOCATION:\r\nX-MICROSOFT-CDO-APPT-SEQUENCE:0\r\nX-MICROSOFT-CDO-BUSYSTATUS:FREE\r\nX-MICROSOFT-CDO-INTENDEDSTATUS:BUSY\r\nX-MICROSOFT-CDO-ALLDAYEVENT:TRUE\r\nX-MICROSOFT-CDO-IMPORTANCE:1\r\nX-MICROSOFT-CDO-INSTTYPE:3\r\nX-MICROSOFT-DONOTFORWARDMEETING:FALSE\r\nX-MICROSOFT-DISALLOW-COUNTER:FALSE\r\nUID:9f50c6c1842c89541928ddb9fe8068bfb6c19c905e573dae75ffb10fc8377e9d\r\nEND:VEVENT\r\nBEGIN:VTIMEZONE\r\nTZID:Romance Standard Time\r\nBEGIN:STANDARD\r\nDTSTART:16010101T030000\r\nTZOFFSETFROM:+0200\r\nTZOFFSETTO:+0100\r\nRRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10\r\nEND:STANDARD\r\nBEGIN:DAYLIGHT\r\nDTSTART:16010101T020000\r\nTZOFFSETFROM:+0100\r\nTZOFFSETTO:+0200\r\nRRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3\r\nEND:DAYLIGHT\r\nEND:VTIMEZONE\r\nBEGIN:VTIMEZONE\r\nTZID:GMT Standard Time\r\nBEGIN:STANDARD\r\nDTSTART:16010101T020000\r\nTZOFFSETFROM:+0100\r\nTZOFFSETTO:+0000\r\nRRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10\r\nEND:STANDARD\r\nBEGIN:DAYLIGHT\r\nDTSTART:16010101T010000\r\nTZOFFSETFROM:+0000\r\nTZOFFSETTO:+0100\r\nRRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3\r\nEND:DAYLIGHT\r\nEND:VTIMEZONE\r\nEND:VCALENDAR'

debug: Sending request...
debug: 403
debug: {'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate', 'Pragma': 'no-cache', 'Date': 'Wed, 26 Aug 2020 19:55:26 GMT', 'Content-Type': 'text/xml; charset=UTF-8', 'Expires': 'Mon, 01 Jan 1990 00:00:00 GMT', 'Vary': 'Origin, X-Origin, Referer', 'Content-Encoding': 'gzip', 'Server': 'ESF', 'X-XSS-Protection': '0', 'X-Frame-Options': 'SAMEORIGIN', 'X-Content-Type-Options': 'nosniff', 'Alt-Svc': 'h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"', 'Transfer-Encoding': 'chunked'}
debug: b'<?xml version="1.0" encoding="UTF-8"?>\n<D:error xmlns:D="DAV:"/>\n'
error: Unknown error occurred for sync/calendar: 403 Client Error: Forbidden for url: https://apidata.googleusercontent.com/caldav/v2/id@group.calendar.google.com/events/9f50c6c1842c89541928ddb9fe8068bfb6c19c905e573dae75ffb10fc8377e9d.ics
error: Use `-vdebug` to see the full traceback.
debug:   File "/home/devilkin/.local/lib/python3.8/site-packages/vdirsyncer/cli/utils.py", line 72, in handle_cli_error
debug:     raise e
debug:   File "/home/devilkin/.local/lib/python3.8/site-packages/vdirsyncer/sync/__init__.py", line 148, in sync
debug:     action.run(
debug:   File "/home/devilkin/.local/lib/python3.8/site-packages/vdirsyncer/sync/__init__.py", line 176, in run
debug:     self._run_impl(a, b)
debug:   File "/home/devilkin/.local/lib/python3.8/site-packages/vdirsyncer/sync/__init__.py", line 227, in _run_impl
debug:     self.dest.storage.update(meta.href, self.item, meta.etag)
debug:   File "/home/devilkin/.local/lib/python3.8/site-packages/vdirsyncer/storage/base.py", line 13, in inner
debug:     return f(self, *args, **kwargs)
debug:   File "/home/devilkin/.local/lib/python3.8/site-packages/vdirsyncer/storage/base.py", line 13, in inner
debug:     return f(self, *args, **kwargs)
debug:   File "/home/devilkin/.local/lib/python3.8/site-packages/vdirsyncer/storage/base.py", line 13, in inner
debug:     return f(self, *args, **kwargs)
debug:   File "/home/devilkin/.local/lib/python3.8/site-packages/vdirsyncer/storage/dav.py", line 544, in update
debug:     href, etag = self._put(self._normalize_href(href), item, etag)
debug:   File "/home/devilkin/.local/lib/python3.8/site-packages/vdirsyncer/storage/dav.py", line 514, in _put
debug:     response = self.session.request(
debug:   File "/home/devilkin/.local/lib/python3.8/site-packages/vdirsyncer/storage/dav.py", line 388, in request
debug:     return http.request(method, url, session=self._session, **more)
debug:   File "/home/devilkin/.local/lib/python3.8/site-packages/vdirsyncer/http.py", line 162, in request
debug:     r.raise_for_status()
debug:   File "/home/devilkin/.local/lib/python3.8/site-packages/requests/models.py", line 941, in raise_for_status
debug:     raise HTTPError(http_error_msg, response=self)
error: 1 out of 2 tasks failed.

This looks like #692

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 supplied configuration and trace the failed update from vdirsyncer/sync/init.py through storage/dav.py and http.py, especially the PUT request. Compare the behavior with issue #692 and determine why Google Calendar rejects this event; done means the provided sync completes without the 403 failure.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.