Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
3 Replies
18782 Tampilan

Hello All,

In my Odoo server I'm planning to integrate LDAP authentication, I have already configured the LDAP authentication, but when I login to the Odoo server, it gives this error,

TypeError: not all arguments converted during string formatting

Can anyone help me to resolve this?

Thank You.

Avatar
Buang
Jawaban Terbai

  Hi,

 this issue is due to the new way on how formatting works in Python. You will need to change the ldap filter source to match the new formatting. The source is the last file you seen in the stack trace of the error:

  • /usr/share/pyshared/ldap/filter.py , line 55, in filter_format

 Open the file, the 55th line needs to be changed to:

  return filter_template.format(*map(escape_filter_chars,assertion_values));

This is a temporary hack - next versions of the python-ldap library should solve the problem.

You will also need to change the filter in the LDAP configuration of the company. If, for example, you want to

user the "uid" attribute to lookup the username, the filter should look like:

  •   uid={0}

Fabio "MrWHO" Torchetti

 

Avatar
Buang

The same problem, thank you! that was very helpfull answer, unfortunatly because of karma limit I cant vote it yet

Jawaban Terbai

I am receiving the same problem.  Log follows: 

 

  File "/opt/odoo/openerp/http.py", line 617, in _handle_exception
    return super(HttpRequest, self)._handle_exception(exception)
  File "/opt/odoo/openerp/addons/base/ir/ir_http.py", line 126, in _dispatch
    result = request.dispatch()
  File "/opt/odoo/openerp/http.py", line 635, in dispatch
    r = self._call_function(**self.params)
  File "/opt/odoo/openerp/http.py", line 294, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/openerp/http.py", line 291, in checked_call
    return self.endpoint(*a, **kw)
  File "/opt/odoo/openerp/http.py", line 754, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/openerp/http.py", line 387, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/addons/auth_oauth/controllers/main.py", line 93, in web_login
    response = super(OAuthLogin, self).web_login(*args, **kw)
  File "/opt/odoo/openerp/http.py", line 387, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/addons/auth_signup/controllers/main.py", line 38, in web_login
    response = super(AuthSignupHome, self).web_login(*args, **kw)
  File "/opt/odoo/openerp/http.py", line 387, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/addons/web/controllers/main.py", line 508, in web_login
    uid = request.session.authenticate(request.session.db, request.params['login'], request.params['password'])
  File "/opt/odoo/openerp/http.py", line 903, in authenticate
    uid = dispatch_rpc('common', 'authenticate', [db, login, password, env])
  File "/opt/odoo/openerp/http.py", line 108, in dispatch_rpc
    result = dispatch(method, params)
  File "/opt/odoo/openerp/service/common.py", line 26, in dispatch
    return fn(*params)
  File "/opt/odoo/openerp/service/common.py", line 38, in exp_authenticate
    return res_users.authenticate(db, login, password, user_agent_env)
  File "/opt/odoo/openerp/addons/base/res/res_users.py", line 464, in authenticate
    uid = self._login(db, login, password)
  File "/opt/odoo/addons/auth_ldap/users_ldap.py", line 258, in _login
    entry = ldap_obj.authenticate(conf, login, password)
  File "/opt/odoo/addons/auth_ldap/users_ldap.py", line 99, in authenticate
    filter = filter_format(conf['ldap_filter'], (login,))
  File "/usr/share/pyshared/ldap/filter.py", line 55, in filter_format
    return filter_template % (tuple(map(escape_filter_chars,assertion_values)))
TypeError: not all arguments converted during string formatting

 

Avatar
Buang
Jawaban Terbai

Hello all,

I've got the same problem.

Can anyone help us to resolve this?

Thanks

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
7
Des 19
10710
1
Mar 15
4412
0
Mar 25
1100
0
Jan 25
3155
1
Agu 23
14373