pimutils / vdirsyncer

📇 Synchronize calendars and contacts.
https://vdirsyncer.pimutils.org/
Other
1.57k stars 163 forks source link

caldav sync fails: "TypeError: argument of type 'NoneType' is not iterable" #138

Closed legrostdg closed 9 years ago

legrostdg commented 9 years ago

The first sync succeed, the second one (and the next ones) fails.

version: vdirsyncer, version 0.3.1

config:

[general]
status_path = ~/.vdirsyncer/status/

[pair my_calendars_home ]
a = my_calendars_home_local
b = my_calendars_home_remote

[storage my_calendars_home_local]
type = filesystem
path = ~/.calendars/home
fileext = .ics

[storage my_calendars_home_remote]
type = caldav
url = http://dav.myserver.com:5232/user/my_calendar/home

running "vdirsyncer -v debug sync" returns:

debug: Using 0 maximal workers.
Syncing my_calendars_home 
debug: Loaded status for my_calendars_home 
debug: OPTIONS http://dav.myserver.com:5232/user/my_calendar/home/
debug: {'Depth': 1, 'Content-Type': 'application/xml; charset=UTF-8', 'User-Agent': 'vdirsyncer'}
debug: None
debug: Sending request...
debug: 200
debug: {'date': 'Tue, 25 Nov 2014 22:05:22 GMT', 'dav': '1, 2, 3, calendar-access, addressbook, extended-mkcol', 'content-length': '0', 'allow': 'DELETE, HEAD, GET, MKCALENDAR, MKCOL, MOVE, OPTIONS, PROPFIND, PROPPATCH, PUT, REPORT', 'server': 'WSGIServer/0.1 Python/2.7.3'}

debug: REPORT http://dav.myserver.com:5232/user/my_calendar/home/
debug: {'Depth': 'infinity', 'Content-Type': 'application/xml; charset=UTF-8', 'User-Agent': 'vdirsyncer'}
debug: <?xml version="1.0" encoding="utf-8" ?>
debug:             <C:calendar-query xmlns:D="DAV:"
debug:                 xmlns:C="urn:ietf:params:xml:ns:caldav">
debug:                 <D:prop>
debug:                     <D:getcontenttype/>
debug:                     <D:getetag/>
debug:                 </D:prop>
debug:                 <C:filter>
debug:                 
debug:                 <C:comp-filter name="VCALENDAR">
debug:                     <C:comp-filter name="VTODO">
debug:                         
debug:                     </C:comp-filter>
debug:                 </C:comp-filter>
debug:                 
debug:                 </C:filter>
debug:             </C:calendar-query>
debug: Sending request...
debug: 207
debug: {'date': 'Tue, 25 Nov 2014 22:05:22 GMT', 'content-length': '346', 'content-type': 'text/xml', 'server': 'WSGIServer/0.1 Python/2.7.3'}
debug: <?xml version="1.0"?>
debug: <multistatus xmlns="DAV:">
debug:   <response>
debug:     <href>/user/my_calendar/home/7GV60OQVQPF5306JY6PZU4VRJQNVFXQ3U7LM.ics</href>
debug:     <propstat>
debug:       <prop>
debug:         <getcontenttype />
debug:         <getetag>"3694605281617704285"</getetag>
debug:       </prop>
debug:       <status>HTTP/1.1 200 OK</status>
debug:     </propstat>
debug:   </response>
debug: </multistatus>

Unhandled exception occured while syncing my_calendars_home .
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/vdirsyncer/cli.py", line 472, in sync_collection
    force_delete=status_name in force_delete
  File "build/bdist.linux-x86_64/egg/vdirsyncer/sync.py", line 129, in sync
    b_idents = _prepare_idents(storage_b, storage_a, b_href_to_status)
  File "build/bdist.linux-x86_64/egg/vdirsyncer/sync.py", line 66, in _prepare_idents
    for href, etag in storage.list():
  File "build/bdist.linux-x86_64/egg/vdirsyncer/storage/dav.py", line 552, in list
    for href, etag in self._dav_query(xml):
  File "build/bdist.linux-x86_64/egg/vdirsyncer/storage/dav.py", line 424, in _dav_query
     if self.item_mimetype not in contenttype
TypeError: argument of type 'NoneType' is not iterable
untitaker commented 9 years ago

Interesting... which server software is this?

legrostdg commented 9 years ago

radicale 0.7-1.1 on debian stable

untitaker commented 9 years ago

Ugh, please update to the latest version of Radicale. I can fix this particular bug, but especially old versions of Radicale are full of bugs and I don't recommend using them.

untitaker commented 9 years ago

You can try the development version of vdirsyncer with

pip install --user --force-reinstall git+https://github.com/untitaker/vdirsyncer.git
legrostdg commented 9 years ago

Thanks :-). The problem changed, but is still there: the first sync is ok. The second one now fails with:

error: my_calendars_home : Storage "my_calendars_home_remote" was completely emptied. Use "--force-delete my_calendars_home " to synchronize that emptyness to the other side, or delete the status by yourself to restore the items from the non-empty side.

