weird intermittent error with apache2 and mod_wsgi
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
-----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 tseaver@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-----
On 27/06/2011 17:31, Tres Seaver wrote:
"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/
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
participants (2)
-
Chris Withers -
Tres Seaver