Re: [ZODB-Dev] Cannot import name utils + class.__dict__ not accessible

2009-06-22 Thread Shane Hathaway
Jose Benito Gonzalez Lopez wrote:
> Thank you so much for your answer.
> We have realized that it was due to mod_python module. We do
> not know why but adding the directive:
> 
> PythonInterpreter main_interpreter
> 
> in the httpd.conf has fixed the problem.

There should be a big notice somewhere that says "always disable the 
multiple interpreter feature of mod_python and mod_wsgi".  It's a 
misfeature IMHO and the worst part is it's enabled by default in both of 
them.  It plays havoc with C extensions.

The mod_wsgi equivalent, FWIW, is "WSGIApplicationGroup main".

Shane

___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] Cannot import name utils + class.__dict__ not accessible

2009-06-22 Thread Jose Benito Gonzalez Lopez
Dear Chris,

Thank you so much for your answer.
We have realized that it was due to mod_python module. We do
not know why but adding the directive:

PythonInterpreter main_interpreter

in the httpd.conf has fixed the problem.

So, I am so sorry for the spam. Nothing to do with ZODB.

Best regards,
Jose

Chris McDonough wrote:
> I'm not sure of the exact cause of this error, but I'll note that one your 
> deployment looks like it's using the "slow" (non-C) versions of the stuff in 
> zope.interface, which usually means that somehow the zope.interface C 
> extensions 
> couldn't be compiled.  You might try checking this from a debug prompt:
>
> It should look like this:
>
>  >>> from zope.interface import implementedBy
>  >>> implementedBy
> 
>
> You're not using the C extensions if it looks something like this instead:
>
>  >>> from zope.interface import implementedBy
>  >>> implementedBy
> 
>
> I'd start by getting that fixed if possible.
>
> - C
>
> On 6/15/09 9:33 AM, Jose Benito Gonzalez Lopez wrote:
>   
>> Dear ZODB developers,
>>
>> We are experiencing some errors and we'd appreciate any idea or advise.
>>
>> Our web application (http://indicodemo.cern.ch) uses ZODB:
>> - ZODB 3.4 in production
>> - and ZODB 3.8.0 for testing.
>> Both versions work smoothly.
>>
>> Now, we are moving to ZODB3 3.8.1 (in a fresh installation of the web
>> appl.). The installation was fine
>> but while navigating through the website, we get the following errors
>> randomly:
>>
>> 
>> ...
>> [..]   File "/usr/lib64/python2.4/site-packages/ZEO/ClientStorage.py",
>> line 34, in ?\nfrom ZEO.cache import ClientCache
>> [..]   File "/usr/lib64/python2.4/site-packages/ZEO/cache.py", line 36,
>> in ?\nimport ZODB.fsIndex
>> [..]   File "/usr/lib64/python2.4/site-packages/ZODB/__init__.py", line
>> 31, in ?\nfrom DB import DB
>> [..]   File "/usr/lib64/python2.4/site-packages/ZODB/DB.py", line 27, in
>> ?\nfrom ZODB.Connection import Connection
>> [..]   File "/usr/lib64/python2.4/site-packages/ZODB/Connection.py",
>> line 33, in ?\nfrom ZODB.blob import Blob, rename_or_copy_blob
>> [..]   File "/usr/lib64/python2.4/site-packages/ZODB/blob.py", line 34,
>> in ?\nfrom ZODB import utils
>> [..]   ImportError: cannot import name utils
>> 
>>
>> 
>>
>> Traceback (most recent call last):
>>File "/usr/lib64/python2.4/site-packages/mod_python/importer.py", line 
>> 1537, in HandlerDispatch
>>  default=default_handler, arg=req, silent=hlist.silent)
>>File "/usr/lib64/python2.4/site-packages/mod_python/importer.py", line 
>> 1229, in _process_target
>>  result = _execute_target(config, req, object, arg)
>>File "/usr/lib64/python2.4/site-packages/mod_python/importer.py", line 
>> 1128, in _execute_target
>>  result = object(arg)
>>File "/usr/lib64/python2.4/site-packages/mod_python/publisher.py", line 
>> 204, in handler
>>  module = page_cache[req]
>>File "/usr/lib64/python2.4/site-packages/mod_python/importer.py", line 
>> 1059, in __getitem__
>>  return import_module(req.filename)
>>File "/usr/lib64/python2.4/site-packages/mod_python/importer.py", line 
>> 296, in import_module
>>  log, import_path)
>>File "/usr/lib64/python2.4/site-packages/mod_python/importer.py", line 
>> 680, in import_module
>>  execfile(file, module.__dict__)
>>File "/opt/indico/www/htdocs/signIn.py", line 22, in ?
>>  from MaKaC.common.general import *
>>File "/usr/lib/python2.4/site-packages/MaKaC/common/__init__.py", line 
>> 22, in ?
>>  from db import DBMgr
>>File "/usr/lib/python2.4/site-packages/MaKaC/common/db.py", line 30, in ?
>>  from ZEO.ClientStorage import ClientStorage
>>File "/usr/lib64/python2.4/site-packages/ZEO/ClientStorage.py", line 34, 
>> in ?
>>  from ZEO.cache import ClientCache
>>File "/usr/lib64/python2.4/site-packages/ZEO/cache.py", line 36, in ?
>>  import ZODB.fsIndex
>>File "/usr/lib64/python2.4/site-packages/ZODB/__init__.py", line 31, in ?
>>  from DB import DB
>>File "/usr/lib64/python2.4/site-packages/ZODB/DB.py", line 27, in ?
>>  from ZODB.Connection import Connection
>>File "/usr/lib64/python2.4/site-packages/ZODB/Connection.py", line 33, in 
>> ?
>>  from ZODB.blob import Blob, rename_or_copy_blob
>>File "/usr/lib64/python2.4/site-packages/ZODB/blob.py", line 36, in ?
>>  import transaction
>>File "/usr/lib64/python2.4/site-packages/transaction/__init__.py", line 
>> 19, in ?
>>  from transaction._transaction import Transaction
>>File "/usr/lib64/python2.4/site-packages/transaction/_transaction.py", 
>> line 620, in ?
>>  class Savepoint:
>>File "/usr/lib64/python2.4/site-packages/zope/interface/advice.py", line 
>> 132, in advise
>>  return callback(newClass)
>>File "/usr/lib64/python2.4/site-packages/zope/interface/declarations.py", 
>> line 484, in _implements_advice
>>  classImplements(cls, *interfaces)
>>File "/usr/lib64/python2.4/site-

