1

I'm setting up a Python app using nginx and uWSGI. My dependencies are in a virtualenv. If I activate the virtualenv manually, everything works by running this command:

uwsgi --ini uwsgi.ini

But if I try to run the same command with the virtualenv deactivated, I get this in the output (no specific permissions errors though):

*** no app loaded. going in full dynamic mode ***

Similarly, when Emperor loads the ini file, it cannot run the app. My understanding is that using the home option should activate the virtualenv, but it does not appear to be working. (The wsgi.py module that is loaded also activates the virtualenv, so I'm not even sure why I should need to do it before then...)

Here is my uwsgi.ini:

[uwsgi]
uid = 1000
socket = 127.0.0.1:8000
workers = 3
master = true
processes = 5
module = wsgi:application
chdir = /home/laststatement/app/laststatement
home = /home/laststatement/.virtualenvs/last
logto = /home/laststatement/log/uwsgi.log

Here is the uWSGI log:

machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 1
current working directory: /etc/uwsgi/apps-enabled
detected binary path: /usr/bin/uwsgi-core
uWSGI running as root, you can use --uid/--gid/--chroot options
setuid() to 1000
your processes number limit is 3750
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address 127.0.0.1:8000 fd 3
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 436752 bytes (426 KB) for 5 cores
*** Operational MODE: preforking ***
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!
no request plugin is loaded, you will not be able to manage requests.
you may need to install the package for your language of choice, or simply load it with --plugin.
!!!!!!!!!!! END OF WARNING !!!!!!!!!!
spawned uWSGI master process (pid: 834)
spawned uWSGI worker 1 (pid: 838, cores: 1)
spawned uWSGI worker 2 (pid: 839, cores: 1)
spawned uWSGI worker 3 (pid: 840, cores: 1)
spawned uWSGI worker 4 (pid: 841, cores: 1)
spawned uWSGI worker 5 (pid: 842, cores: 1)
-- unavailable modifier requested: 0 --
announcing my loyalty to the Emperor...
-- unavailable modifier requested: 0 --
announcing my loyalty to the Emperor...
handsofaten
  • 327
  • 3
  • 6

1 Answers1

0

You are clearly running 2 different uWSGI versions. One in the virtualenv with the python plugin embedded, and a system-wide one for which you do not have loaded the python plugin:

!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!! no request plugin is loaded, you will not be able to manage requests. you may need to install the package for your language of choice, or simply load it with --plugin. !!!!!!!!!!! END OF WARNING !!!!!!!!!!

just insstall the uwsgi python plugin and enable it with plugin = python

roberto
  • 1,812
  • 12
  • 8