hi all i have this "key error" with sessions, that really shows itself with zope2.6.0 previously, with 2.5.1, and 2.6.0b1, i got key error only when i tried iterating thru the Trancient Object (temp_folder/session_data) now, with 2.6.0, it seems i get this error even when setting/reading sessions. this, however does not mean that this happens everytime. it's a bit unpredictable. last time, i can still reset the Transient Object. nowi have to reset zope since i cannot get to the temp_folder/session_data/manage_workspace the relevant traceback is attached[1]. the relevant script (python)[2] tb[1] Traceback (innermost last): Module OFS.SimpleItem, line 201, in raise_standardErrorMessage 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 DocumentTemplate.DT_Util, line 201, in eval - __traceback_info__: sc_def_session_val Module <string>, line 2, in f Module Shared.DC.Scripts.Bindings, line 252, in __call__ Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec Module Products.PythonScripts.PythonScript, line 315, in _exec Module Script (Python), line 1, in sc_def_session_val - <PythonScript at /kk/sc_def_session_val used for /kk/kk> - Line 1 Module ZPublisher.HTTPRequest, line 1189, in __getattr__ Module ZPublisher.HTTPRequest, line 1149, in get Module Products.Sessions.SessionDataManager, line 93, in getSessionData Module Products.Sessions.SessionDataManager, line 180, in _getSessionDataObject Module Products.Transience.Transience, line 175, in new_or_existing Module Products.Transience.Transience, line 786, in get Module Products.Transience.Transience, line 599, in _getCurrentBucket Module Products.Transience.Transience, line 688, in _housekeep KeyError: 1035186480 ------ [2] session = context.REQUEST.SESSION r=context.REQUEST s_obj = session.get('username',None) if s_obj is None: session.set('username',_.SecurityGetUser().getUserName()) -- http://www.kedai.com.my/ http://www.kedai.com.my/eZine http://www.zope.org/Members/kedai http://www.my-zope.org If you SMELLLL...
Did you upgrade from a prior Zope version? If so, did you run "python wo_pcgi" to recompile all binary modules? There were BTrees bugs that were fixed with 2.6. (Crosses fingers ;-) On Mon, 2002-10-21 at 21:33, Bakhtiar A Hamid wrote:
hi all i have this "key error" with sessions, that really shows itself with zope2.6.0
previously, with 2.5.1, and 2.6.0b1, i got key error only when i tried iterating thru the Trancient Object (temp_folder/session_data)
now, with 2.6.0, it seems i get this error even when setting/reading sessions. this, however does not mean that this happens everytime. it's a bit unpredictable. last time, i can still reset the Transient Object. nowi have to reset zope since i cannot get to the temp_folder/session_data/manage_workspace
the relevant traceback is attached[1]. the relevant script (python)[2]
tb[1] Traceback (innermost last): Module OFS.SimpleItem, line 201, in raise_standardErrorMessage 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 DocumentTemplate.DT_Util, line 201, in eval - __traceback_info__: sc_def_session_val Module <string>, line 2, in f Module Shared.DC.Scripts.Bindings, line 252, in __call__ Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec Module Products.PythonScripts.PythonScript, line 315, in _exec Module Script (Python), line 1, in sc_def_session_val - <PythonScript at /kk/sc_def_session_val used for /kk/kk> - Line 1 Module ZPublisher.HTTPRequest, line 1189, in __getattr__ Module ZPublisher.HTTPRequest, line 1149, in get Module Products.Sessions.SessionDataManager, line 93, in getSessionData Module Products.Sessions.SessionDataManager, line 180, in _getSessionDataObject Module Products.Transience.Transience, line 175, in new_or_existing Module Products.Transience.Transience, line 786, in get Module Products.Transience.Transience, line 599, in _getCurrentBucket Module Products.Transience.Transience, line 688, in _housekeep KeyError: 1035186480 ------
[2] session = context.REQUEST.SESSION r=context.REQUEST s_obj = session.get('username',None)
if s_obj is None: session.set('username',_.SecurityGetUser().getUserName())
--
http://www.kedai.com.my/ http://www.kedai.com.my/eZine http://www.zope.org/Members/kedai http://www.my-zope.org If you SMELLLL...
_______________________________________________ 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 )
On Tuesday 22 October 2002 10:01, Chris McDonough wrote:
Did you upgrade from a prior Zope version? If so, did you run "python wo_pcgi" to recompile all binary modules? There were BTrees bugs that were fixed with 2.6. (Crosses fingers ;-)
yes, i did upgrade from 2.5.1 -> 2.6.0b1 -> 2.6.0b2 -> 2.6.0 and it's something that i must do (python wo_pcgi) so, yes, i did all that :P man this is a pesky bug -- http://www.kedai.com.my/ http://www.kedai.com.my/eZine http://www.zope.org/Members/kedai http://www.my-zope.org Get the Tables!
Darn. Well.. I'm not sure what to do. I essentially rewrote the sessioning stuff for 2.6 specifically to avoid these kind of errors in earlier sessioning stuff. Can you try this for me on the machine that hosts the Zope instance you're having problems with: cd zopehome/lib/python/Products/Sessions/stresstests export PYTHONPATH=zopehome/lib/python python stresstestMultiThread.py It will print a bunch of numbers to the screen as it tests. But the end result should be something like: Ran 2 tests in 138.481s Please report any errors or failures you see during the test... or lack thereof, of course.. Tks, - C On Mon, 2002-10-21 at 22:44, Bakhtiar A Hamid wrote:
On Tuesday 22 October 2002 10:01, Chris McDonough wrote:
Did you upgrade from a prior Zope version? If so, did you run "python wo_pcgi" to recompile all binary modules? There were BTrees bugs that were fixed with 2.6. (Crosses fingers ;-)
yes, i did upgrade from 2.5.1 -> 2.6.0b1 -> 2.6.0b2 -> 2.6.0 and it's something that i must do (python wo_pcgi)
so, yes, i did all that :P
man this is a pesky bug
--
http://www.kedai.com.my/ http://www.kedai.com.my/eZine http://www.zope.org/Members/kedai http://www.my-zope.org Get the Tables!
On Tuesday 22 October 2002 13:23, Chris McDonough wrote:
Darn. Well.. I'm not sure what to do. I essentially rewrote the sessioning stuff for 2.6 specifically to avoid these kind of errors in earlier sessioning stuff.
Can you try this for me on the machine that hosts the Zope instance you're having problems with:
cd zopehome/lib/python/Products/Sessions/stresstests export PYTHONPATH=zopehome/lib/python python stresstestMultiThread.py
It will print a bunch of numbers to the screen as it tests. But the end result should be something like:
Ran 2 tests in 138.481s
Please report any errors or failures you see during the test... or lack thereof, of course..
here's the printed stuff when i ran the test # /usr/bin/python2.1 stresstestMultiThread.py testNonOverlappingBrowserIds (__main__.TestMultiThread) ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 general conflict 0 general conflict 0 1 1 0 ok testOverlappingBrowserIds (__main__.TestMultiThread) ... general conflict general conflict general conflict general conflict general conflict general conflict general conflict 0 general conflict general conflict 1 1 general conflict 1 1 3 0 2 1 0 0 0 0 0 0 0 0 0 0 0 general conflict 0 0 0 1 0 ok ---------------------------------------------------------------------- Ran 2 tests in 152.582s OK
This appears to be a BTrees bug. I have sent out a message asking for some help with how to isolate the problem to the zope-coders list. In the meantime, do you think you can try something for me? In the interest of tracking the bug down, can you bump up your ZODB cache size in the database control panel to about 4X whatever it is now? Then see if it takes about 4X as long to between KeyErrors? Thanks, - C ----- Original Message ----- From: "Bakhtiar A Hamid" <kedai@kedai.com.my> To: "Chris McDonough" <chrism@zope.com> Cc: <zope@zope.org> Sent: Tuesday, October 22, 2002 1:27 AM Subject: Re: [Zope] sessions and zope2.6.0 On Tuesday 22 October 2002 13:23, Chris McDonough wrote:
Darn. Well.. I'm not sure what to do. I essentially rewrote the sessioning stuff for 2.6 specifically to avoid these kind of errors in earlier sessioning stuff.
Can you try this for me on the machine that hosts the Zope instance you're having problems with:
cd zopehome/lib/python/Products/Sessions/stresstests export PYTHONPATH=zopehome/lib/python python stresstestMultiThread.py
It will print a bunch of numbers to the screen as it tests. But the end result should be something like:
Ran 2 tests in 138.481s
Please report any errors or failures you see during the test... or lack thereof, of course..
here's the printed stuff when i ran the test # /usr/bin/python2.1 stresstestMultiThread.py testNonOverlappingBrowserIds (__main__.TestMultiThread) ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 general conflict 0 general conflict 0 1 1 0 ok testOverlappingBrowserIds (__main__.TestMultiThread) ... general conflict general conflict general conflict general conflict general conflict general conflict general conflict 0 general conflict general conflict 1 1 general conflict 1 1 3 0 2 1 0 0 0 0 0 0 0 0 0 0 0 general conflict 0 0 0 1 0 ok -------------------------------------------------------------------- -- Ran 2 tests in 152.582s OK
Also, in your copy of Zope 2.6, please do the following to make sure all extension modules were rebuilt properly: python setup.py build_ext -if - C ----- Original Message ----- From: "Chris McDonough" <chrism@zope.com> To: <kedai@kedai.com.my> Cc: <zope@zope.org> Sent: Tuesday, October 22, 2002 10:26 AM Subject: Re: [Zope] sessions and zope2.6.0
This appears to be a BTrees bug. I have sent out a message asking for some help with how to isolate the problem to the zope-coders list. In the meantime, do you think you can try something for me? In the interest of tracking the bug down, can you bump up your ZODB cache size in the database control panel to about 4X whatever it is now? Then see if it takes about 4X as long to between KeyErrors?
Thanks,
- C
----- Original Message ----- From: "Bakhtiar A Hamid" <kedai@kedai.com.my> To: "Chris McDonough" <chrism@zope.com> Cc: <zope@zope.org> Sent: Tuesday, October 22, 2002 1:27 AM Subject: Re: [Zope] sessions and zope2.6.0
On Tuesday 22 October 2002 13:23, Chris McDonough wrote:
Darn. Well.. I'm not sure what to do. I essentially rewrote the sessioning stuff for 2.6 specifically to avoid these kind of errors in earlier sessioning stuff.
Can you try this for me on the machine that hosts the Zope instance you're having problems with:
cd zopehome/lib/python/Products/Sessions/stresstests export PYTHONPATH=zopehome/lib/python python stresstestMultiThread.py
It will print a bunch of numbers to the screen as it tests. But the end result should be something like:
Ran 2 tests in 138.481s
Please report any errors or failures you see during the test... or lack thereof, of course..
here's the printed stuff when i ran the test
# /usr/bin/python2.1 stresstestMultiThread.py testNonOverlappingBrowserIds (__main__.TestMultiThread) ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 general conflict 0 general conflict 0 1 1 0 ok testOverlappingBrowserIds (__main__.TestMultiThread) ... general conflict general conflict general conflict general conflict general conflict general conflict general conflict 0 general conflict general conflict 1 1 general conflict 1 1 3 0 2 1 0 0 0 0 0 0 0 0 0 0 0 general conflict 0 0 0 1 0 ok
------------------------------------------------------------------ -- -- Ran 2 tests in 152.582s
OK
_______________________________________________ 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 )
Bakhtiar, After doing the other things I've mentioned, would you also please try applying the following diff to the Products.Transience.Transience.py module: Index: Transience.py =================================================================== RCS file: /cvs-repository/Zope/lib/python/Products/Transience/Transience.py,v retrieving revision 1.28 diff -r1.28 Transience.py 681c681 < for k in data.keys(None, delete_end): ---
for k in list(data.keys(None, delete_end)):
See if your error disappears... Thanks! - C On Tue, 2002-10-22 at 10:26, Chris McDonough wrote:
This appears to be a BTrees bug. I have sent out a message asking for some help with how to isolate the problem to the zope-coders list. In the meantime, do you think you can try something for me? In the interest of tracking the bug down, can you bump up your ZODB cache size in the database control panel to about 4X whatever it is now? Then see if it takes about 4X as long to between KeyErrors?
Thanks,
- C
----- Original Message ----- From: "Bakhtiar A Hamid" <kedai@kedai.com.my> To: "Chris McDonough" <chrism@zope.com> Cc: <zope@zope.org> Sent: Tuesday, October 22, 2002 1:27 AM Subject: Re: [Zope] sessions and zope2.6.0
On Tuesday 22 October 2002 13:23, Chris McDonough wrote:
Darn. Well.. I'm not sure what to do. I essentially rewrote the sessioning stuff for 2.6 specifically to avoid these kind of errors in earlier sessioning stuff.
Can you try this for me on the machine that hosts the Zope instance you're having problems with:
cd zopehome/lib/python/Products/Sessions/stresstests export PYTHONPATH=zopehome/lib/python python stresstestMultiThread.py
It will print a bunch of numbers to the screen as it tests. But the end result should be something like:
Ran 2 tests in 138.481s
Please report any errors or failures you see during the test... or lack thereof, of course..
here's the printed stuff when i ran the test
# /usr/bin/python2.1 stresstestMultiThread.py testNonOverlappingBrowserIds (__main__.TestMultiThread) ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 general conflict 0 general conflict 0 1 1 0 ok testOverlappingBrowserIds (__main__.TestMultiThread) ... general conflict general conflict general conflict general conflict general conflict general conflict general conflict 0 general conflict general conflict 1 1 general conflict 1 1 3 0 2 1 0 0 0 0 0 0 0 0 0 0 0 general conflict 0 0 0 1 0 ok
-------------------------------------------------------------------- -- Ran 2 tests in 152.582s
OK
_______________________________________________ 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 )
On Wednesday 23 October 2002 00:03, Chris McDonough wrote:
Bakhtiar,
After doing the other things I've mentioned, would you also please try applying the following diff to the Products.Transience.Transience.py module:
Index: Transience.py =================================================================== RCS file: /cvs-repository/Zope/lib/python/Products/Transience/Transience.py,v retrieving revision 1.28 diff -r1.28 Transience.py 681c681 < for k in data.keys(None, delete_end): ---
for k in list(data.keys(None, delete_end)):
See if your error disappears...
Thanks!
- C
no, no.. thank *you* :) i've done the necessary, and restarted zope. we'll see how it goes
On Wed, 2002-10-23 at 00:36, Bakhtiar A Hamid wrote:
update: after doing all these, i now get the behaviour that zope2.5.1 gave; i.e i still get the key error, but now that key error does not steal my zmi from me.
i can now go into temp_folder/session-data and reset the bugger :P
back to square one?
Just to be sure (to be pedantic ;-) temp_folder is a TemporaryFolder, right? I just want to make sure you're not storing these things persistently in a FileStorage or some other persistent storage. "Old" BTree instances will have been effected by the bug which means in order to start at a sane place, you'd need to clear them out by resetting the session_data object via the ZMI, but if they are in a temporary storage, they go away after a restart anyway. If you have the time and you want to debug this further, please make sure you're setting EVENT_LOG_FILE (or STUPID_LOG_FILE) to a file on a partition with lot of space and set two additional environment variables in the shell which you use to start Zope (or on the z2.py command line): EVENT_LOG_SEVERITY=-100 Z_TOC_DEBUG=1 ... then start the site. When the site runs, an utterly insane amount of data will be sent to the event log file. When you notice an occurence of the error again, please send me the last 2000 lines or so of the file via email. Thanks! - C
participants (2)
-
Bakhtiar A Hamid -
Chris McDonough