[Zope] AttributeError: RESPONSE ?!
Peter Sabaini
peter at sabaini.at
Fri Feb 25 04:39:50 EST 2005
On Thursday 24 February 2005 16:55, Florent Guillaume wrote:
> Did you have any luck tracking this down ? To debug this I would add
> some LOG statements in HTTPRequest's __getattr__, dumping for instance
> the whole self.__dict__.
>
> Florent
It was a threading problem in my Product. I instantiated an
Acquisition-wrapped object at one point in time and (much later) re-wrapped
it. Then, when accessing REQUEST through acquisition, I had a very good
chance to get a REQUEST touched by another thread; this typically had the
effect of missing stuff from the REQUEST.other dictionary -- most often
SESSION and RESPONSE, sometimes AUTHENTICATED_USER.
For now, I just put a big thread lock around the whole thing, but ultimately
I'll try to eliminate dependency on Acquisition as much as I can.
- peter.
> Peter Sabaini <peter at sabaini.at> wrote:
> > hi list,
> >
> > this one has got me stumped; from the traceback:
> >
> > """
> > Module ZPublisher.HTTPRequest, line 1220, in __getattr__
> >
> > AttributeError: RESPONSE
> > """
> >
> > AFAIK the REQUEST object should *always* have a RESPONSE attribute,
> > right?
> >
> > background:
> >
> > * this happens under moderate load in our somewhat involved data entry
> > application
> >
> > * load generated by apache benchmark at a concurrency level of 1-2 plus
> > manual browsing
> >
> > * occurs at random, one out of 5 clicks maybe
> >
> > * ZEO setup, zope 2.7.4, Python 2.3.5 (#2, Feb 9 2005, 00:38:15) [GCC
> > 3.3.5 (Debian 1:3.3.5-8)] on linux2
> >
> >
> > under similar conditions i sometimes also get an "AttributeError:
> > SESSION" which looks like somehow REQUEST is loosing its attributes? can
> > that happen?
> >
> > *any* thoughts greatly appreciated before i have to break out gdb and
> > immerse myself for days in it :-/
> >
> > - peter.
> >
> >
> >
> > ps.: somewhat abbreviated traceback below
> >
> >
> > Traceback (innermost last):
> > Module ZPublisher.Publish, line 101, in publish
> > Module ZPublisher.mapply, line 88, in mapply
> > Module ZPublisher.Publish, line 39, in call_object
> > Module Products.FormProcessor.FormProcessor, line 155, in displayForm
> > Module Products.FormProcessor.FormProcessor, line 180, in view
> > Module Products.FormProcessor.FormController, line 274, in view
> > Module Products.FormProcessor.Presenter, line 1033, in render
> > Module Products.FormProcessor.Presenter, line 413, in render
> > Module Shared.DC.Scripts.Bindings, line 306, in __call__
> > Module Products.UnrestrictedPageTemplateFiles.PageTemplateFile, line
> > 32, in _bindAndExec
> > Module Products.PageTemplates.PageTemplateFile, line 106, in _exec
> > Module Products.PageTemplates.PageTemplate, line 96, in pt_render
> > - <PageTemplateFile
> > at
> > /siopen_r_net/service_htmlpresenter/hrs_conclusion_of_treatment_conclusio
> >n_of_treatment used for
> > /siopen_r_net/site/members/studies/HRNBL1/patients/PatDetail> Module
> > TAL.TALInterpreter, line 190, in __call__
> > Module TAL.TALInterpreter, line 234, in interpret
> > Module TAL.TALInterpreter, line 409, in do_optTag_tal
> > Module TAL.TALInterpreter, line 394, in do_optTag
> > Module TAL.TALInterpreter, line 389, in no_tag
> > Module TAL.TALInterpreter, line 234, in interpret
> > Module TAL.TALInterpreter, line 671, in do_useMacro
> > Module TAL.TALInterpreter, line 234, in interpret
> > Module TAL.TALInterpreter, line 484, in do_insertText_tal
> > Module Products.PageTemplates.TALES, line 227, in evaluateText
> > Module Products.PageTemplates.TALES, line 221, in evaluate
> > - URL: /siopen_r_net/standard_template.pt
> > - Line 5, Column 0
> > - Expression: standard:'here/util/pageInit'
> > - Names:
> > {'container': <ConfigurableFormView instance at ab841740>,
> > 'context': <Folder instance at ac91c440>,
> > 'default': <Products.PageTemplates.TALES.Default instance at
> > 0xb72263cc>,
> > 'here': <Folder instance at ac91c440>,
> > 'loop': <SafeMapping instance at ab8417e0>,
> > 'modules':
> > <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at
> > 0xb722628c>,
> > 'nothing': None,
> > 'options': {'args': (),
> > 'pagemacro': [('version', '1.5'),
> > ('mode', 'html'),
> > ('setSourceFile',
> > '/siopen_r_net/standard_template.pt'),
> > ('startTag',
> > ('html',
> >
> > -- snip --
> >
> > ('endScope', ()),
> > ('rawtextColumn',
> > ('\n\n
> > </div>\n\n</div>\n\n\n\n</body>\n</html>',
> > 7))]},
> > 'repeat': <SafeMapping instance at ab8417e0>,
> > 'request': <HTTPRequest,
> > URL=http://srn-elendil.telbiomed.at/members/studies/HRNBL1/patients/PatDe
> >tail/conclusion_of_treatment/service_formprocessor/displayForm>, 'root':
> > <Application instance at b5194d40>,
> > 'template': <PageTemplateFile
> > at
> > /siopen_r_net/service_htmlpresenter/hrs_conclusion_of_treatment_conclusio
> >n_of_treatment used for
> > /siopen_r_net/site/members/studies/HRNBL1/patients/PatDetail>,
> > 'traverse_subpath': [],
> > 'user': p.sabaini}
> > Module Products.PageTemplates.Expressions, line 201, in __call__
> > Module Products.PageTemplates.Expressions, line 196, in _eval
> > Module Products.PageTemplates.Expressions, line 95, in render
> > Module Products.PageTemplates.ZRPythonExpr, line 73, in call_with_ns
> > Module Shared.DC.Scripts.Bindings, line 320, in
> > __render_with_namespace__ Module Shared.DC.Scripts.Bindings, line 343, in
> > _bindAndExec
> > Module Products.PythonScripts.PythonScript, line 323, in _exec
> > Module None, line 10, in pageInit
> > - <PythonScript at /siopen_r_net/util/pageInit>
> > - Line 10
> > Module ZPublisher.HTTPRequest, line 1220, in __getattr__
> > AttributeError: RESPONSE
> > _______________________________________________
> > Zope maillist - Zope at zope.org
> > http://mail.zope.org/mailman/listinfo/zope
> > ** No cross posts or HTML encoding! **
> > (Related lists -
> > http://mail.zope.org/mailman/listinfo/zope-announce
> > http://mail.zope.org/mailman/listinfo/zope-dev )
More information about the Zope
mailing list