Problem with zsession_del_notify python script, event log transienceDestruct failed msg
Hi, Zope Version Zope 2.5.1 Python Version 2.1.3 System Platform freebsd4 CMF Version 1.3 I have a python script that is setup in ZSESSION_DEL_NOTIFY to save some info out of the session objects from visitors to a cmf site. I have seen the "PROBLEM" event listed in the event log (shown below) on a regular basis. Line 8 of the SessionCleanUp script does the following... sess_cnt = sdo.get('sess_cnt', {}) sdo being the session object passed to the script via the parameter list. This means the data I want isn't saved, correct? From LowConflictConnection.py how would the session object being passed be None (or the objects attr _storage?)? And how do I track it to find the problem? Thanks for any pointers. Richard ##### Event log msg appearing regularly ##### ... 2003-07-10T01:50:29 PROBLEM(100) Transience notifyDestruct failed when calling /GENERIC/sessionCleanUp in /temp_folder/session_data Traceback (innermost last): File /usr/local/zope/2.5.1/lib/python/Products/Transience/Transience.py, line 283, in _notify (Object: session_data) File /usr/local/zope/2.5.1/lib/python/Shared/DC/Scripts/Bindings.py, line 252, in __call__ (Object: sessionCleanUp) File /usr/local/zope/2.5.1/lib/python/Shared/DC/Scripts/Bindings.py, line 283, in _bindAndExec (Object: sessionCleanUp) File /usr/local/zope/2.5.1/lib/python/Products/PythonScripts/PythonScript.py, line 302, in _exec (Object: sessionCleanUp) File Script (Python), line 8, in sessionCleanUp File /usr/local/zope/2.5.1/lib/python/Products/TemporaryFolder/LowConflictConnect ion.py, line 34, in setstate AttributeError: 'None' object has no attribute 'load' ''' ##### --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.493 / Virus Database: 292 - Release Date: 25/06/03
Richard Ettema wrote at 2003-7-10 12:29 +0100:
... This means the data I want isn't saved, correct?
Correct.
From LowConflictConnection.py how would the session object being passed be None (or the objects attr _storage?)? And how do I track it to find the problem? ... (Object: sessionCleanUp) File Script (Python), line 8, in sessionCleanUp File /usr/local/zope/2.5.1/lib/python/Products/TemporaryFolder/LowConflictConnect ion.py, line 34, in setstate AttributeError: 'None' object has no attribute 'load'
It's not the session object which is None. It's the "self._storage", the storage associated with the connection. This means, the connection is currently closed. I cannot tell you how this can happen. I expect you do not use your own threads and you do not put persistent objects in global caches. These are known causes for accessing closed connections. Dieter
Thanks for the reply Dieter. Have included a bit more information about how I am accessing the session data and a bit more of the event log below.
From LowConflictConnection.py how would the session object being passed be None (or the objects attr _storage?)? And how do I track it to find the problem? ... (Object: sessionCleanUp) File Script (Python), line 8, in sessionCleanUp File
/usr/local/zope/2.5.1/lib/python/Products/TemporaryFolder/LowConfl ictConnect
ion.py, line 34, in setstate AttributeError: 'None' object has no attribute 'load'
It's not the session object which is None. It's the "self._storage", the storage associated with the connection. This means, the connection is currently closed.
I cannot tell you how this can happen.
I expect you do not use your own threads and you do not put persistent objects in global caches. These are known causes for accessing closed connections.
I am using the standard Session Data Manager that comes with zope 2.5.1 and storing information such as counts for pages visited. This is done by a python script with: ... session = context.session_data_manager.getSessionData() sess = session.get('sess', {}) #info stored in a dict #create count entry in dict if not present if not sess.has_key( 'count' ): sess['count'] = [ page_id ] # a list of page ids #if count entry exists, just append page id if not already added elif session['count'].count( page_id ) == 0: sess['count'].append( page_id ) #save everything back into the session session.set('sess', sess) ... This session information is then pulled out and stored into mysql by a python script as the sessions expire. The event log also has regular entries for Conflict Errors and BeforeTraverse Errors, is there some connection between these 3 regular event messages that makes sense to someone else in what I should be looking at as the cause? Event log entry... ------ 2003-07-10T18:13:06 INFO(0) ZODB conflict error at /VirtualHostBase/http/192.168.43.10:80/classifieds/classified_list ------ 2003-07-10T18:16:55 INFO(0) ZODB conflict error at /VirtualHostBase/http/192.168.43.10:80/Members/test/10507898/vi ------ 2003-07-10T18:17:15 INFO(0) ZODB conflict error at /VirtualHostBase/http/192.168.43.10:80/Members/test/10507898/vi ------ 2003-07-10T18:17:15 INFO(0) ZODB conflict error at /VirtualHostBase/http/192.168.43.10:80/classifieds/clothing_list ------ 2003-07-10T18:18:25 PROBLEM(100) Transience notifyDestruct failed when calling /GENERIC/sessionCleanUp in /temp_folder/s Traceback (innermost last): File /usr/local/zope/2.5.1/lib/python/Products/Transience/Transience.py, line 283, in _notify (Object: session_data) File /usr/local/zope/2.5.1/lib/python/Shared/DC/Scripts/Bindings.py, line 252, in __call__ (Object: sessionCleanUp) File /usr/local/zope/2.5.1/lib/python/Shared/DC/Scripts/Bindings.py, line 283, in _bindAndExec (Object: sessionCleanUp) File /usr/local/zope/2.5.1/lib/python/Products/PythonScripts/PythonScript.py, line 302, in _exec (Object: sessionCleanUp) File Script (Python), line 8, in sessionCleanUp File /usr/local/zope/2.5.1/lib/python/Products/TemporaryFolder/LowConflictConnect ion.py, line 34, in setstate AttributeError: 'None' object has no attribute 'load' ------ 2003-07-10T18:18:33 INFO(0) ZODB conflict error at /VirtualHostBase/http/192.168.43.10:80/Members/bob/1043102 ------ 2003-07-10T19:10:49 ERROR(200) BeforeTraverse Error while invoking hook: "cookie_authentication" Traceback (innermost last): File /usr/local/zope/2.5.1/lib/python/ZPublisher/BeforeTraverse.py, line 133, in __call__ TypeError: __call__() takes exactly 3 arguments (4 given) ------ 2003-07-10T19:10:49 ERROR(200) BeforeTraverse Error while invoking hook: "cookie_authentication" Traceback (innermost last): File /usr/local/zope/2.5.1/lib/python/ZPublisher/BeforeTraverse.py, line 133, in __call__ TypeError: __call__() takes exactly 3 arguments (4 given) ...
Dieter
Thanks for your help. Richard. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.493 / Virus Database: 292 - Release Date: 25/06/03
Richard Ettema wrote at 2003-7-11 13:19 +0100:
... Have included a bit more information about how I am accessing the session data and a bit more of the event log below.
There is nothing extraordinary in your session use. Anyway, whatever you do in plain Zope with sessions should not cause a session to be deleted without a valid ZODB connection... The conflict errors are likely caused by session conflicts. The implementation is quite prone to conflicts. The "beforeTraverse" exceptions indicate an incompatibility between your Zope version and your CookieCrumber version. I would consider upgrading to Zope 2.6.2. There are lots of improvements in session handling (though it is still not perfect). The "beforeTraverse" problem hopefully will disappear, too. Dieter
participants (2)
-
Dieter Maurer -
Richard Ettema