Problems with TG2 + mod_wsgi
The group you are posting to is a
Usenet group . Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
From:
Luke Macken <luke.mac... @gmail.com>
Date: Sat, 6 Jun 2009 21:56:15 -0700 (PDT)
Local: Sun, Jun 7 2009 12:56 am
Subject: Problems with TG2 + mod_wsgi
Hey guys,
I'm hitting the following traceback when trying to deploy a
TurboGears2 app with mod_wsgi. Any help would be much appreciated.
WSGIDaemonProcess fedoracommunity user=apache maximum-requests=1000
display-name=fedoracommunity processes=1 threads=1
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] mod_wsgi
(pid=1245): Target WSGI script '/usr/share/fedoracommunity/
fedoracommunity.wsgi' cannot be loaded as Python module.
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] mod_wsgi
(pid=1245): Exception occurred processing WSGI script '/usr/share/
fedoracommunity/fedoracommunity.wsgi'.
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] Traceback (most
recent call last):
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
share/fedoracommunity/fedoracommunity.wsgi", line 9, in ?
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] application
= loadapp('config:/etc/fedoracommunity/production.ini')
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 204, in
loadapp
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
loadobj(APP, uri, name=name, **kw)
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 225, in
loadobj
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
context.create()
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 625, in
create
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
self.object_type.invoke(self)
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 110, in
invoke
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
fix_call(context.object, context.global_conf, **context.local_conf)
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
lib/python2.4/site-packages/paste/deploy/util/fixtypeerror.py", line
57, in fix_call
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] val =
callable(*args, **kw)
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
lib/python2.4/site-packages/fedoracommunity/config/middleware.py",
line 26, in make_app
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]
full_stack=full_stack,
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
lib/python2.4/site-packages/tg/configuration.py", line 604, in
make_base_app
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] app =
self.add_tm_middleware(app)
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
lib/python2.4/site-packages/tg/configuration.py", line 531, in
add_tm_middleware
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] from
repoze.tm import make_tm
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
lib/python2.4/site-packages/repoze/tm/__init__.py", line 2, in ?
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] import
transaction
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
lib/python2.4/site-packages/transaction/__init__.py", line 19, in ?
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] from
transaction._transaction import Transaction
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
lib/python2.4/site-packages/transaction/_transaction.py", line 625,
in ?
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] class
Savepoint:
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
lib/python2.4/site-packages/zope/interface/advice.py", line 132, in
advise
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
callback(newClass)
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
lib/python2.4/site-packages/zope/interface/declarations.py", line 484,
in _implements_advice
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]
classImplements(cls, *interfaces)
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
lib/python2.4/site-packages/zope/interface/declarations.py", line 460,
in classImplements
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] spec =
implementedBy(cls)
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
lib/python2.4/site-packages/zope/interface/declarations.py", line 300,
in implementedByFallback
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] spec =
cls.__dict__.get('__implemented__')
[Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] RuntimeError:
class.__dict__ not accessible in restricted mode
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Graham Dumpleton <Graham.Dumple... @gmail.com>
Date: Sun, 7 Jun 2009 03:48:44 -0700 (PDT)
Local: Sun, Jun 7 2009 6:48 am
Subject: Re: Problems with TG2 + mod_wsgi
Set:
WSGIApplicationGroup %{GLOBAL}
This will force your TG instance to run in Python main interpreter.
This is needed in your case as you appear to be using a third party C
extension module for Python which isn't implemented properly to allow
it to be used in Python sub interpreters. Ie., it would like it will
only work in the Python main interpreter.
That this is the problem is suggested by the error:
RuntimeError: class.__dict__ not accessible in restricted mode
which can come about when certain types of Python objects are reused
in a Python interpreter they were not originally created for.
Anyway, give that a try.
Graham
On Jun 7, 2:56 pm, Luke Macken <luke.mac... @gmail.com> wrote:
> Hey guys,
> I'm hitting the following traceback when trying to deploy a
> TurboGears2 app with mod_wsgi. Any help would be much appreciated.
> WSGIDaemonProcess fedoracommunity user=apache maximum-requests=1000
> display-name=fedoracommunity processes=1 threads=1
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] mod_wsgi
> (pid=1245): Target WSGI script '/usr/share/fedoracommunity/
> fedoracommunity.wsgi' cannot be loaded as Python module.
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] mod_wsgi
> (pid=1245): Exception occurred processing WSGI script '/usr/share/
> fedoracommunity/fedoracommunity.wsgi'.
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] Traceback (most
> recent call last):
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> share/fedoracommunity/fedoracommunity.wsgi", line 9, in ?
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] application
> = loadapp('config:/etc/fedoracommunity/production.ini')
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 204, in
> loadapp
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> loadobj(APP, uri, name=name, **kw)
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 225, in
> loadobj
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> context.create()
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 625, in
> create
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> self.object_type.invoke(self)
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 110, in
> invoke
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> fix_call(context.object, context.global_conf, **context.local_conf)
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> lib/python2.4/site-packages/paste/deploy/util/fixtypeerror.py", line
> 57, in fix_call
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] val =
> callable(*args, **kw)
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> lib/python2.4/site-packages/fedoracommunity/config/middleware.py",
> line 26, in make_app
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]
> full_stack=full_stack,
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> lib/python2.4/site-packages/tg/configuration.py", line 604, in
> make_base_app
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] app =
> self.add_tm_middleware(app)
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> lib/python2.4/site-packages/tg/configuration.py", line 531, in
> add_tm_middleware
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] from
> repoze.tm import make_tm
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> lib/python2.4/site-packages/repoze/tm/__init__.py", line 2, in ?
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] import
> transaction
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> lib/python2.4/site-packages/transaction/__init__.py", line 19, in ?
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] from
> transaction._transaction import Transaction
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> lib/python2.4/site-packages/transaction/_transaction.py", line 625,
> in ?
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] class
> Savepoint:
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> lib/python2.4/site-packages/zope/interface/advice.py", line 132, in
> advise
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> callback(newClass)
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> lib/python2.4/site-packages/zope/interface/declarations.py", line 484,
> in _implements_advice
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]
> classImplements(cls, *interfaces)
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> lib/python2.4/site-packages/zope/interface/declarations.py", line 460,
> in classImplements
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] spec =
> implementedBy(cls)
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> lib/python2.4/site-packages/zope/interface/declarations.py", line 300,
> in implementedByFallback
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] spec =
> cls.__dict__.get('__implemented__')
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] RuntimeError:
> class.__dict__ not accessible in restricted mode
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Luke Macken <luke.mac... @gmail.com>
Date: Sun, 7 Jun 2009 12:22:15 -0700 (PDT)
Local: Sun, Jun 7 2009 3:22 pm
Subject: Re: Problems with TG2 + mod_wsgi
This seemed to do the trick! Thank you Graham for your help, and for
all of your great work on mod_wsgi.
Cheers,
luke
On Jun 7, 6:48 am, Graham Dumpleton <Graham.Dumple... @gmail.com>
wrote:
> Set:
> WSGIApplicationGroup %{GLOBAL}
> This will force your TG instance to run in Python main interpreter.
> This is needed in your case as you appear to be using a third party C
> extension module for Python which isn't implemented properly to allow
> it to be used in Python sub interpreters. Ie., it would like it will
> only work in the Python main interpreter.
> That this is the problem is suggested by the error:
> RuntimeError: class.__dict__ not accessible in restricted mode
> which can come about when certain types of Python objects are reused
> in a Python interpreter they were not originally created for.
> Anyway, give that a try.
> Graham
> On Jun 7, 2:56 pm, Luke Macken <luke.mac... @gmail.com> wrote:
> > Hey guys,
> > I'm hitting the following traceback when trying to deploy a
> > TurboGears2 app with mod_wsgi. Any help would be much appreciated.
> > WSGIDaemonProcess fedoracommunity user=apache maximum-requests=1000
> > display-name=fedoracommunity processes=1 threads=1
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] mod_wsgi
> > (pid=1245): Target WSGI script '/usr/share/fedoracommunity/
> > fedoracommunity.wsgi' cannot be loaded as Python module.
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] mod_wsgi
> > (pid=1245): Exception occurred processing WSGI script '/usr/share/
> > fedoracommunity/fedoracommunity.wsgi'.
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] Traceback (most
> > recent call last):
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > share/fedoracommunity/fedoracommunity.wsgi", line 9, in ?
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] application
> > = loadapp('config:/etc/fedoracommunity/production.ini')
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 204, in
> > loadapp
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> > loadobj(APP, uri, name=name, **kw)
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 225, in
> > loadobj
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> > context.create()
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 625, in
> > create
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> > self.object_type.invoke(self)
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 110, in
> > invoke
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> > fix_call(context.object, context.global_conf, **context.local_conf)
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/paste/deploy/util/fixtypeerror.py", line
> > 57, in fix_call
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] val =
> > callable(*args, **kw)
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/fedoracommunity/config/middleware.py",
> > line 26, in make_app
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]
> > full_stack=full_stack,
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/tg/configuration.py", line 604, in
> > make_base_app
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] app =
> > self.add_tm_middleware(app)
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/tg/configuration.py", line 531, in
> > add_tm_middleware
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] from
> > repoze.tm import make_tm
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/repoze/tm/__init__.py", line 2, in ?
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] import
> > transaction
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/transaction/__init__.py", line 19, in ?
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] from
> > transaction._transaction import Transaction
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/transaction/_transaction.py", line 625,
> > in ?
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] class
> > Savepoint:
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/zope/interface/advice.py", line 132, in
> > advise
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> > callback(newClass)
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/zope/interface/declarations.py", line 484,
> > in _implements_advice
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]
> > classImplements(cls, *interfaces)
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/zope/interface/declarations.py", line 460,
> > in classImplements
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] spec =
> > implementedBy(cls)
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/zope/interface/declarations.py", line 300,
> > in implementedByFallback
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] spec =
> > cls.__dict__.get('__implemented__')
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] RuntimeError:
> > class.__dict__ not accessible in restricted mode
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Luke Macken <luke.mac... @gmail.com>
Date: Sun, 7 Jun 2009 12:27:31 -0700 (PDT)
Local: Sun, Jun 7 2009 3:27 pm
Subject: Re: Problems with TG2 + mod_wsgi
Does doing this impose any sort of limitations on other apps running
on the same system? Will I still be able to tweak the processes/
threads of my daemon process?
Thanks,
luke
On Jun 7, 6:48 am, Graham Dumpleton <Graham.Dumple... @gmail.com>
wrote:
> Set:
> WSGIApplicationGroup %{GLOBAL}
> This will force your TG instance to run in Python main interpreter.
> This is needed in your case as you appear to be using a third party C
> extension module for Python which isn't implemented properly to allow
> it to be used in Python sub interpreters. Ie., it would like it will
> only work in the Python main interpreter.
> That this is the problem is suggested by the error:
> RuntimeError: class.__dict__ not accessible in restricted mode
> which can come about when certain types of Python objects are reused
> in a Python interpreter they were not originally created for.
> Anyway, give that a try.
> Graham
> On Jun 7, 2:56 pm, Luke Macken <luke.mac... @gmail.com> wrote:
> > Hey guys,
> > I'm hitting the following traceback when trying to deploy a
> > TurboGears2 app with mod_wsgi. Any help would be much appreciated.
> > WSGIDaemonProcess fedoracommunity user=apache maximum-requests=1000
> > display-name=fedoracommunity processes=1 threads=1
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] mod_wsgi
> > (pid=1245): Target WSGI script '/usr/share/fedoracommunity/
> > fedoracommunity.wsgi' cannot be loaded as Python module.
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] mod_wsgi
> > (pid=1245): Exception occurred processing WSGI script '/usr/share/
> > fedoracommunity/fedoracommunity.wsgi'.
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] Traceback (most
> > recent call last):
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > share/fedoracommunity/fedoracommunity.wsgi", line 9, in ?
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] application
> > = loadapp('config:/etc/fedoracommunity/production.ini')
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 204, in
> > loadapp
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> > loadobj(APP, uri, name=name, **kw)
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 225, in
> > loadobj
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> > context.create()
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 625, in
> > create
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> > self.object_type.invoke(self)
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 110, in
> > invoke
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> > fix_call(context.object, context.global_conf, **context.local_conf)
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/paste/deploy/util/fixtypeerror.py", line
> > 57, in fix_call
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] val =
> > callable(*args, **kw)
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/fedoracommunity/config/middleware.py",
> > line 26, in make_app
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]
> > full_stack=full_stack,
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/tg/configuration.py", line 604, in
> > make_base_app
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] app =
> > self.add_tm_middleware(app)
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/tg/configuration.py", line 531, in
> > add_tm_middleware
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] from
> > repoze.tm import make_tm
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/repoze/tm/__init__.py", line 2, in ?
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] import
> > transaction
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/transaction/__init__.py", line 19, in ?
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] from
> > transaction._transaction import Transaction
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/transaction/_transaction.py", line 625,
> > in ?
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] class
> > Savepoint:
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/zope/interface/advice.py", line 132, in
> > advise
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> > callback(newClass)
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/zope/interface/declarations.py", line 484,
> > in _implements_advice
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]
> > classImplements(cls, *interfaces)
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/zope/interface/declarations.py", line 460,
> > in classImplements
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] spec =
> > implementedBy(cls)
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > lib/python2.4/site-packages/zope/interface/declarations.py", line 300,
> > in implementedByFallback
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] spec =
> > cls.__dict__.get('__implemented__')
> > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] RuntimeError:
> > class.__dict__ not accessible in restricted mode
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Graham Dumpleton <Graham.Dumple... @gmail.com>
Date: Mon, 8 Jun 2009 03:44:51 -0700 (PDT)
Local: Mon, Jun 8 2009 6:44 am
Subject: Re: Problems with TG2 + mod_wsgi
On Jun 8, 5:27 am, Luke Macken <luke.mac... @gmail.com> wrote:
> Does doing this impose any sort of limitations on other apps running
> on the same system? Will I still be able to tweak the processes/
> threads of my daemon process?
Not really. The only issue that can arise is that mod_wsgi by default
keeps each WSGI application in a distinct sub interpreter. Thus if
running multiple WSGI applications in the same daemon process group,
they would be kept separate. By overriding the sub interpreter used,
just have to be careful at what scope you do it as you may not want to
be forcing all WSGI applications into the main interpreter. Depending
on the applications, not all WSGI applications, or multiple instances
of same framework, will happily coexist in same interpreter. If each
WSGI application has its own daemon process group anyway, definitely
no problem.
Graham
> Thanks,
> luke
> On Jun 7, 6:48 am, Graham Dumpleton <Graham.Dumple... @gmail.com>
> wrote:
> > Set:
> > WSGIApplicationGroup %{GLOBAL}
> > This will force your TG instance to run in Python main interpreter.
> > This is needed in your case as you appear to be using a third party C
> > extension module for Python which isn't implemented properly to allow
> > it to be used in Python sub interpreters. Ie., it would like it will
> > only work in the Python main interpreter.
> > That this is the problem is suggested by the error:
> > RuntimeError: class.__dict__ not accessible in restricted mode
> > which can come about when certain types of Python objects are reused
> > in a Python interpreter they were not originally created for.
> > Anyway, give that a try.
> > Graham
> > On Jun 7, 2:56 pm, Luke Macken <luke.mac... @gmail.com> wrote:
> > > Hey guys,
> > > I'm hitting the following traceback when trying to deploy a
> > > TurboGears2 app with mod_wsgi. Any help would be much appreciated.
> > > WSGIDaemonProcess fedoracommunity user=apache maximum-requests=1000
> > > display-name=fedoracommunity processes=1 threads=1
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] mod_wsgi
> > > (pid=1245): Target WSGI script '/usr/share/fedoracommunity/
> > > fedoracommunity.wsgi' cannot be loaded as Python module.
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] mod_wsgi
> > > (pid=1245): Exception occurred processing WSGI script '/usr/share/
> > > fedoracommunity/fedoracommunity.wsgi'.
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] Traceback (most
> > > recent call last):
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > > share/fedoracommunity/fedoracommunity.wsgi", line 9, in ?
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] application
> > > = loadapp('config:/etc/fedoracommunity/production.ini')
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > > lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 204, in
> > > loadapp
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> > > loadobj(APP, uri, name=name, **kw)
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > > lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 225, in
> > > loadobj
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> > > context.create()
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > > lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 625, in
> > > create
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> > > self.object_type.invoke(self)
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > > lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 110, in
> > > invoke
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> > > fix_call(context.object, context.global_conf, **context.local_conf)
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > > lib/python2.4/site-packages/paste/deploy/util/fixtypeerror.py", line
> > > 57, in fix_call
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] val =
> > > callable(*args, **kw)
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > > lib/python2.4/site-packages/fedoracommunity/config/middleware.py",
> > > line 26, in make_app
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]
> > > full_stack=full_stack,
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > > lib/python2.4/site-packages/tg/configuration.py", line 604, in
> > > make_base_app
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] app =
> > > self.add_tm_middleware(app)
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > > lib/python2.4/site-packages/tg/configuration.py", line 531, in
> > > add_tm_middleware
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] from
> > > repoze.tm import make_tm
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > > lib/python2.4/site-packages/repoze/tm/__init__.py", line 2, in ?
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] import
> > > transaction
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > > lib/python2.4/site-packages/transaction/__init__.py", line 19, in ?
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] from
> > > transaction._transaction import Transaction
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > > lib/python2.4/site-packages/transaction/_transaction.py", line 625,
> > > in ?
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] class
> > > Savepoint:
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > > lib/python2.4/site-packages/zope/interface/advice.py", line 132, in
> > > advise
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] return
> > > callback(newClass)
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > > lib/python2.4/site-packages/zope/interface/declarations.py", line 484,
> > > in _implements_advice
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]
> > > classImplements(cls, *interfaces)
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > > lib/python2.4/site-packages/zope/interface/declarations.py", line 460,
> > > in classImplements
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] spec =
> > > implementedBy(cls)
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] File "/usr/
> > > lib/python2.4/site-packages/zope/interface/declarations.py", line 300,
> > > in implementedByFallback
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] spec =
> > > cls.__dict__.get('__implemented__')
> > > [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] RuntimeError:
> > > class.__dict__ not accessible in restricted mode
You must
Sign in before you can post messages.
You do not have the permission required to post.