Tryton - Issues

 

Issue6177

Title LDAP Exception
Priority bug Status resolved
Superseder Nosy List ced, christoph.larsen@synalinq.com, mrichez, pokoli, reviewbot, roundup-bot
Type Components ldap_authentication
Assigned To mrichez Keywords review
Reviews 31001002, 31901002
View: 31001002, 31901002

Created on 2017-01-11.13:38:19 by christoph.larsen@synalinq.com, last changed by roundup-bot.

Messages
New changeset edc516fda57b by Maxime Richez in branch '4.2':
Support only version 1 of ldap3
http://hg.tryton.org/modules/ldap_authentication/rev/edc516fda57b
New changeset c999df25bc31 by Maxime Richez in branch 'default':
Update to version 2 of ldap3
http://hg.tryton.org/modules/ldap_authentication/rev/c999df25bc31
review31001002 updated at https://codereview.tryton.org/31001002/#ps70001
review31001002 updated at https://codereview.tryton.org/31001002/#ps50001
msg31244 (view) Author: [hidden] (mrichez) Date: 2017-01-13.09:29:48
>I do not think it is right, I should be: ldap3<2
applied for each patch : ldap3 < 2 for older versions, ldap3 >= 2 for default
review31901002 updated at https://codereview.tryton.org/31901002/#ps20001
New review31901002 at https://codereview.tryton.org/31901002/#ps1
msg31230 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-01-12.15:35:05
On 2017-01-12 14:23, Maxime Richez wrote:
> >I think we should provide a patch for older versions that ensures an older API >version is used for installation.
> Probably but don't know how ? patching setup.py for older versions with ldap3 < 2.0.9?

I do not think it is right, I should be: ldap3<2
msg31228 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2017-01-12.14:53:44
> how doing a patch for older versions?

Let's go for a patch for latest stable version (4.2) and then it will be backported to all supported. 

On the review you have to add the version after the module name. (i.e: trytond4.2: XXXX)
msg31226 (view) Author: [hidden] (mrichez) Date: 2017-01-12.14:34:51
how doing a patch for older versions?
msg31225 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2017-01-12.14:30:24
> Probably but don't know how ? patching setup.py for older versions with ldap3 < 2.0.9?

That's what I was thinking about ;-)
msg31224 (view) Author: [hidden] (mrichez) Date: 2017-01-12.14:23:51
>I think we should provide a patch for older versions that ensures an older API >version is used for installation.
Probably but don't know how ? patching setup.py for older versions with ldap3 < 2.0.9?
msg31223 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2017-01-12.14:14:23
I think we should provide a patch for older versions that ensures an older API version is used for installation.
review31001002 updated at https://codereview.tryton.org/31001002/#ps40001
review31001002 updated at https://codereview.tryton.org/31001002/#ps20001
New review31001002 at https://codereview.tryton.org/31001002/#ps1
msg31201 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-01-11.14:06:22
It seems ldap3 version 2 has changed its API
https://github.com/cannatag/ldap3/blob/master/CHANGES.txt#L36
msg31197 (view) Author: [hidden] (christoph.larsen@synalinq.com) Date: 2017-01-11.13:38:19
Hi Everyone,
Authentication with OpenLDAP crashes. 
Versions used: trytond 4.2.1, OpenLDAP 2.4.44
---------------%<---------------
[session]
authentications = password,ldap

[ldap_authentication]
uri = ldaps://ldap.jail.vlan:636/ou=People,o=Example??subtree?(&(objectclass=inetOrgPerson)(memberOf=cn=trytond_erp_Example,ou=Groups,o=Example))?bindname=cn=LDAPReader,ou=Roles,o=Example
bind_pass = example_password
active_directory = false
uid = uid[
create_user = true
---------------%<---------------
Gives:
---------------%<---------------
Traceback (most recent call last):
  File "/site-packages/trytond/wsgi.py", line 47, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/site-packages/trytond/protocols/dispatcher.py", line 41, in rpc
    request, database_name, *request.rpc_params)
  File "/site-packages/trytond/protocols/dispatcher.py", line 53, in login
    database_name, user, parameters, language=language)
  File "/site-packages/trytond/security.py", line 26, in login
    user_id = User.get_login(loginname, parameters)
  File "/site-packages/trytond/res/user.py", line 506, in get_login
    user_id = func(login, parameters)
  File "/site-packages/trytond/modules/ldap_authentication/res.py", line 188, in _login_ldap
    except ldap3.LDAPException:
AttributeError: 'module' object has no attribute 'LDAPException'
---------------%<---------------
Any idea, what is wrong?

Thanks a lot, Chris
History
Date User Action Args
2017-01-14 20:58:29roundup-botsetmessages: + msg31285
2017-01-14 20:54:39roundup-botsetstatus: chatting -> resolved
nosy: + roundup-bot
messages: + msg31284
2017-01-13 11:18:43reviewbotsetmessages: + msg31246
2017-01-13 09:38:22reviewbotsetmessages: + msg31245
2017-01-13 09:29:49mrichezsetmessages: + msg31244
2017-01-13 09:14:30reviewbotsetmessages: + msg31242
2017-01-12 15:45:40reviewbotsetmessages: + msg31231
2017-01-12 15:45:39reviewbotsetreviews: 31001002 -> 31001002, 31901002
2017-01-12 15:35:06cedsetmessages: + msg31230
2017-01-12 14:53:45pokolisetmessages: + msg31228

Showing 10 items. Show all history (warning: this could be VERY long)