RuntimeError: Shouldn't load state for '\x00\x00\x00\x00\x00\x006\xd1' when the connection is closed
Hi, I have to face a recent problem : when I restart my Zope server, I can see pages several times but after a few requests, I receive the message written in this message's subject. Of course, I'm writing my own Zope products, but never close database connection manually. Loading the given object from a little Python script (Zope.app()._p_jar['...']) gives me an "<extension class BTrees.Length.Length at 553020>". Where could this problem come from ??? I didn't make any big update on my Zope site/products before this problem occurs... Thanks for any help, Thierry -- Linux every day, keeps Dr Watson away... http://gpc.sourceforge.net -- http://www.ulthar.net
On Tuesday 28 January 2003 3:02 pm, Thierry Florac wrote:
Of course, I'm writing my own Zope products, but never close database connection manually.
Zope closes connections at the end of a transaction. Most likely you are accessing an object after the end of the transaction. The most common cause is from a persistent object that is part of an exception, because Zope sometimes renders a traceback after transaction end.
Where could this problem come from ???
You can probably work it out from the full traceback. -- Toby Dickenson http://www.geminidataloggers.com/people/tdickenson
Thierry Florac wrote at 2003-1-28 16:02 +0100:
I have to face a recent problem : when I restart my Zope server, I can see pages several times but after a few requests, I receive the message written in this message's subject. Did you get a traceback?
Post it! Dieter
On Tue, 2003-01-28 at 20:30, Dieter Maurer wrote:
Thierry Florac wrote at 2003-1-28 16:02 +0100:
I have to face a recent problem : when I restart my Zope server, I can see pages several times but after a few requests, I receive the message written in this message's subject. Did you get a traceback?
Post it!
This is it !! Exception traceback Time 2003/01/28 16:08:37.662 GMT+1 User Name (User Id) tflorac (tflorac) Request URL http://intra-dev.onf.fr/index_html Exception Type RuntimeError Exception Value Shouldn't load state for '\x00\x00\x00\x00\x00\x006\xd1' when the connection is closed Traceback (innermost last): * Module ZPublisher.Publish, line 98, in publish * Module ZPublisher.mapply, line 88, in mapply * Module ZPublisher.Publish, line 39, in call_object * Module OFS.DTMLMethod, line 126, in __call__ * Module DocumentTemplate.DT_String, line 474, in __call__ * Module OFS.DTMLMethod, line 119, in __call__ * Module DocumentTemplate.DT_String, line 474, in __call__ * Module OFS.DTMLMethod, line 119, in __call__ * Module DocumentTemplate.DT_String, line 474, in __call__ * Module OFS.DTMLMethod, line 119, in __call__ * Module DocumentTemplate.DT_String, line 474, in __call__ * Module DocumentTemplate.DT_Let, line 75, in render * Module DocumentTemplate.DT_Util, line 201, in eval __traceback_info__: REQUEST * Module <string>, line 2, in f * Module AccessControl.DTML, line 32, in guarded_getitem * Module AccessControl.ZopeGuards, line 94, in guarded_getitem * Module Products.LDAPUserFolder.LDAPUser, line 117, in allowed * Module Products.LDAPUserFolder.LDAPUser, line 138, in _getSatellite * Module Products.BTreeFolder2.BTreeFolder2, line 241, in objectCount * Module BTrees.Length, line 43, in __call__ * Module ZODB.Connection, line 504, in setstate RuntimeError: Shouldn't load state for '\x00\x00\x00\x00\x00\x006\xd1' when the connection is closed For your information, I'll say that : - there's no anonymous access allowed to my Zope site ; - this problem seems to be solved, even if I don't understand why : the only think that I modified is a little python script, called by my standard_html_header, which have to check for a few complex access rights and then update user's session (handled by the ZSession product)... This python script doesn't return anything, and just raise an exception if access conditions are not OK. Thanks anyway for any information about this point... Thierry P.S.: one more thing : my Python script stores into ZSession a custom persistent object (a custom "user" object used to store user's preferences). Could this explain anything, as Toby Dickenson suggested in his last reply ??
Thierry Florac wrote at 2003-1-29 08:50 +0100:
.... strange problem named in subject .... * Module Products.LDAPUserFolder.LDAPUser, line 138, in _getSatellite * Module Products.BTreeFolder2.BTreeFolder2, line 241, in objectCount * Module BTrees.Length, line 43, in __call__ * Module ZODB.Connection, line 504, in setstate
RuntimeError: Shouldn't load state for '\x00\x00\x00\x00\x00\x006\xd1' when the connection is closed Looks like a bug in LDAPUserFolder (report this to Jens!):
Apparently, LDAPUserFolder puts persistent objects into global RAM (probably to implement a cache). This is a recipe for desaster. Persistent objects contain an implicit reference to the ZODB connection. When the global data is accessed later by a different thread (with a different connection), the old connection reference is wrong. In your case, it seems to be closed. Dieter
the global cache itself is per-thread (it is a _v_ attribute). jens On Wednesday, Jan 29, 2003, at 14:54 US/Eastern, Dieter Maurer wrote:
Thierry Florac wrote at 2003-1-29 08:50 +0100:
.... strange problem named in subject .... * Module Products.LDAPUserFolder.LDAPUser, line 138, in _getSatellite * Module Products.BTreeFolder2.BTreeFolder2, line 241, in objectCount * Module BTrees.Length, line 43, in __call__ * Module ZODB.Connection, line 504, in setstate
RuntimeError: Shouldn't load state for '\x00\x00\x00\x00\x00\x006\xd1' when the connection is closed Looks like a bug in LDAPUserFolder (report this to Jens!):
Apparently, LDAPUserFolder puts persistent objects into global RAM (probably to implement a cache).
This is a recipe for desaster. Persistent objects contain an implicit reference to the ZODB connection.
When the global data is accessed later by a different thread (with a different connection), the old connection reference is wrong. In your case, it seems to be closed.
Dieter
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Jens Vagelpohl wrote at 2003-1-29 17:54 -0500:
the global cache itself is per-thread (it is a _v_ attribute). Nevertheless, "_getSatellite" appears to access a persistent object with a connection reference which has been closed...
Thierry Florac wrote at 2003-1-29 08:50 +0100:
.... strange problem named in subject .... * Module Products.LDAPUserFolder.LDAPUser, line 138, in _getSatellite * Module Products.BTreeFolder2.BTreeFolder2, line 241, in objectCount * Module BTrees.Length, line 43, in __call__ * Module ZODB.Connection, line 504, in setstate
RuntimeError: Shouldn't load state for '\x00\x00\x00\x00\x00\x006\xd1' when the connection is closed
Dieter
participants (4)
-
Dieter Maurer -
Jens Vagelpohl -
Thierry Florac -
Toby Dickenson