Linux

無法部署 uWSGI Python 腳本:掛載點 = 0

  • March 18, 2014

當我執行我的應用程序時,我收到以下錯誤:

*** Operational MODE: single process ***
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***

我用來執行它的命令是這樣的:

/usr/local/bin/uwsgi -L -w app:app --ini /etc/configuration/uwsgi/uwsgi.ini --uid deploy

我的uWSIG配置如下所示:

[uwsgi]
socket = 127.0.0.1:8001
master = true
processes = 1
pidfile = /tmp/app-uwsgi.pid
chdir = /etc/application

我的主管配置如下所示:

[unix_http_server]
file=/tmp/supervisor.sock   ; (the path to the socket file)

[supervisord]
logfile=/var/log/supervisord.log                  ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB                             ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10                                ; (num of main logfile rotation backups;default 10)
loglevel=info                                     ; (log level;default info; others: debug,warn,trace)
nodaemon=false                                    ; (start in foreground if true;default false)
minfds=1024                                       ; (min. avail startup file descriptors;default 1024)
minprocs=200                                      ; (min. avail process descriptors;default 200)
; user=supervisor_user                            ; Running as root is better than nothing

[supervisorctl]
serverurl=unix:///tmp/supervisor.sock             ; use a unix:// URL  for a unix socket

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[program:app]
command=/usr/local/bin/uwsgi -L -w app:app --ini /etc/configuration/uwsgi/uwsgi.ini --uid deploy
stdout_logfile=/var/log/uwsgi.log
redirect_stderr=true
stopsignal=INT
autorestart=true
priority=800

我哪裡錯了?

為了讓它工作,我需要在 uwsgi ini 中指定 virtualenv 位置,然後它工作得很好

引用自:https://serverfault.com/questions/535479