Bizarre import errors, was Re: [Zope] aq_explicit permission: where set?

Paul Winkler pw_lists at slinkp.com
Thu Sep 25 11:02:57 EDT 2003


Synopsis:  One ZEO server, two ZEO clients, same code installed
on all three.  One client gives an ImportError on a custom
product, the other does not.

Detail:

I currently have a production site running from two zope instances, each 
running on its own boxes, both running from the same zeo (on its own box).
I upgraded them all last night to Zope 2.6.2 / ZEO from ZODB-3.1.2
and that's when the problem appeared.

The error is triggered by this line in a Script (Python):

from Products.CTIPortalData import ExprEvaluator

...Which is fine on ONE of the zeo clients, but on the other, I get:

Traceback (innermost last):
  Module ZPublisher.Publish, line 49, in publish
  Module ZPublisher.mapply, line 32, in mapply
  Module ZPublisher.Publish, line 38, in call_object
  Module Shared.DC.Scripts.Bindings, line 250, in __call__
  Module Shared.DC.Scripts.Bindings, line 270, in _bindAndExec
  Module Products.PythonScripts.PythonScript, line 270, in _exec
  Module Script (Python), line 10, in cook_vars
   - <PythonScript at /portals/portal_skins/custom/cook_vars>
   - Line 10
  Module AccessControl.ZopeGuards, line 127, in guarded_import
ImportError: import of "ExprEvaluator" from "Products.CTIPortalData" is unauthorized. You are not allowed to access ExprEvaluator in this context


I have checked and double-checked, and both zopes have *exactly* the
same Products, Extensions, and zope software installed. I'm
now going to check yet again...

Also, this is the same zope / zeo versions that I've been running stably on
my dev servers.  As I earlier noted in another thread, I had 
the same problem (with the same script & product) at one point on the 
dev servers.  I made a guess that VerboseSecurity might be part of 
the problem, which proved not to be true, but led indirectly to
the symptom vanishing as described below. 
(In this case, VerboseSecurity is not involved at all - 
it's not on these production servers. Neither have I set 
ZOPE_SECURITY_POLICY="PYTHON".)


previous weird experience follows from an earlier thread:

> FWIW, I recently started getting this exception on some of my own
> code that had been working - and has NOT been changed.
> It started when I upgraded from 2.6.2b3 to 2.6.2b5. BUt that can't
> have been the culprit because weirdly,
> another InstanceHome running off the same SoftwareHome
> did NOT experience the errors. I made sure that the affected Product
> code was identical in the two instances - I copied it back from
> the working one to the non-working one. No change.
> 
> I eventually realized that the error-stricken InstanceHome was the
> only one that had VerboseSecurity installed, which monkeypatches 
> something in the security machinery. I wondered if there was a conflict.
> To test this theory, I removed VerboseSecurity and restarted zope. 
> Problem gone.
> 
> BUt that's not the end of the weirdness. I re-installed VerboseSecurity,
> restarted again - and everything still works :-0
> 
> So I have no idea what the culprit was.
> 
> -- 
> 
> Paul Winkler
> http://www.slinkp.com

I'm wondering if there's an odd bug in zope 2.6.2 that only
shows up in some marginal circumstances... or maybe this is a peculiar
manifestation of some bug in redhat glibc... or maybe i just haven't found
my own mistake yet :-)


-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's ESOTERICALLY IMPOTENT BLIND NINJA!
(random hero from isometric.spaceninja.com)



More information about the Zope mailing list