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