debug log:

debug: Using 0 maximal workers.
Syncing my_calendars_home 
debug: Loaded status for my_calendars_home 
debug: OPTIONS http://dav.example.com:5232/user/my_calendar/home/
debug: {'Depth': 1, 'Content-Type': 'application/xml; charset=UTF-8', 'User-Agent': 'vdirsyncer'}
debug: None
debug: Sending request...
debug: 200
debug: {'date': 'Wed, 26 Nov 2014 20:11:43 GMT', 'dav': '1, 2, 3, calendar-access, addressbook, extended-mkcol', 'content-length': '0', 'allow': 'DELETE, HEAD, GET, MKCALENDAR, MKCOL, MOVE, OPTIONS, PROPFIND, PROPPATCH, PUT, REPORT', 'server': 'WSGIServer/0.1 Python/2.7.3'}

debug: REPORT http://dav.example.com:5232/user/my_calendar/home/
debug: {'Depth': 'infinity', 'Content-Type': 'application/xml; charset=UTF-8', 'User-Agent': 'vdirsyncer'}
debug: <?xml version="1.0" encoding="utf-8" ?>
debug:             <C:calendar-query xmlns:D="DAV:"
debug:                 xmlns:C="urn:ietf:params:xml:ns:caldav">
debug:                 <D:prop>
debug:                     <D:getcontenttype/>
debug:                     <D:getetag/>
debug:                 </D:prop>
debug:                 <C:filter>
debug:                 
debug:                 <C:comp-filter name="VCALENDAR">
debug:                     <C:comp-filter name="VTODO">
debug:                         
debug:                     </C:comp-filter>
debug:                 </C:comp-filter>
debug:                 
debug:                 </C:filter>
debug:             </C:calendar-query>
debug: Sending request...
debug: 207
debug: {'date': 'Wed, 26 Nov 2014 20:11:43 GMT', 'content-length': '346', 'content-type': 'text/xml', 'server': 'WSGIServer/0.1 Python/2.7.3'}
debug: <?xml version="1.0"?>
debug: <multistatus xmlns="DAV:">
debug:   <response>
debug:     <href>/user/my_calendar/home/7GV60OQVQPF5306JY6PZU4VRJQNVFXQ3U7LM.ics</href>
debug:     <propstat>
debug:       <prop>
debug:         <getcontenttype />
debug:         <getetag>"4612567577124600061"</getetag>
debug:       </prop>
debug:       <status>HTTP/1.1 200 OK</status>
debug:     </propstat>
debug:   </response>
debug: </multistatus>
debug: Skipping item with href '/user/my_calendar/home/7GV60OQVQPF5306JY6PZU4VRJQNVFXQ3U7LM.ics' because content type None != 'text/calendar'.
debug: REPORT http://dav.example.com:5232/user/my_calendar/home/
debug: {'Depth': 'infinity', 'Content-Type': 'application/xml; charset=UTF-8', 'User-Agent': 'vdirsyncer'}
debug: <?xml version="1.0" encoding="utf-8" ?>
debug:             <C:calendar-query xmlns:D="DAV:"
debug:                 xmlns:C="urn:ietf:params:xml:ns:caldav">
debug:                 <D:prop>
debug:                     <D:getcontenttype/>
debug:                     <D:getetag/>
debug:                 </D:prop>
debug:                 <C:filter>
debug:                 
debug:                 <C:comp-filter name="VCALENDAR">
debug:                     <C:comp-filter name="VEVENT">
debug:                         
debug:                     </C:comp-filter>
debug:                 </C:comp-filter>
debug:                 
debug:                 </C:filter>
debug:             </C:calendar-query>
debug: Sending request...
debug: 207
debug: {'date': 'Wed, 26 Nov 2014 20:11:43 GMT', 'content-length': '346', 'content-type': 'text/xml', 'server': 'WSGIServer/0.1 Python/2.7.3'}
debug: <?xml version="1.0"?>
debug: <multistatus xmlns="DAV:">
debug:   <response>
debug:     <href>/user/my_calendar/home/7GV60OQVQPF5306JY6PZU4VRJQNVFXQ3U7LM.ics</href>
debug:     <propstat>
debug:       <prop>
debug:         <getcontenttype />
debug:         <getetag>"4612567577124600061"</getetag>
debug:       </prop>
debug:       <status>HTTP/1.1 200 OK</status>
debug:     </propstat>
debug:   </response>
debug: </multistatus>
debug: Skipping item with href '/user/my_calendar/home/7GV60OQVQPF5306JY6PZU4VRJQNVFXQ3U7LM.ics' because content type None != 'text/calendar'.
error: my_calendars_home : Storage "my_calendars_home_remote" was completely emptied. Use "--force-delete my_calendars_home " to synchronize that emptyness to the other side, or delete the status by yourself to restore the items from the non-empty side.
untitaker commented 9 years ago

oh goddamnit, it was a conceptual mistake on my part. Will fix tomorrow.

untitaker commented 9 years ago

There, should really be fixed now.

legrostdg commented 9 years ago

thanks :-)