[Zope] Migrated from Zope 2.7.8 to 2.10; how to fix "Unauthorized: You are not allowed to access 'standard_html_header' in this context" error?

Dieter Maurer dieter at handshake.de
Sun Mar 29 14:52:41 EDT 2009


Aleksey Tsalolikhin wrote at 2009-3-28 21:57 -0700:
> I recently migrated from Zope 2.7.8 to 2.10 and am now seeing
>this error in my event.log:
>
>
>2009-03-28T21:15:52 ERROR root Exception while rendering an error message
>Traceback (most recent call last):
>  File "/usr/lib/zope/lib/python/OFS/SimpleItem.py", line 225, in
>raise_standardErrorMessage
>    v = s(client, REQUEST, **kwargs)
>  File "/usr/lib/zope/lib/python/OFS/DTMLMethod.py", line 144, in __call__
>    r=apply(HTML.__call__, (self, client, REQUEST), kw)
>  File "/usr/lib/zope/lib/python/DocumentTemplate/DT_String.py", line
>476, in __call__
>    try: result = render_blocks(self._v_blocks, md)
>Unauthorized: You are not allowed to access 'standard_html_header' in
>this context
>
>What does it mean?  How do I fix it, please?
>
>I am new to Zope.
>
>I copied the Web app by export from the old server and import to the new one.

Activate "verbose security" in your Zope configuration file
(you need to activate "verbose security" and set the "security-implementation"
to "python" -- the comment in the Zope configuration file will explain
the details).
Reconfigure your "error_log" (the "error_log" object in the root folder
of the ZMI (Zope Management Interface)) to not ignore "Unauthorized" exceptions
and then try to reproduce the problem. The traceback in the "error_log"
will then tell you quite precise reasons for 'Unauthorized' problems).


Unfortunately, your current problem will not directly show up in the
"error_log". The log entry tells you about a secondary problem.
Due to a primary problem (this will show up in "error_log") the
"standard_error_message" was called and it produces a secondary problem
(logged above but not shown in "error_log", even after reconfiguration).

As always in situations where exceptions are caught it is quite
difficult to analyse the exception. I would know how to approach
such a task (it involves debugging Zope, either with a
development IDE (my colleagues like much the commercial (!) WingIDE;
Eclipse with the "py_dev" extension may do as well) or with
Pythons debugger ("pdb" or my "dm.pdb.zpdb" extension)).
But this is not easy and I do not know whether I should recommend it
to someone new to Zope.


The alternative:
obviously, you have a protected "standard_html_header".
Try to locate it and unprotect it (you learn about protection
and how to unprotect in the Zope Book (2.7 edition, on "plope.org").




-- 
Dieter


More information about the Zope mailing list