<HTML><BODY>
<DIV>Hi:</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;Thanks for the rapid aswer of Chris McDonough. I will change the 
steps to replicate the error (sorry for the large steps before :( , I thinks 
that maybe was needful). Remember that the key of the error is the time 
interval between the request. If with 5 seconds don't appear the 
error&nbsp;try to vary to other, like 7 seconds. The 5 first steps are to 
create the situation and the&nbsp;<SPAN>sixth</SPAN> step are to provoke the 
error</DIV>
<DIV>&nbsp;</DIV>
<DIV>Step 1: Create a folder called "reproducingError" in Zope Interface<BR>
Manage</DIV>
<DIV>&nbsp;</DIV>
<DIV>Step 2: Create a srcipt "end" with the content:</DIV>
<DIV>"</DIV>
<DIV># end script<BR>idService = context.REQUEST.SESSION['idService']</DIV>
<DIV>return "Fin - " + idService<BR>"</DIV>
<DIV>&nbsp;</DIV>
<DIV>Step 3: Create a script "index_html" with the content:</DIV>
<DIV>"</DIV>
<DIV># init script<BR>sessionData = container.REQUEST.SESSION<BR>
sessionData.set("userId", "userExample")<BR>return context.init2()</DIV>
<DIV>"</DIV>
<DIV>&nbsp;</DIV>
<DIV>Step 4: Create a script "init2" with the content:</DIV>
<DIV>"</DIV>
<DIV># init2 script<BR>request = context.REQUEST<BR>sessionData = 
request.SESSION<BR>sessionData.set('idService', 'testService')<BR>return 
context.external(context)</DIV>
<DIV>"</DIV>
<DIV>&nbsp;</DIV>
<DIV>Step 5:create an external method called "external" in the 
"reproducingError" folder with the following content, in where the<BR>
function of the external method is "communicationResponse" and the module is 
any name that you give to the file:</DIV>
<DIV>"</DIV>
<DIV># external method<BR>import time</DIV>
<DIV>def communicationResponse(context):</DIV>
<DIV>&nbsp;&nbsp;&nbsp; response = context.REQUEST.RESPONSE<BR>
&nbsp;&nbsp;&nbsp; sessionData = context.REQUEST.SESSION<BR>
&nbsp;&nbsp;&nbsp; strDetailEnd = 
"&lt;script&gt;window.location='reproducingError/end'&lt;/script&gt;"<BR>
&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; for item in range(1, 40):<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; time.sleep(3)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; response.write("Response 
iteration:" + str(item))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
response.flush()</DIV>
<DIV>&nbsp;&nbsp;&nbsp; response.write(strDetailEnd)<BR>&nbsp;&nbsp;&nbsp; 
response.flush()</DIV>
<DIV>"</DIV>
<DIV>&nbsp;</DIV>
<DIV>Step 6: open&nbsp;two explorer</DIV>
<DIV>In one of them call the object "reproducingError" (Example: 
localhost:8080/reproducingError), then wait 5 second and put in the other 
the same direction.</DIV>
<DIV>And wait the iterations....</DIV>
<DIV>&nbsp;</DIV>
<DIV>Note: I count 5 second, not with <SPAN>chronometer</SPAN>. You can try 
with a <SPAN>near number.</SPAN></DIV>
<DIV><SPAN></SPAN>&nbsp;</DIV>
<DIV>Chris: I reproduce the error with the steps. I can't reduce it to an 
external method. Thanks again.</DIV>
<DIV>&nbsp;</DIV>
<DIV>The error that I obtain is the same:</DIV>
<DIV>"</DIV>
<DIV>Traceback (innermost last):<BR>&nbsp; Module ZPublisher.Publish, line 
101, in publish<BR>&nbsp; Module ZPublisher.mapply, line 88, in mapply<BR>
&nbsp; Module ZPublisher.Publish, line 39, in call_object<BR>&nbsp; Module 
Shared.DC.Scripts.Bindings, line 306, in __call__<BR>&nbsp; Module 
Shared.DC.Scripts.Bindings, line 343, in _bindAndExec<BR>&nbsp; Module 
Products.PythonScripts.PythonScript, line 323, in _exec<BR>&nbsp; Module 
None, line 2, in end<BR>&nbsp;&nbsp; - &lt;PythonScript at 
/approach/reproducingError/end&gt;<BR>&nbsp;&nbsp; - Line 2<BR>&nbsp; Module 
AccessControl.ZopeGuards, line 67, in guarded_getitem<BR>&nbsp; Module 
Products.Transience.TransientObject, line 176, in __getitem__<BR>KeyError: 
'idService'<BR></DIV>
<DIV>"</DIV>
<DIV>Remember:</DIV>
<DIV>&gt; &gt; A curious thing is that when I obtain the error, if I wait 
around 15<BR>&gt; &gt; second and refresh the page in wich i obtain the 
error, the correct<BR>&gt; &gt; result appear.. and no errors come.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&gt; &gt; I'm using Zope 2.7.6 for Windows.<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>I must solve this, because this is part of my thesis for university 
graduation. Any help will be appreciated.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks in advance, </DIV>
<DIV>Leticia Larrosa</DIV>
<DIV><BR><BR>-----Original Message-----<BR>From: Chris McDonough 
&lt;chrism@plope.com&gt;<BR>To: Leticia Larrosa 
&lt;LETICIA@tesla.cujae.edu.cu&gt;<BR>Cc: zope@zope.org<BR>Date: Mon, 20 Jun 
2005 15:12:21 -0400<BR>Subject: Re: [Zope] accessing session data error<BR>
<BR>&gt; Hi Leticia,<BR>&gt; <BR>&gt; Thanks for the detailed bug report.<BR>
&gt; <BR>&gt; I have tried to replicate the bug as you indicate below but 
cannot.<BR>&gt; I've gone through the process you describe ten times without 
errors (in<BR>&gt; Zope 2.7.6).<BR>&gt; <BR>&gt; If it's possible to 
simplify the steps to recreate the error, that<BR>&gt; would<BR>&gt; be 
helpful in further debugging (for example, maybe just getting rid of<BR>&gt; 
all the page templates and python scripts and just using a single<BR>&gt; 
external method).<BR>&gt; <BR>&gt; - C<BR>&gt; <BR>&gt; <BR>&gt; On Mon, 
2005-06-20 at 14:20 -0400, Leticia Larrosa wrote:<BR>&gt; &gt; Hi all:<BR>
&gt; &gt; &nbsp;<BR>&gt; &gt; I think that I found a ZOPE bug. Is really 
very important for me know<BR>&gt; &gt; what can I do for avoid it. The 
first 9 steps are to recreate the<BR>&gt; &gt; situation and the other steps 
are to provoke the error.<BR>&gt; &gt; &nbsp;<BR>&gt; &gt; Step 1: Crate a 
folder called "reproducingError" in Zope Interface<BR>&gt; &gt; Manage<BR>
&gt; &gt; &nbsp;<BR>&gt; &gt; Step 2: create a page template called 
"index_html" in the<BR>&gt; &gt; "reproducingError" folder with the 
following content:<BR>&gt; &gt; "<BR>&gt; &gt; &lt;!-- index_html page 
template --&gt;<BR>&gt; &gt; &lt;form name="form1" method="post" 
action="reproducingError/init"&gt;<BR>&gt; &gt; &nbsp; &lt;input type="text" 
name="user"&gt;<BR>&gt; &gt; &nbsp; &lt;input type="submit" name="Submit" 
value="Submit"&gt;<BR>&gt; &gt; &lt;/form&gt;<BR>&gt; &gt; "<BR>&gt; &gt; 
&nbsp;<BR>&gt; &gt; Step 3: create a python script called "init" in the<BR>
&gt; "reproducingError"<BR>&gt; &gt; folder with the following content:<BR>
&gt; &gt; "<BR>&gt; &gt; # init script<BR>&gt; &gt; sessionData = 
container.REQUEST.SESSION<BR>&gt; &gt; sessionData.set("userId", 
container.REQUEST.user)<BR>&gt; &gt; return context.init2_html()<BR>&gt; 
&gt; "<BR>&gt; &gt; &nbsp;<BR>&gt; &gt; Step 4: create a page template 
called "init2_html" in the<BR>&gt; &gt; "reproducingError" folder with the 
following content:<BR>&gt; &gt; "<BR>&gt; &gt; &lt;!-- init2_html page 
template --&gt;<BR>&gt; &gt; &lt;a href="init2"&gt;passing face 
2&lt;/a&gt;<BR>&gt; &gt; "<BR>&gt; &gt; &nbsp;<BR>&gt; &gt; Step 5: create a 
python script called "init2" in the<BR>&gt; &gt; "reproducingError" folder 
with the following content:<BR>&gt; &gt; "<BR>&gt; &gt; # init2 script<BR>
&gt; &gt; request = context.REQUEST<BR>&gt; &gt; sessionData = 
request.SESSION<BR>&gt; &gt; sessionData.set('idService', 'testService')<BR>
&gt; &gt; context.first()<BR>&gt; &gt; return context.external(context)<BR>
&gt; &gt; "<BR>&gt; &gt; &nbsp;<BR>&gt; &gt; Step 6: create a page template 
called "first_html" in the<BR>&gt; &gt; "reproducingError" folder with the 
following content:<BR>&gt; &gt; "<BR>&gt; &gt; First Response<BR>&gt; &gt; 
"<BR>&gt; &gt; &nbsp;<BR>&gt; &gt; Step 7: create a python script called 
"first" in the<BR>&gt; &gt; "reproducingError" folder with the following 
content:<BR>&gt; &gt; "<BR>&gt; &gt; # first script<BR>&gt; &gt; response = 
container.REQUEST.RESPONSE<BR>&gt; &gt; str = container.first_html()<BR>&gt; 
&gt; response.write(str)<BR>&gt; &gt; response.flush()<BR>&gt; &gt; "<BR>
&gt; &gt; &nbsp;<BR>&gt; &gt; Step 8: create an external method called 
"external" in the<BR>&gt; &gt; "reproducingError" folder with the following 
content, in where the<BR>&gt; &gt; function of the external method is 
"communicationResponse" and the<BR>&gt; &gt; module is any name that you 
give to the file:<BR>&gt; &gt; "<BR>&gt; &gt; # external method<BR>&gt; &gt; 
import time<BR>&gt; &gt; def communicationResponse(context):<BR>&gt; &gt; 
&nbsp; &nbsp; response = context.REQUEST.RESPONSE<BR>&gt; &gt; &nbsp; &nbsp; 
sessionData = context.REQUEST.SESSION<BR>&gt; &gt; &nbsp; &nbsp; 
strDetailEnd =<BR>&gt; &gt; 
"&lt;script&gt;window.location='reproducingError/end'&lt;/script&gt;"<BR>
&gt; &gt; &nbsp; &nbsp; <BR>&gt; &gt; &nbsp; &nbsp; for item in range(1, 
40):<BR>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; time.sleep(3)<BR>&gt; &gt; 
&nbsp; &nbsp; &nbsp; &nbsp; response.write("Response iteration:" + 
str(item))<BR>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; response.flush()<BR>&gt; 
&gt; &nbsp; &nbsp; response.write(strDetailEnd)<BR>&gt; &gt; &nbsp; &nbsp; 
response.flush()<BR>&gt; &gt; "<BR>&gt; &gt; &nbsp;<BR>&gt; &gt; Step 9: 
create a python script called "end" in the "reproducingError"<BR>&gt; &gt; 
folder with the following content:<BR>&gt; &gt; "<BR>&gt; &gt; # end 
script<BR>&gt; &gt; idService = context.REQUEST.SESSION['idService']<BR>&gt; 
&gt; return "Fin - " + idService<BR>&gt; &gt; "<BR>&gt; &gt; &nbsp;<BR>&gt; 
&gt; Step 10: open two explorer in wich call the object<BR>&gt; &gt; 
"reproducingError" (Example: localhost:8080/reproducingError)<BR>&gt; &gt; 
&nbsp;<BR>&gt; &gt; Step 11: enter an example text in each one.<BR>&gt; &gt; 
&nbsp;<BR>&gt; &gt; Step 12: clink in the link of one of them, and 5 second 
later clink<BR>&gt; on<BR>&gt; &gt; the link of the other explorer. The 
waiting for around 5 second is<BR>&gt; &gt; necesary because with other time 
interval not allways get the error.<BR>&gt; &gt; &nbsp;<BR>&gt; &gt; Stpe 
13: and wait the "Response iteration"... &nbsp;Please if the error<BR>&gt; 
&gt; don't appear in any of the pages, begins at Step 9 again. and try to<BR>
&gt; &gt; count to 5 witch other velocity :)<BR>&gt; &gt; &nbsp;<BR>&gt; 
&gt; The correct result is:<BR>&gt; &gt; "<BR>&gt; &gt; Fin - testService<BR>
&gt; &gt; "<BR>&gt; &gt; &nbsp;<BR>&gt; &gt; The error is:<BR>&gt; &gt; "<BR>
&gt; &gt; Site Error<BR>&gt; &gt; An error was encountered while publishing 
this resource. <BR>&gt; &gt; Error Type: KeyError<BR>&gt; &gt; Error Value: 
'idService'<BR>&gt; &gt; "<BR>&gt; &gt; The traceback:<BR>&gt; &gt; "<BR>
&gt; &gt; Traceback (innermost last):<BR>&gt; &gt; &nbsp; Module 
ZPublisher.Publish, line 101, in publish<BR>&gt; &gt; &nbsp; Module 
ZPublisher.mapply, line 88, in mapply<BR>&gt; &gt; &nbsp; Module 
ZPublisher.Publish, line 39, in call_object<BR>&gt; &gt; &nbsp; Module 
Shared.DC.Scripts.Bindings, line 306, in __call__<BR>&gt; &gt; &nbsp; Module 
Shared.DC.Scripts.Bindings, line 343, in _bindAndExec<BR>&gt; &gt; &nbsp; 
Module Products.PythonScripts.PythonScript, line 323, in _exec<BR>&gt; &gt; 
&nbsp; Module None, line 2, in end<BR>&gt; &gt; &nbsp; &nbsp;- 
&lt;PythonScript at /approach/reproducingError/end&gt;<BR>&gt; &gt; &nbsp; 
&nbsp;- Line 2<BR>&gt; &gt; &nbsp; Module AccessControl.ZopeGuards, line 67, 
in guarded_getitem<BR>&gt; &gt; &nbsp; Module 
Products.Transience.TransientObject, line 176, in<BR>&gt; __getitem__<BR>
&gt; &gt; KeyError: 'idService'<BR>&gt; &gt; "<BR>&gt; &gt; &nbsp;<BR>&gt; 
&gt; I will appreciate if you try until the error appear, because I not<BR>
&gt; &gt; always obtain the error. I thinks that it is bacause the time<BR>
&gt; interval<BR>&gt; &gt; between the two request.<BR>&gt; &gt; &nbsp;<BR>
&gt; &gt; A curious thing is that when I obtain the error, if I wait around 
15<BR>&gt; &gt; second and refresh the page in wich i obtain the error, the 
correct<BR>&gt; &gt; result appear.. and no errors come.<BR>&gt; &gt; 
&nbsp;<BR>&gt; &gt; Sorry for the extended message, but I need any help that 
you can give<BR>&gt; &gt; me, because this describe error environment 
imitate a funcionality<BR>&gt; &gt; that I must give in a system very import 
that i'm doing.<BR>&gt; &gt; &nbsp;<BR>&gt; &gt; I'm using Zope 2.7.6 for 
Windows.<BR>&gt; &gt; &nbsp;<BR>&gt; &gt; Thanks in advanced.<BR>&gt; &gt; 
Leticia<BR>&gt; &gt; _______________________________________________<BR>&gt; 
&gt; Zope maillist &nbsp;- &nbsp;Zope@zope.org<BR>&gt; &gt; 
http://mail.zope.org/mailman/listinfo/zope<BR>&gt; &gt; ** &nbsp; No cross 
posts or HTML encoding! &nbsp;**<BR>&gt; &gt; (Related lists - <BR>&gt; &gt; 
&nbsp;http://mail.zope.org/mailman/listinfo/zope-announce<BR>&gt; &gt; 
&nbsp;http://mail.zope.org/mailman/listinfo/zope-dev )<BR>&gt; <BR>&gt; <BR>
&gt; <BR></DIV>
</BODY></HTML>