Skip to content

Instantly share code, notes, and snippets.

@jackdesert
Last active July 10, 2018 16:12
Show Gist options
  • Save jackdesert/00c705894308c3e970c71b4aabcd83b8 to your computer and use it in GitHub Desktop.
Save jackdesert/00c705894308c3e970c71b4aabcd83b8 to your computer and use it in GitHub Desktop.
# This docuemtation
# https://uwsgi-docs.readthedocs.io/en/latest/Python.html#paste-support
#
# Gives this example
# uwsgi --paste config:/opt/tg2env/addressbook/development.ini --socket :3031 -H /opt/tg2env
# Running on my machine (paths adapted to Ubuntu 16.04)
$ uwsgi --paste config:/home/ubuntu/stethoscope/production.ini --socket :3031 -H /home/ubuntu/env
# Gives this error:
uwsgi --paste config:/home/ubuntu/stethoscope/production.ini --socket :3031 -H /home/ubuntu/env
uwsgi: unrecognized option '--paste'
getopt_long() error
# Viewing the uwsgi source code, the "paste" option is defined in https://github.com/unbit/uwsgi/blob/master/plugins/python/python_plugin.c
# Therefore invoking with python plugin
$ uwsgi --plugin python3 --paste config:/home/ubuntu/stethoscope/production.ini --socket :3031 -H /home/ubuntu/env
# Gives this output:
*** Starting uWSGI 2.0.15-debian (64bit) on [Tue Jul 10 08:04:33 2018] ***
compiled with version: 7.3.0 on 01 March 2018 10:02:30
os: Linux-4.15.0-1010-aws #10-Ubuntu SMP Thu May 24 08:41:34 UTC 2018
nodename: ip-172-31-6-94
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 1
current working directory: /home/ubuntu/stethoscope
detected binary path: /usr/bin/uwsgi-core
dropping root privileges as early as possible
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 1825
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 :3031 fd 3
dropping root privileges after socket binding
Python version: 3.6.5 (default, Apr 1 2018, 05:46:30) [GCC 7.3.0]
Set PythonHome to /home/ubuntu/env
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00007fadb6c3c580 (most recent call first):
Aborted (core dumped)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment