[uWSGI] Yet another thread about logging with uWSGI and Pyramid

John Burk jburk at pipelinefx.com
Sat Jul 9 03:52:45 CEST 2016


Been paying the rent with python for about 8 years, but new to uWSGI and
web dev't in general, so be kind please.  I'll promptly respond to "you
need to post x,y,z for us to help you", just let me know what you need.

I've inherited an app that was built on Pyramid, was only ever using pserve
and waitress, and never had a working production setup.

After some researching various WSGI options, I switched everything over to
uWSGI and nginx.  Everything's working for me both in development and
production, with the exception of logging in my development environment.
I'm not getting anything out of Pyramid, just the uWSGI stderr/out on the
console, and the usual in nginx's access.log, and nothing in nginx/error.log

CentOS-6.6

Starting up uswgi with:

../bin/uwsgi --ini-paste-logged ./development.ini --http :9090

​yields:

*** Starting uWSGI 2.0.13.1 (64bit) on [Fri Jul  8 17:59:10 2016] ***
compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-4) on 08 July 2016
17:37:58
os: Linux-3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015
nodename: VM-CentOS-72-x64
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory:
/home/jburk/dev/main/meteredLicensing/server/metered
detected binary path: /home/jburk/dev/main/meteredLicensing/server/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
your processes number limit is 4096
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 http bound on :9090 fd 3
uwsgi socket 0 bound to UNIX address /var/www/uwsgi/mls.sock fd 6
Python version: 2.7.5 (default, Nov 20 2015, 02:00:19)  [GCC 4.8.5 20150623
(Red Hat 4.8.5-4)]
*** Python threads support is disabled. You can enable it with
--enable-threads ***
Python main interpreter initialized at 0x1f3a880
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 145520 bytes (142 KB) for 1 cores
*** Operational MODE: single process ***
Loading paste environment:
config:/home/jburk/dev/main/meteredLicensing/server/metered/./development.ini
ImportError: No module named script.util.logging_config
WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x1f3a880 pid:
21967 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 21967)
spawned uWSGI worker 1 (pid: 21974, cores: 1)
spawned uWSGI http 1 (pid: 21975)

​the interesting error being ​"
ImportError: No module named script.util.logging_config
​".  Googling that shows that I should only have to install pastescript to
get this all working

(server) [jburk at VM-CentOS-72-x64 metered]$ pip install pastescript
Collecting pastescript
  Using cached PasteScript-2.0.2-py2.py3-none-any.whl
Collecting Paste>=1.3 (from pastescript)
  Using cached Paste-2.0.3-py2-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): six in
/home/jburk/dev/main/meteredLicensing/server/lib/python2.7/site-packages/six-1.10.0-py2.7.egg
(from pastescript)
Requirement already satisfied (use --upgrade to upgrade): PasteDeploy in
/home/jburk/dev/main/meteredLicensing/server/lib/python2.7/site-packages/PasteDeploy-1.5.2-py2.7.egg
(from pastescript)
Installing collected packages: Paste, pastescript
Successfully installed Paste-2.0.3 pastescript-2.0.2


​but as soon as I do, I get:

*** Operational MODE: single process ***
Loading paste environment:
config:/home/jburk/dev/main/meteredLicensing/server/metered/./development.ini
ImportError: No module named deploy


​installing 'deploy' seems to have no effect:


(server) [jburk at VM-CentOS-72-x64 metered]$ pip install deploy
Collecting deploy
  Downloading deploy-1.9.1.tar.gz
Building wheels for collected packages: deploy
  Running setup.py bdist_wheel for deploy ... done
  Stored in directory:
/home/jburk/.cache/pip/wheels/1a/3f/ba/03dba49461ef7b067914a6f2208d1fb3eba3121f50e3788258
Successfully built deploy
Installing collected packages: deploy
Successfully installed deploy-1.9.1

(server) [jburk at VM-CentOS-72-x64 metered]$ ../bin/uwsgi --ini-paste-logged
./development.ini --http :9090
[uWSGI] getting INI configuration from ./development.ini
*** Starting uWSGI 2.0.13.1 (64bit) on [Fri Jul  8 18:21:55 2016] ***
compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-4) on 08 July 2016
17:37:58
os: Linux-3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015
nodename: VM-CentOS-72-x64
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory:
/home/jburk/dev/main/meteredLicensing/server/metered
detected binary path: /home/jburk/dev/main/meteredLicensing/server/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
your processes number limit is 4096
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 http bound on :9090 fd 3
uwsgi socket 0 bound to UNIX address /var/www/uwsgi/mls.sock fd 6
Python version: 2.7.5 (default, Nov 20 2015, 02:00:19)  [GCC 4.8.5 20150623
(Red Hat 4.8.5-4)]
*** Python threads support is disabled. You can enable it with
--enable-threads ***
Python main interpreter initialized at 0x13de920
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 145520 bytes (142 KB) for 1 cores
*** Operational MODE: single process ***
Loading paste environment:
config:/home/jburk/dev/main/meteredLicensing/server/metered/./development.ini
ImportError: No module named deploy


​at this point my virtualenv is dead.  Uninstalling deploy, Paste, and
pastescript doesn't get me back to a working state, I keep getting "no
module named deploy", and have to to delete and re-make my virtualenv
(which only takes about 2 minutes, so it's not painful but it sure is
getting stale...)
​
​I've attached my development.ini, what else do you need to help me sort
this out?​

running CentOS-6.6

(server) [jburk at VM-CentOS-72-x64 metered]$ pip list
alembic (0.8.6)
bcrypt (3.1.0)
cffi (1.7.0)
colander (1.3.1)
docutils (0.12)
iso8601 (0.1.11)
Jinja2 (2.8)
Mako (1.0.4)
MarkupSafe (0.23)
marshmallow (2.9.0)
marshmallow-sqlalchemy (0.8.1)
metered (0.0, /home/jburk/dev/main/meteredLicensing/server/metered)
MySQL-python (1.2.5)
PasteDeploy (1.5.2)
pip (8.1.2)
pycparser (2.14)
Pygments (2.1.3)
PyJWT (1.4.0)
pyramid (1.7)
pyramid-debugtoolbar (3.0.2)
pyramid-jinja2 (2.6.2)
pyramid-mako (1.0.2)
pyramid-tm (0.12.1)
python-editor (1.0.1)
repoze.lru (0.6)
requests (2.10.0)
setuptools (24.0.2)
six (1.10.0)
SQLAlchemy (1.0.13)
transaction (1.6.1)
translationstring (1.3)
uWSGI (2.0.13.1)
venusian (1.0)
WebOb (1.6.1)
wheel (0.29.0)
zope.deprecation (4.1.2)
zope.interface (4.2.0)
zope.sqlalchemy (0.7.6)

​​


--

John Burk
jburk at pipelinefx.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.unbit.it/pipermail/uwsgi/attachments/20160708/76c86bdd/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: development.ini
Type: application/octet-stream
Size: 1820 bytes
Desc: not available
URL: <http://lists.unbit.it/pipermail/uwsgi/attachments/20160708/76c86bdd/attachment-0001.obj>


More information about the uWSGI mailing list