[Zope-dev] Re: [ZODB-Dev] Re: BTrees strangeness (was Zope 2.X BIG Session problems - blocker - our site dies - need help of experience Zope developer, please)

Steve Jibson stevej at parlant.com
Mon May 17 13:06:27 EDT 2004


Chris McDonough wrote:
> On Mon, 2004-05-17 at 12:09, Steve Jibson wrote:
> 
>>:-(
>>
>>I grabbed Transience.py and TemporaryStorage.py from the Zope-2_7-branch 
>>of CVS this morning and dropped them onto one of our customer's systems. 
>>  About 20 minutes later I found the following in the error_log:
>>
>>----------------------------------------
>>Traceback (most recent call last):
>>   File "c:\Zope-2.7\lib\python\ZPublisher\Publish.py", line 100, in 
>>publish request, bind=1)
>>   File "c:\Zope-2.7\lib\python\ZPublisher\mapply.py", line 88, in mapply
>>     if debug is not None: return debug(object,args,context)
>>   File "c:\Zope-2.7\lib\python\ZPublisher\Publish.py", line 40, in 
>>call_object
>>     result=apply(object,args) # Type s<cr> to step into published object.
>>   File "c:\Zope-2.7\lib\python\OFS\DTMLDocument.py", line 128, in __call__
>>     r=apply(HTML.__call__, (self, (client, bself), REQUEST), kw)
>>   File "c:\Zope-2.7\lib\python\DocumentTemplate\DT_String.py", line 
>>474, in __call__
>>     try: result = render_blocks(self._v_blocks, md)
>>   File "c:\Zope-2.7\lib\python\OFS\DTMLDocument.py", line 121, in __call__
>>     r=apply(HTML.__call__, (self, bself, REQUEST), kw)
>>   File "c:\Zope-2.7\lib\python\DocumentTemplate\DT_String.py", line 
>>474, in __call__
>>     try: result = render_blocks(self._v_blocks, md)
>>   File "c:\Zope-2.7\lib\python\OFS\DTMLDocument.py", line 121, in __call__
>>     r=apply(HTML.__call__, (self, bself, REQUEST), kw)
>>   File "c:\Zope-2.7\lib\python\DocumentTemplate\DT_String.py", line 
>>474, in __call__
>>     try: result = render_blocks(self._v_blocks, md)
>>   File "c:\Zope-2.7\lib\python\DocumentTemplate\DT_Util.py", line 201, 
>>in eval
>>     return eval(code, d)
>>   File "<string>", line 1, in <expression>
>>   File "c:\Zope-2.7\lib\python\AccessControl\ZopeGuards.py", line 67, 
>>in guarded_getitem
>>     v = object[index]
>>   File "c:\Zope-2.7\lib\python\Products\Transience\TransientObject.py", 
>>line 170, in __getitem__
>>     return self._container[k]
>>KeyError: 'accountType'
>>----------------------------------------
> 
> 
> This looks to me like an application error, not a Transience error.
> 
> 
>>After getting the error, I changed them over to FileStorage.  I haven't 
>>seen any errors since then.  I will be more than happy to spend some 
>>time doing whatever I can to help track this down and/or test updates.
> 
> 
> It looks like the code assumes 'accountType' is available in the
> session; change it to not make that assumption (perhaps via
> SESSION.get('accountType', 'default')).
> 
> - C
> 

I'm sure 'accountType' should have been in the session.  Immediately 
after a user logs in we populate his session with a bunch of stuff 
(including accountType).  What I don't want to do is hide problems with 
session/tempstorage by using "get" and a default.  In this particular 
case, there is no good default and having the application assume an 
incorrect accountType will cause me all kids of trouble.

Also of note:

1 - After having the system run for 45 minutes, I had 8 similar errors. 
  Some were on different web pages and some had different "keys" that 
were causing the error.
2 - I have also traced through Z2.log and followed the same path through 
the web site that produced one of the errors and I did not get an error.
3 - Since changing this server to use FileStorage (1hr 39min ago), there 
has not been a single error.

Is there anything I can do to help here?




More information about the Zope-Dev mailing list