Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Within my nginx sites-available/default this is the relevant portion for my app:

    location /app/ {       
            include uwsgi_params;
            uwsgi_pass unix:///tmp/uwsgi.socket;
    }

My app.xml file within the uwsgi/sites-available/ folder:

<uwsgi>
    <socket>/tmp/uwsgi.socket</socket>
    <plugins>python</plugins>
    <chdir>/web/NetWeaveCustom</chdir>
    <module>index</module>
</uwsgi>

Finally my /web/NetWeaveCustom/index.py module is as follows:

import web

urls = (
    '/(.*)','index'
)

app = web.application(urls, globals()).wsgifunc()

class index:
    def GET(self,name):
        return name

Here is my uwsgi error log:

[pid: 15963|app: -1|req: -1/15] 192.168.1.98 () {42 vars in 686 bytes} [Sun Dec 30 18:51:37 2012] GET /app/ => generated 48 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0) [pid: 15963|app: -1|req: -1/16] 192.168.1.98 () {42 vars in 686 bytes} [Sun Dec 30 18:51:54 2012] GET /app/ => generated 48 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0) [pid: 15964|app: -1|req: -1/17] 192.168.1.98 () {42 vars in 686 bytes} [Sun Dec 30 18:51:55 2012] GET /app/ => generated 48 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0) [pid: 15963|app: -1|req: -1/18] 192.168.1.98 () {42 vars in 686 bytes} [Sun Dec 30 18:51:55 2012] GET /app/ => generated 48 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)

When I got to my server/app/ folder I get the following error:

uWSGI Error:
Python application not found.

There are no errors reported in the nginx error log.

The strange thing is that this was working quite well until I decided to restart the uwsgi service. As soon as I did this error happened.

Any suggestions as to what is going wrong here?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

uWSGI searches for the 'application' callable, while you are defining an 'app' one.

Use

<module>index:app</module>

or add

<callable>app</callable>
share|improve this answer
    
Thanks a billion. It worked like a charm. –  phileaton Dec 31 '12 at 13:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.