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.

I am attempting to start uWSGI on Ubuntu 12.04.

Upon $ sudo service uwsgi start or # uwsgi --ini /usr/share/uwsgi/conf/default.ini --ini /etc/uwsgi/apps-enabled/file.ini, I receive the following error:

opendir(): No such file or directory [uwsgi.c line 471]

The first invokation logs this error to /var/log/uwsgi and the second outputs this error to stdout.

What's wrong?

share|improve this question
add comment

2 Answers 2

uwsgi works fine for Django apps even without installing python plugin.

mkdir -p /usr/lib/uwsgi/plugins

is a sufficient workaround for uwsgi startup code weird behavior.

The most confusing is that uwsgi starts perfectly if you specify configuration explicitly both in command line and daemon mode.

For example you have:

  • /etc/uwsgi/apps-available/uwsgi.ini
  • symlink to it from /etc/uwsgi/apps-enabled

and then make /etc/init.d/uwsgi start uwsgi.ini - no problem with start! /etc/init.d/uwsgi start - [Failed] without plugin directory existing

Hope that uwsgi developers will fix that or at least will log appropriate error message

share|improve this answer
    
This is the debian package, not "pure" uWSGI. There is nothing uWSGI can do to fix it. In addition to this the python plugin is required for running python-based applications. Very probably you installed uWSGI via pip (or simple sources) along the debian package. So you are simply faking the debian init.d script. The problem is that debian packages are old, broken and unmaintained in the current shape. Everyone should stay away from them. I say thanks to the guy that made this package, but after 2 years it is basically useless and give user wrong perceptions (and assumptions) about uWSGI. –  roberto Jun 2 '13 at 6:51
add comment

Try to strace the process:

# strace -f -o ~/uwsgi.trace uwsgi --ini /usr/share/uwsgi/conf/default.ini --ini /etc/uwsgi/apps-enabled/file.ini reveals that just before this process quits unsuccessfully, opening /usr/lib/uwsgi/plugins fails:

openat(AT_FDCWD, "/usr/lib/uwsgi/plugins", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

So, create the missing directory: # mkdir -p /usr/lib/uwsgi/plugins and then try starting uWSGI again.

That said, if you're missing the /usr/lib/uwsgi/plugins directory, your uWSGI install will most likely not be able to handle requests. To handle Python requests, for example, you'll want to # apt-get install uwsgi-plugin-python and then add plugins = python to your app configuration.

share|improve this answer
add comment

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.