etesync / etesync-dav

This is a CalDAV and CardDAV adapter for EteSync
https://www.etesync.com
GNU General Public License v3.0
295 stars 50 forks source link

macOS calendar sync fails #95

Closed zakkak closed 5 years ago

zakkak commented 5 years ago

The last couple of days calendar is failing to sync with etesync. I have tried restarting both but it still doesn't work. It looks like calendar is trying to delete an event that does not exist, and then tries to access / which is forbidden.

Any instructions on how to debug/fix this?

[700003c9e000] INFO: DELETE request for '/foivos@zakkak.net/6bb1fe02073ef559ec6d88d4bf569ebde96ae6aa8fdffbe306494ec964243b30/' received from 127.0.0.1 using 'Mac+OS+X/10.14.6 (18G103) CalendarAgent/416.5.1'
[700003c9e000] DEBUG: Request headers:
{'CONTENT_LENGTH': '0',
 'CONTENT_TYPE': 'text/plain',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': '*/*',
 'HTTP_ACCEPT_ENCODING': 'br, gzip, deflate',
 'HTTP_ACCEPT_LANGUAGE': 'en-ie',
 'HTTP_AUTHORIZATION': 'Basic **masked**',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_HOST': 'localhost:37358',
 'HTTP_USER_AGENT': 'Mac+OS+X/10.14.6 (18G103) CalendarAgent/416.5.1',
 'PATH_INFO': '/foivos@zakkak.net/6bb1fe02073ef559ec6d88d4bf569ebde96ae6aa8fdffbe306494ec964243b30/',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '127.0.0.1',
 'REMOTE_CERTIFICATE': None,
 'REMOTE_HOST': '',
 'REQUEST_METHOD': 'DELETE',
 'SCRIPT_NAME': '',
 'SERVER_NAME': '1.0.0.127.in-addr.arpa',
 'SERVER_PORT': '37358',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SOFTWARE': 'WSGIServer/0.2',
 'wsgi.errors': <_io.StringIO object at 0x10e3960d8>,
 'wsgi.file_wrapper': <class 'wsgiref.util.FileWrapper'>,
 'wsgi.input': <_io.BufferedReader name=9>,
 'wsgi.multiprocess': False,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}
[700003c9e000] DEBUG: Sanitized script name: ''
[700003c9e000] DEBUG: Sanitized path: '/foivos@zakkak.net/6bb1fe02073ef559ec6d88d4bf569ebde96ae6aa8fdffbe306494ec964243b30/'
[700003c9e000] INFO: Successful login: 'foivos@zakkak.net'
[700003c9e000] DEBUG: Response content:
The requested resource could not be found.
[700003c9e000] INFO: DELETE response status for '/foivos@zakkak.net/6bb1fe02073ef559ec6d88d4bf569ebde96ae6aa8fdffbe306494ec964243b30/' in 0.039 seconds: 404 Not Found
[700003c9e000] INFO: PROPFIND request for '/' with depth '0' received from 127.0.0.1 using 'Mac+OS+X/10.14.6 (18G103) CalendarAgent/416.5.1'
[700003c9e000] DEBUG: Request headers:
{'CONTENT_LENGTH': '176',
 'CONTENT_TYPE': 'text/xml',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': '*/*',
 'HTTP_ACCEPT_ENCODING': 'br, gzip, deflate',
 'HTTP_ACCEPT_LANGUAGE': 'en-ie',
 'HTTP_AUTHORIZATION': 'Basic **masked**',
 'HTTP_BRIEF': 't',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_DEPTH': '0',
 'HTTP_HOST': 'localhost:37358',
 'HTTP_PREFER': 'return=minimal',
 'HTTP_USER_AGENT': 'Mac+OS+X/10.14.6 (18G103) CalendarAgent/416.5.1',
 'PATH_INFO': '/',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '127.0.0.1',
 'REMOTE_CERTIFICATE': None,
 'REMOTE_HOST': '',
 'REQUEST_METHOD': 'PROPFIND',
 'SCRIPT_NAME': '',
 'SERVER_NAME': '1.0.0.127.in-addr.arpa',
 'SERVER_PORT': '37358',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SOFTWARE': 'WSGIServer/0.2',
 'wsgi.errors': <_io.StringIO object at 0x10e3960d8>,
 'wsgi.file_wrapper': <class 'wsgiref.util.FileWrapper'>,
 'wsgi.input': <_io.BufferedReader name=9>,
 'wsgi.multiprocess': False,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}
