Skip to content

'NoneType' object has no attribute 'count' #9

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

Closed
ma2thieu opened this issue Jan 19, 2014 · 9 comments
Closed

'NoneType' object has no attribute 'count' #9

ma2thieu opened this issue Jan 19, 2014 · 9 comments

Comments

@ma2thieu
Copy link

I get this error when trying to khal --sync :

$ khal --sync
Server password (account Matthieu):
CRITICAL:root:While syncing account Matthieu an error occured:
'NoneType' object has no attribute 'count'

The caldav server is based on sabredav 1.8.7

@geier
Copy link
Member

geier commented Jan 19, 2014

please paste the output of of khal --sync --debug (with personal details as your resource url redacted)

@ma2thieu
Copy link
Author

$ khal --sync --debug
DEBUG:root:Using configuration from /home/matthieu/.config/khal/khal.conf
DEBUG:root:Using configuration:
DEBUG:root:created version table
DEBUG:root:created accounts table
Server password (account Matthieu):
DEBUG:root:starting to sync calendar Matthieu
CRITICAL:root:While syncing account Matthieu an error occured:
'NoneType' object has no attribute 'count'

the caldav server log shows no error

My khal.conf :
[Account Matthieu]
user: [email protected]
resource: http://bbb.com
#resource: https://cal.ccc.com/calendars/[email protected]/default/
#ssl_verify: false
color: dark blue

The resource url is my domain name which has this DNS entries :
_caldavs._tcp.bbb.com. 3600 IN SRV 0 0 443 cal.ccc.com.
_carddavs._tcp.bbb.com. 3600 IN SRV 0 0 443 cal.ccc.com.

When trying to use the 2nd resource (the full one in https) I get this error :
$ khal --sync --debug
DEBUG:root:Using configuration from /home/matthieu/.config/khal/khal.conf
DEBUG:root:Using configuration:
DEBUG:root:created version table
DEBUG:root:created accounts table
Server password (account Matthieu):
DEBUG:root:starting to sync calendar Matthieu
CRITICAL:root:While syncing account Matthieu an error occured:
401 Client Error

and the server did send a 401 :
xx.xx.xx.xx - [email protected] [19/Jan/2014:23:36:54 +0100] "OPTIONS /calendars/[email protected]/default/ HTTP/1.1" 401 6900 "-" "khal"

(idem with this URL : https://cal.ccc.com/principals/[email protected]/)

@geier
Copy link
Member

geier commented Jan 19, 2014

the last refactoring seems to have broken proper error logging :(
please try commit c6c6b8d

@geier
Copy link
Member

geier commented Jan 19, 2014

the very latest commit 4b5a846 should fix this, too

@ma2thieu
Copy link
Author

Error logging is working :)

$ khal --sync --debug
DEBUG:root:Using configuration from /home/matthieu/.config/khal/khal.conf
DEBUG:root:Using configuration:
DEBUG:root:created version table
DEBUG:root:created accounts table
Server password (account Matthieu):
DEBUG:root:starting to sync calendar Matthieu
Traceback (most recent call last):
File "/usr/local/bin/khal", line 5, in
pkg_resources.run_script('khal==0.1.0.dev', 'khal')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/khal-0.1.0.dev-py2.7.egg/EGG-INFO/scripts/khal", line 75, in
sys.exit(collection.sync())
File "/usr/local/lib/python2.7/dist-packages/khal-0.1.0.dev-py2.7.egg/khal/khalendar.py", line 273, in sync
rvalue += one.sync()
File "/usr/local/lib/python2.7/dist-packages/khal-0.1.0.dev-py2.7.egg/khal/khalendar.py", line 136, in sync
self._sync_caldav()
File "/usr/local/lib/python2.7/dist-packages/khal-0.1.0.dev-py2.7.egg/khal/khalendar.py", line 153, in _sync_caldav
auth=self._auth)
File "/usr/local/lib/python2.7/dist-packages/khal-0.1.0.dev-py2.7.egg/khal/caldav.py", line 164, in init
if response.headers['DAV'].count('calendar-access') == 0:
AttributeError: 'NoneType' object has no attribute 'count'

@geier
Copy link
Member

geier commented Jan 20, 2014

Since your second report looks different than the first and third one and the server did send a return code 401 (unauthorized), could it be that you just mistyped your password?

Anyway, in the (first and) third report khal can not find a DAV header in the response, indicating that khal is not querying the right URL. This could be a configuration problem or khal could somehow mangle your correctly entered URL (or a lot of other things). Could you have a look at your server logs again?

Also, if you do have xmpp/jabber, you might want to add me (my details are on http://lostpackets.de/khal/ under Feedback), as it would probably much easier to debug this problem that way.

@ma2thieu
Copy link
Author

The first URL (http://bbb.com) is not the caldav server but it has a DNS entry (_caldavs._tcp.bbb.com. 3600 IN SRV 0 0 443 cal.ccc.com.) that point to the caldav server (https://cal.ccc.com), I think that's why khal doesn't find a DAV header.

If I use the caldav server URL (https://cal.ccc.com/calendars/[email protected]/default/) I get a 401 error.
Maybe it has to do with the type of authentification (plain, digest, ...) ?

I added you to my jabber account (matthieu)
thanks.

@geier
Copy link
Member

geier commented Jan 23, 2014

I didn't get any notice on jabber, please try again (or send me your jabber address via email (also under Feedback).

@ma2thieu
Copy link
Author

thanks for your help on jabber, the fix was to use auth: digest in the conf file.

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

No branches or pull requests

2 participants