Exception occurred processing WSGI script

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Exception occurred processing WSGI script

Ben Marinic
Hi 

I'm new to Python.  I have built a couple PyAMF websites a couple years ago, but that was with Django and I didn't have to touch too much Python.  

I'm a bit confused about something basic here:

startup.py
...
application = WSGIGateway({'echo': myController.echo})
...

controller.py
...
def echo(self,data):
   return data
...

This works fine.  But if I change the gateway/method name to:

startup.py
...
application = WSGIGateway({'echoTwo': myController.echoTwo})
...

controller.py
...
def echoTwo(self,data):
   return data

I get: 

[Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx] mod_wsgi (pid=20024): Exception occurred processing WSGI script '/var/www/services/startup.py'.
[Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx]] Traceback (most recent call last):
[Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx] File "/var/www/services/startup.py", line 15, in <module>
[Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx] application = WSGIGateway({'echoTwo': clientsControl.echoTwo})
[Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx] AttributeError: 'ClientsControl' object has no attribute 'echoTwo'

I'm not sure if this is something with my newbie Python code (sorry if it is!) or if I've integrated something incorrectly with PyAMF?

Thanks!

Ben Marinic
Combination Studios Ltd
t. +44 (0)7813 147 159





_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Exception occurred processing WSGI script

Rob Harvey
Did you restart apache after you made the change?

On Mon, Nov 30, 2009 at 1:13 PM, Ben Marinic <[hidden email]> wrote:

> Hi
> I'm new to Python.  I have built a couple PyAMF websites a couple years ago,
> but that was with Django and I didn't have to touch too much Python.
> I'm a bit confused about something basic here:
> startup.py
> ...
> application = WSGIGateway({'echo': myController.echo})
> ...
> controller.py
> ...
> def echo(self,data):
>    return data
> ...
> This works fine.  But if I change the gateway/method name to:
> startup.py
> ...
> application = WSGIGateway({'echoTwo': myController.echoTwo})
> ...
> controller.py
> ...
> def echoTwo(self,data):
>    return data
> I get:
> [Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx] mod_wsgi
> (pid=20024): Exception occurred processing WSGI script
> '/var/www/services/startup.py'.
> [Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx]] Traceback (most
> recent call last):
> [Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx] File
> "/var/www/services/startup.py", line 15, in <module>
> [Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx] application =
> WSGIGateway({'echoTwo': clientsControl.echoTwo})
> [Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx] AttributeError:
> 'ClientsControl' object has no attribute 'echoTwo'
> I'm not sure if this is something with my newbie Python code (sorry if it
> is!) or if I've integrated something incorrectly with PyAMF?
> Thanks!
> Ben Marinic
> Combination Studios Ltd
> e. [hidden email]
> t. +44 (0)7813 147 159
>
>
>
>
> _______________________________________________
> PyAMF users mailing list - [hidden email]
> http://lists.pyamf.org/mailman/listinfo/users
>
>
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Exception occurred processing WSGI script

Ben Marinic
Duh!   I thought I forgot something...  ;)  I've been in client side code so long I forget the basics. 

Thanks Rob.

Ben


On 30 Nov 2009, at 21:22, Rob Harvey wrote:

Did you restart apache after you made the change?

On Mon, Nov 30, 2009 at 1:13 PM, Ben Marinic <[hidden email]> wrote:
Hi
I'm new to Python.  I have built a couple PyAMF websites a couple years ago,
but that was with Django and I didn't have to touch too much Python.
I'm a bit confused about something basic here:
startup.py
...
application = WSGIGateway({'echo': myController.echo})
...
controller.py
...
def echo(self,data):
   return data
...
This works fine.  But if I change the gateway/method name to:
startup.py
...
application = WSGIGateway({'echoTwo': myController.echoTwo})
...
controller.py
...
def echoTwo(self,data):
   return data
I get:
[Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx] mod_wsgi
(pid=20024): Exception occurred processing WSGI script
'/var/www/services/startup.py'.
[Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx]] Traceback (most
recent call last):
[Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx] File
"/var/www/services/startup.py", line 15, in <module>
[Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx] application =
WSGIGateway({'echoTwo': clientsControl.echoTwo})
[Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx] AttributeError:
'ClientsControl' object has no attribute 'echoTwo'
I'm not sure if this is something with my newbie Python code (sorry if it
is!) or if I've integrated something incorrectly with PyAMF?
Thanks!
Ben Marinic
Combination Studios Ltd
e. [hidden email]
t. +44 (0)7813 147 159




_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users


_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users

Ben Marinic
Combination Studios Ltd
t. +44 (0)7813 147 159





_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Exception occurred processing WSGI script

Thijs Triemstra
In reply to this post by Rob Harvey
Hi Ben,

also make sure to enable debug mode and logging with something like:

import logging
logging.basicConfig(level=logging.DEBUG)

services = {'echo': myController.echoTwo}
application = WSGIGateway(services, logger=logging, debug=True)

the traceback you pasted refers to 'clientsControl', but you mentioned  
that your controller is called 'myController' which doesn't match so  
maybe there's a problem there (although I would assume you already saw  
that..).

hth,

Thijs

On 30 Nov 2009, at 21:22, Rob Harvey wrote:

> Did you restart apache after you made the change?
>
> On Mon, Nov 30, 2009 at 1:13 PM, Ben Marinic <[hidden email]
> > wrote:
>> Hi
>> I'm new to Python.  I have built a couple PyAMF websites a couple  
>> years ago,
>> but that was with Django and I didn't have to touch too much Python.
>> I'm a bit confused about something basic here:
>> startup.py
>> ...
>> application = WSGIGateway({'echo': myController.echo})
>> ...
>> controller.py
>> ...
>> def echo(self,data):
>>    return data
>> ...
>> This works fine.  But if I change the gateway/method name to:
>> startup.py
>> ...
>> application = WSGIGateway({'echoTwo': myController.echoTwo})
>> ...
>> controller.py
>> ...
>> def echoTwo(self,data):
>>    return data
>> I get:
>> [Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx] mod_wsgi
>> (pid=20024): Exception occurred processing WSGI script
>> '/var/www/services/startup.py'.
>> [Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx]] Traceback  
>> (most
>> recent call last):
>> [Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx] File
>> "/var/www/services/startup.py", line 15, in <module>
>> [Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx]  
>> application =
>> WSGIGateway({'echoTwo': clientsControl.echoTwo})
>> [Mon Nov 30 21:01:09 2009] [error] [client xx.xx.xx.xxx]  
>> AttributeError:
>> 'ClientsControl' object has no attribute 'echoTwo'
>> I'm not sure if this is something with my newbie Python code (sorry  
>> if it
>> is!) or if I've integrated something incorrectly with PyAMF?
>> Thanks!
>> Ben Marinic
>> Combination Studios Ltd
>> e. [hidden email]
>> t. +44 (0)7813 147 159
>>
>>
>>
>>
>> _______________________________________________
>> PyAMF users mailing list - [hidden email]
>> http://lists.pyamf.org/mailman/listinfo/users
>>
>>
> _______________________________________________
> PyAMF users mailing list - [hidden email]
> http://lists.pyamf.org/mailman/listinfo/users

_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users

PGP.sig (201 bytes) Download Attachment