[700003c9e000] DEBUG: Sanitized script name: ''
[700003c9e000] DEBUG: Sanitized path: '/'
[700003c9e000] INFO: Successful login: 'foivos@zakkak.net'
[700003c9e000] DEBUG: Request content:
<?xml version="1.0"?>
<propfind xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
  <prop>
    <C:calendar-free-busy-set />
  </prop>
</propfind>

[700003c9e000] DEBUG: 'foivos@zakkak.net' has read access to collection ''
[700003c9e000] DEBUG: Response content:
<?xml version="1.0"?>
<multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
  <response>
    <href>/</href>
    <propstat>
      <prop>
        <C:calendar-free-busy-set />
      </prop>
      <status>HTTP/1.1 200 OK</status>
    </propstat>
  </response>
</multistatus>

[700003c9e000] INFO: PROPFIND response status for '/' with depth '0' in 0.027 seconds: 207 Multi-Status
[700003c9e000] INFO: PROPPATCH request for '/' received from 127.0.0.1 using 'Mac+OS+X/10.14.6 (18G103) CalendarAgent/416.5.1'
[700003c9e000] DEBUG: Request headers:
{'CONTENT_LENGTH': '191',
 'CONTENT_TYPE': 'text/xml',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': '*/*',
 'HTTP_ACCEPT_ENCODING': 'br, gzip, deflate',
 'HTTP_ACCEPT_LANGUAGE': 'en-ie',
 'HTTP_AUTHORIZATION': 'Basic **masked**',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_HOST': 'localhost:37358',
 'HTTP_USER_AGENT': 'Mac+OS+X/10.14.6 (18G103) CalendarAgent/416.5.1',
 'PATH_INFO': '/',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '127.0.0.1',
 'REMOTE_CERTIFICATE': None,
 'REMOTE_HOST': '',
 'REQUEST_METHOD': 'PROPPATCH',
 'SCRIPT_NAME': '',
 'SERVER_NAME': '1.0.0.127.in-addr.arpa',
 'SERVER_PORT': '37358',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SOFTWARE': 'WSGIServer/0.2',
 'wsgi.errors': <_io.StringIO object at 0x10e3960d8>,
 'wsgi.file_wrapper': <class 'wsgiref.util.FileWrapper'>,
 'wsgi.input': <_io.BufferedReader name=9>,
 'wsgi.multiprocess': False,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}
[700003c9e000] DEBUG: Sanitized script name: ''
[700003c9e000] DEBUG: Sanitized path: '/'
[700003c9e000] INFO: Successful login: 'foivos@zakkak.net'
[700003c9e000] INFO: Access to '/' denied for 'foivos@zakkak.net'
[700003c9e000] DEBUG: Response content:
Access to the requested resource forbidden.
[700003c9e000] INFO: PROPPATCH response status for '/' in 0.014 seconds: 403 Forbidden
tasn commented 5 years ago

That's not an even it's trying to delete, but rather the calendar itself. Be lock such operations in etesync-dav, which is why it's failing. Any idea why the mac would try to do that? An easy way to get things to work again is to remove your calendar account from the mac and adding it again so it forgets it wants to delete it.

zakkak commented 5 years ago

That's not an even it's trying to delete, but rather the calendar itself.

Interesting, I checked and the hash that it tries to delete does not exist in my calendars.

Any idea why the mac would try to do that?

Maybe I accidentally added a new calendar from the calendar.app and then removed it so now it tries to sync.

An easy way to get things to work again is to remove your calendar account from the mac and adding it again so it forgets it wants to delete it.

This might result in losing recently added events though.

zakkak commented 5 years ago

This might result in losing recently added events though.

My bad, it looks like the events are synced properly, so it safe to do. That solved it for now, thanks.

tasn commented 5 years ago

Ah great. Please reopen if this happens again and wasn't just a one-time fluke. I think etesync-dav was behaving correctly here, though maybe it should be more aggressive in telling the mac that deletions are not allowed.

Thanks for all the info!