collective / pas.plugins.ldap

Zope (and Plone) PAS Plugin providing users and groups from LDAP directory
http://pypi.python.org/pypi/pas.plugins.ldap
Other
13 stars 19 forks source link

AttributeError: 'LDAPConnector' object has no attribute '_con' #115

Open lucaspottersky opened 1 year ago

lucaspottersky commented 1 year ago

I'm trying to integrate pas.plugins.ldap with a Plone local environment, but it is throwing an exception when I open the control panel (http://plone.localhost:8080/Plone/plone_ldapcontrolpanel).

#docker-compose.yml

version: "3"
services:

  webserver:
    image: nginx
    volumes:
      - ./default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - backend
      - frontend
    ports:
    - "80:80"

  frontend:
    image: plone/plone-frontend:16.0.0-alpha.42
    environment:
      RAZZLE_INTERNAL_API_PATH: http://backend:8080/Plone
    ports:
    - "3000:3000"
    depends_on:
      - backend

  backend:
    image: plone/plone-backend:6.0.0b3
    environment:
      SITE: Plone
      ADDONS: pas.plugins.ldap==1.8.1
    ports:
    - "8080:8080"
2022-10-10 16:17:31 ERROR [pas.plugins.ldap:217][waitress-0] Non-LDAP error while connection test!
Traceback (most recent call last):
  File "/app/lib/python3.9/site-packages/pas/plugins/ldap/properties.py", line 211, in connection_test
    ugm.users
  File "/app/lib/python3.9/site-packages/node/ext/ldap/ugm/_api.py", line 1113, in users
    return self['users']
  File "/app/lib/python3.9/site-packages/node/locking.py", line 30, in _locktree_decorator
    result = fn(self, *args, **kwargs)
  File "/app/lib/python3.9/site-packages/node/ext/ldap/ugm/_api.py", line 1081, in __getitem__
    self['users'] = Users(self.props, self.ucfg)
  File "/app/lib/python3.9/site-packages/node/ext/ldap/ugm/_api.py", line 472, in __init__
    context = LDAPNode(name=cfg.baseDN, props=props)
  File "/app/lib/python3.9/site-packages/plumber/instructions.py", line 453, in entrance
    return plumbing_method(next_, self, *args, **kw)
  File "/app/lib/python3.9/site-packages/node/behaviors/lifecycle.py", line 48, in __init__
    next_(self, *args, **kw)
  File "/app/lib/python3.9/site-packages/node/ext/ldap/_node.py", line 199, in __init__
    self._ldap_session = LDAPSession(props)
  File "/app/lib/python3.9/site-packages/node/ext/ldap/session.py", line 15, in __init__
    connector = LDAPConnector(props=props)
  File "/app/lib/python3.9/site-packages/node/ext/ldap/base.py", line 108, in __init__
    self._conn_timeout = props.conn_timeout
AttributeError: 'LDAPProps' object has no attribute 'conn_timeout'
Exception ignored in: <function LDAPConnector.__del__ at 0x7f7d23f8e820>
Traceback (most recent call last):
  File "/app/lib/python3.9/site-packages/node/ext/ldap/base.py", line 155, in __del__
    self.unbind()
  File "/app/lib/python3.9/site-packages/node/ext/ldap/base.py", line 146, in unbind
    if self._con is None:
AttributeError: 'LDAPConnector' object has no attribute '_con'
mamico commented 1 year ago

@lucaspottersky Try to pin node and node.ext.ldap to previous version, ie

ADDONS: pas.plugins.ldap==1.8.1 node==1.0 node.ext.ldap==1.0

jensens commented 1 year ago

Indeed. We need to follow up with changes in node.ext.ldap. Pull requests are welcome. At the moment I have no time to fix this myself.