3

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?

Dmitry Minkovsky
  • 557
  • 3
  • 9
  • 22

2 Answers2

5

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.

Dmitry Minkovsky
  • 557
  • 3
  • 9
  • 22
3

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

Alfishe
  • 130
  • 5
  • 1
    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 02 '13 at 06:51