Re: [ZODB-Dev] Cannot import name utils + class.__dict__ not accessible

2009-06-17 Thread Chris McDonough
I'm not sure of the exact cause of this error, but I'll note that one your 
deployment looks like it's using the "slow" (non-C) versions of the stuff in 
zope.interface, which usually means that somehow the zope.interface C 
extensions 
couldn't be compiled.  You might try checking this from a debug prompt:

It should look like this:

 >>> from zope.interface import implementedBy
 >>> implementedBy


You're not using the C extensions if it looks something like this instead:

 >>> from zope.interface import implementedBy
 >>> implementedBy


I'd start by getting that fixed if possible.

- C

On 6/15/09 9:33 AM, Jose Benito Gonzalez Lopez wrote:
> Dear ZODB developers,
>
> We are experiencing some errors and we'd appreciate any idea or advise.
>
> Our web application (http://indicodemo.cern.ch) uses ZODB:
> - ZODB 3.4 in production
> - and ZODB 3.8.0 for testing.
> Both versions work smoothly.
>
> Now, we are moving to ZODB3 3.8.1 (in a fresh installation of the web
> appl.). The installation was fine
> but while navigating through the website, we get the following errors
> randomly:
>
> 
> ...
> [..]   File "/usr/lib64/python2.4/site-packages/ZEO/ClientStorage.py",
> line 34, in ?\nfrom ZEO.cache import ClientCache
> [..]   File "/usr/lib64/python2.4/site-packages/ZEO/cache.py", line 36,
> in ?\nimport ZODB.fsIndex
> [..]   File "/usr/lib64/python2.4/site-packages/ZODB/__init__.py", line
> 31, in ?\nfrom DB import DB
> [..]   File "/usr/lib64/python2.4/site-packages/ZODB/DB.py", line 27, in
> ?\nfrom ZODB.Connection import Connection
> [..]   File "/usr/lib64/python2.4/site-packages/ZODB/Connection.py",
> line 33, in ?\nfrom ZODB.blob import Blob, rename_or_copy_blob
> [..]   File "/usr/lib64/python2.4/site-packages/ZODB/blob.py", line 34,
> in ?\nfrom ZODB import utils
> [..]   ImportError: cannot import name utils
> 
>
> 
>
> Traceback (most recent call last):
>File "/usr/lib64/python2.4/site-packages/mod_python/importer.py", line 
> 1537, in HandlerDispatch
>  default=default_handler, arg=req, silent=hlist.silent)
>File "/usr/lib64/python2.4/site-packages/mod_python/importer.py", line 
> 1229, in _process_target
>  result = _execute_target(config, req, object, arg)
>File "/usr/lib64/python2.4/site-packages/mod_python/importer.py", line 
> 1128, in _execute_target
>  result = object(arg)
>File "/usr/lib64/python2.4/site-packages/mod_python/publisher.py", line 
> 204, in handler
>  module = page_cache[req]
>File "/usr/lib64/python2.4/site-packages/mod_python/importer.py", line 
> 1059, in __getitem__
>  return import_module(req.filename)
>File "/usr/lib64/python2.4/site-packages/mod_python/importer.py", line 
> 296, in import_module
>  log, import_path)
>File "/usr/lib64/python2.4/site-packages/mod_python/importer.py", line 
> 680, in import_module
>  execfile(file, module.__dict__)
>File "/opt/indico/www/htdocs/signIn.py", line 22, in ?
>  from MaKaC.common.general import *
>File "/usr/lib/python2.4/site-packages/MaKaC/common/__init__.py", line 22, 
> in ?
>  from db import DBMgr
>File "/usr/lib/python2.4/site-packages/MaKaC/common/db.py", line 30, in ?
>  from ZEO.ClientStorage import ClientStorage
>File "/usr/lib64/python2.4/site-packages/ZEO/ClientStorage.py", line 34, 
> in ?
>  from ZEO.cache import ClientCache
>File "/usr/lib64/python2.4/site-packages/ZEO/cache.py", line 36, in ?
>  import ZODB.fsIndex
>File "/usr/lib64/python2.4/site-packages/ZODB/__init__.py", line 31, in ?
>  from DB import DB
>File "/usr/lib64/python2.4/site-packages/ZODB/DB.py", line 27, in ?
>  from ZODB.Connection import Connection
>File "/usr/lib64/python2.4/site-packages/ZODB/Connection.py", line 33, in ?
>  from ZODB.blob import Blob, rename_or_copy_blob
>File "/usr/lib64/python2.4/site-packages/ZODB/blob.py", line 36, in ?
>  import transaction
>File "/usr/lib64/python2.4/site-packages/transaction/__init__.py", line 
> 19, in ?
>  from transaction._transaction import Transaction
>File "/usr/lib64/python2.4/site-packages/transaction/_transaction.py", 
> line 620, in ?
>  class Savepoint:
>File "/usr/lib64/python2.4/site-packages/zope/interface/advice.py", line 
> 132, in advise
>  return callback(newClass)
>File "/usr/lib64/python2.4/site-packages/zope/interface/declarations.py", 
> line 484, in _implements_advice
>  classImplements(cls, *interfaces)
>File "/usr/lib64/python2.4/site-packages/zope/interface/declarations.py", 
> line 460, in classImplements
>  spec = implementedBy(cls)
>File "/usr/lib64/python2.4/site-packages/zope/interface/declarations.py", 
> line 300, in implementedByFallback
>  spec = cls.__dict__.get('__implemented__')
>
> RuntimeError: class.__dict__ not accessible in restricted mode
> 
>
>
> Have you ever experience a problem like this? Is there any easy solution?
> We use python 2.4.3, apache 2.2.3, mod