[Repoze-dev] weird intermittent error with apache2 and mod_wsgi

6 views
Skip to first unread message

Chris Withers

unread,
Jun 27, 2011, 11:36:43 AM6/27/11
to mod...@googlegroups.com, repoze-dev, zope-dev
Hi All,

Apologies for the cross post, but this problem is occurring with a
repoze.bfg app running on apache using mod_wsgi, and the exception is
suggesting something zope.interface related...

So, firstly, it only happens intermittently, and I haven't been able to
figure out any pattern to the exceptions. It didn't used to happen at
all (this app has been happily running for a year or so now) but I can't
think of anything that's changed on the machine in question that might
cause this. Restarting Apache does appear to cure it for a bit...

The exception is as follows:

File "aircon/bin/mod_wsgi", line 34, in <module>
from aircon.web import make_app
File "aircon/aircon/web.py", line 2, in <module>
from aircon.config import system,Session
File "aircon/aircon/config.py", line 1, in <module>
from gb50 import System
File "aircon/aircon/gb50.py", line 33, in <module>
class System:
File
"zope.interface-3.6.1-py2.6-linux-i686.egg/zope/interface/advice.py",
line 141, in advise
return callback(newClass)
File
"zope.interface-3.6.1-py2.6-linux-i686.egg/zope/interface/declarations.py",
line 471, in _implements_advice
classImplements(cls, *interfaces)
File
"zope.interface-3.6.1-py2.6-linux-i686.egg/zope/interface/declarations.py",
line 447, in classImplements
spec = implementedBy(cls)
File
"zope.interface-3.6.1-py2.6-linux-i686.egg/zope/interface/declarations.py",
line 287, in implementedByFallback
spec = cls.__dict__.get('__implemented__')
2011] [error] [client 93.89.128.162] RuntimeError: class.__dict__ not
accessible in restricted mode

the section of gb50.py looks like:

from aircon.interfaces import ISystem,IUnit
from zope.interface import implements

class System:

implements(ISystem)

...

The interface is:

from zope.interface import Interface,Attribute

class ISystem(Interface):
...

Anyone seen anything like this before or have any ideas?

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
_______________________________________________
Repoze-dev mailing list
Repoz...@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Tres Seaver

unread,
Jun 27, 2011, 12:31:22 PM6/27/11
to repoz...@lists.repoze.org, mod...@googlegroups.com, zope...@zope.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/27/2011 11:36 AM, Chris Withers wrote:
> RuntimeError: class.__dict__ not
> accessible in restricted mode


"Let me google that for you":

- - http://mail.zope.org/pipermail/zodb-dev/2009-June/012607.html

- -
http://mediacore.com/blog/hosting-multiple-wsgi-applications-with-apache/

- - http://trac.edgewall.org/ticket/3371


Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tse...@palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk4IsFoACgkQ+gerLs4ltQ5VIwCgsoZ7ujvlOsZ+U+YAiPushoyF
Dm4AniLcNiyWrbPuIHOpS8zNmAW0B2lZ
=4gYU
-----END PGP SIGNATURE-----

Chris Withers

unread,
Jun 28, 2011, 12:24:44 PM6/28/11
to mod...@googlegroups.com, Tres Seaver, repoz...@lists.repoze.org, zope...@zope.org

Adding:

WSGIApplicationGroup %{GLOBAL}

...to my httpd.conf before the virtualhosts section made no difference.
Still works fine for a while, then starts randomly and inconsistently
spitting exceptions, this time:

mod_wsgi (pid=22471): Exception occurred processing WSGI script
'/...mod_wsgi'.
Traceback (most recent call last):
File "...bin/mod_wsgi", line 34, in <module>
from aircon.web import make_app
File "...aircon/web.py", line 7, in <module>
from repoze.bfg.configuration import Configurator
ImportError: No module named bfg.configuration

I must stress again, this is intermittent, it'll work for a while, then
fail for a few requests, then more so until Apache is restarted.

(bfg.configuration is most certainly there and on the python path...)

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk

Stuart Zurcher

unread,
Feb 12, 2014, 10:33:04 AM2/12/14
to mod...@googlegroups.com, Tres Seaver, repoz...@lists.repoze.org, zope...@zope.org
I know it has been a long time past, but I'm running into  the same issue and have tried the same things.  I was wondering if you ever nailed down what was causing the issue.
Reply all
Reply to author
Forward
0 new messages