read1msg: mark request completed, ld 0x7fdfb4d38300 msgid 4
request done: ld 0x7fdfb4d38300 msgid 4
res_errno: 0, res_error: <>, res_matched: <>
ldap_free_request (origid 4, msgid 4)
ldap_parse_result
ldap_msgfree
[Wed Apr 02 17:23:22 2014] [error] [Wed Apr 02 17:23:22 2014] [ERROR] [pid=12954 django.request] Internal Server Error: /index/login/
[Wed Apr 02 17:23:22 2014] [error] Traceback (most recent call last):
[Wed Apr 02 17:23:22 2014] [error] File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 111, in get_response
[Wed Apr 02 17:23:22 2014] [error] response = callback(request, *callback_args, **callback_kwargs)
[Wed Apr 02 17:23:22 2014] [error] File "/usr/lib/python2.7/dist-packages/django/views/decorators/debug.py", line 69, in sensitive_post_parameters_wrapper
[Wed Apr 02 17:23:22 2014] [error] return view(request, *args, **kwargs)
[Wed Apr 02 17:23:22 2014] [error] File "/usr/lib/pymodules/python2.7/nav/web/webfront/views.py", line 92, in login
[Wed Apr 02 17:23:22 2014] [error] return do_login(request)
[Wed Apr 02 17:23:22 2014] [error] File "/usr/lib/python2.7/dist-packages/django/views/decorators/debug.py", line 34, in sensitive_variables_wrapper
[Wed Apr 02 17:23:22 2014] [error] return func(*args, **kwargs)
[Wed Apr 02 17:23:22 2014] [error] File "/usr/lib/pymodules/python2.7/nav/web/webfront/views.py", line 127, in do_login
[Wed Apr 02 17:23:22 2014] [error] account = auth.authenticate(username, password)
[Wed Apr 02 17:23:22 2014] [error] File "/usr/lib/pymodules/python2.7/nav/web/auth.py", line 79, in authenticate
[Wed Apr 02 17:23:22 2014] [error] user = ldapauth.authenticate(username, password)
[Wed Apr 02 17:23:22 2014] [error] File "/usr/lib/pymodules/python2.7/nav/web/ldapauth.py", line 151, in authenticate
[Wed Apr 02 17:23:22 2014] [error] if user.is_group_member(group_dn):
[Wed Apr 02 17:23:22 2014] [error] File "/usr/lib/pymodules/python2.7/nav/web/ldapauth.py", line 280, in is_group_member
[Wed Apr 02 17:23:22 2014] [error] result = self.ldap.search_s(group_dn, ldap.SCOPE_BASE, filterstr)
[Wed Apr 02 17:23:22 2014] [error] File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 552, in search_s
[Wed Apr 02 17:23:22 2014] [error] return self.search_ext_s(base,scope,filterstr,attrlist,attrsonly,None,None,timeout=self.timeout)
[Wed Apr 02 17:23:22 2014] [error] File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 545, in search_ext_s
[Wed Apr 02 17:23:22 2014] [error] msgid = self.search_ext(base,scope,filterstr,attrlist,attrsonly,serverctrls,clientctrls,timeout,sizelimit)
[Wed Apr 02 17:23:22 2014] [error] File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 541, in search_ext
[Wed Apr 02 17:23:22 2014] [error] timeout,sizelimit,
[Wed Apr 02 17:23:22 2014] [error] File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 99, in _ldap_call
[Wed Apr 02 17:23:22 2014] [error] result = func(*args,**kwargs)
[Wed Apr 02 17:23:22 2014] [error] UnicodeEncodeError: 'ascii' codec can't encode character u'\\xfc' in position 26: ordinal not in range(128)
ldap_free_connection 1 1
ldap_send_unbind
ldap_free_connection: actually freed
On Tue, 1 Apr 2014 11:29:27 +0000 Sjøholt Steinar Otto <ssj@hials.no> wrote:I'm happy to say the fix works for MOST of our users.Unfortunately not for me...I have traced it down to the fact that i have a "ø" in my last name.Users with names not containing "æøå" can log in just fine.[snip][Tue Apr 01 11:29:17 2014] [error] self.ldap.simple_bind_s(user_dn.encode(encoding),[Tue Apr 01 11:29:17 2014] [error] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 18: ordinal not in range(128)Oops. The code does not consider that the user search result from theLDAP server is already encoded as UTF-8. Attempting to encode an alreadyencoded string will cause Python to attempt to decode it from ASCII tounicode, before encoding that as UTF-8 again.And I'm sorry to say, your name is not ASCII compatible ,)It's a quick fix; I've taken the liberty of patching your server so youcan log in again, Steinar :)--Morten BrekkevoldUNINETT