conestack / node

Other
24 stars 24 forks source link

AttributeError: '_thread._local' object has no attribute 'suppress_events' #18

Closed 1letter closed 2 years ago

1letter commented 2 years ago

I use pas.plugin.ldap in Plone 6 with the following checkouts:

yafowil = git https://github.com/conestack/yafowil.git branch=master
yafowil.plone = git git@github.com:bluedynamics/yafowil.plone.git branch=bootstrap-plone6
yafowil.bootstrap = git git@github.com:conestack/yafowil.bootstrap.git branch=2.0
webresource = git https://github.com/conestack/webresource.git branch=master

node.ext.ldap = git https://github.com/conestack/node.ext.ldap.git
node = git https://github.com/conestack/node.git

in the last weeks the testsysite is under heavy development, i run the buildout several times a day. i don't have any problems with the ldap stack.

Since today, after buildout, i get an error if the system try to connect the LDAP server.

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 167, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 376, in publish_module
  Module ZPublisher.WSGIPublisher, line 271, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module Products.PDBDebugMode.wsgi_runcall, line 60, in pdb_runcall
  Module pas.plugins.ldap.plonecontrolpanel.inspector, line 53, in node_attributes
  Module node.behaviors.attributes, line 64, in attrs
  Module plumber.instructions, line 453, in entrance
  Module node.ext.ldap._node, line 58, in __init__
  Module node.ext.ldap._node, line 100, in load
  Module plumber.instructions, line 453, in entrance
  Module plumber.instructions, line 462, in plumbing
  Module node.ext.ldap._node, line 124, in __setitem__
  Module plumber.instructions, line 453, in entrance
  Module node.behaviors.lifecycle, line 89, in __setitem__
AttributeError: '_thread._local' object has no attribute 'suppress_events'
rnixx commented 2 years ago

have you updated node to latest master?

rnixx commented 2 years ago

https://github.com/conestack/node/blob/master/src/node/behaviors/lifecycle.py#L19

1letter commented 2 years ago

Yes, in the buildout there is the checkout of the master

node = git https://github.com/conestack/node.git

With an older version of node.ext.ldap and the default node package all is fine.

node.ext.ldap = git https://github.com/conestack/node.ext.ldap.git rev=e09af9fdc1940aa6be72203840fb5b1b5a848328
# node = git https://github.com/conestack/node.git rev=b418904c4e6a1164425da505735ce84f80c5ea6e
1letter commented 2 years ago

Perhaps:

Threads share memory, state, and resources. However, the properties of the local class object of the thread module are only visible in the current thread.

vs Waitress and the default Option 4 Threads?

rnixx commented 2 years ago

have you also updated node.ext.ldap? i doubt that related node.ext.ldap operation runs in another thread. But i might have imlemented the threadlocal stuff the wrong way. please use node and node.ext.ldap pinned to the revisions before the change in lifecycle events. i cannot fix this immediately

1letter commented 2 years ago

like i wrote, node.ext.ldap is the master checkout and node is the master checkout.

when i use:

and

all is fine

rnixx commented 2 years ago

Hi, can you try again with latest node and node.ext.ldap master please?

1letter commented 2 years ago

Ok, i have tested local and on a staging server, looks good. no errors. Thanks!