Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
legrostdg opened this issue Nov 25, 2014 · 8 comments
Closed

Comments

@legrostdg
Copy link

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
Copy link
Member

Interesting... which server software is this?

@legrostdg
Copy link
Author

radicale 0.7-1.1 on debian stable

@untitaker
Copy link
Member

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
Copy link
Member

You can try the development version of vdirsyncer with

pip install --user --force-reinstall git+https://github.com/untitaker/vdirsyncer.git

untitaker added a commit that referenced this issue Nov 26, 2014
@legrostdg
Copy link
Author

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
Copy link
Member

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

untitaker added a commit that referenced this issue Nov 27, 2014
@untitaker
Copy link
Member

There, should really be fixed now.

@legrostdg
Copy link
Author

thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants