uwsgi emperor mode and pyramid

690 views
Skip to first unread message

doggy

unread,
May 29, 2012, 6:55:19 AM5/29/12
to pylons-discuss
Hello!
When i try to run my pyramid application with uwsgi in emperor mode,
in browser i have error:

uWSGI Error
Python application not found

When i run without --emperor all works good.


Here is detail trouble description:
in my virtualenv i do:

bin/easy_install pyramid
bin/easy_install uwsgi
bin/pcreate -t starter myproject
cd myproject/
../bin/python setup.py develop

in development.ini a add this lines
[uwsgi]
virtualenv = /sites-root/doggy/uwsgi/test/env
http-socket = 0.0.0.0:8080
master = true
processes = 4

when i run
../bin/uwsgi --ini-paste development.ini
all works good, in browser i see demo application

when i run
../bin/uwsgi --master --emperor development.ini
in browser i see "uWSGI Error Python application not found"


*** Starting uWSGI 1.2.3 (64bit) on [Tue May 29 14:43:20 2012] ***
compiled with version: 4.4.6 20110731 (Red Hat 4.4.6-3) on 29 May 2012
14:28:04
detected number of CPU cores: 4
current working directory: /mnt/iscsi/appro-3-20gb/sites-root/doggy/
uwsgi/test/env/myproject
detected binary path: /mnt/iscsi/appro-3-20gb/sites-root/doggy/uwsgi/
test/env/bin/uwsgi
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
*** starting uWSGI Emperor ***
Python version: 2.6.6 (r266:84292, Dec 7 2011, 20:48:22) [GCC 4.4.6
20110731 (Red Hat 4.4.6-3)]
*** Python threads support is disabled. You can enable it with --
enable-threads ***
Python main interpreter initialized at 0xb5bfe0
*** Operational MODE: no-workers ***
spawned uWSGI master process (pid: 22551)
*** has_emperor mode detected (fd: 5) ***
[uWSGI] getting INI configuration from development.ini
*** Starting uWSGI 1.2.3 (64bit) on [Tue May 29 14:43:21 2012] ***
compiled with version: 4.4.6 20110731 (Red Hat 4.4.6-3) on 29 May 2012
14:28:04
detected number of CPU cores: 4
current working directory: /mnt/iscsi/appro-3-20gb/sites-root/doggy/
uwsgi/test/env/myproject
detected binary path: /mnt/iscsi/appro-3-20gb/sites-root/doggy/uwsgi/
test/env/bin/uwsgi
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
uwsgi socket 0 bound to TCP address 0.0.0.0:8080 fd 3
Python version: 2.6.6 (r266:84292, Dec 7 2011, 20:48:22) [GCC 4.4.6
20110731 (Red Hat 4.4.6-3)]
Set PythonHome to /sites-root/doggy/uwsgi/test/env
*** Python threads support is disabled. You can enable it with --
enable-threads ***
Python main interpreter initialized at 0x21f29e0
your server socket listen backlog is limited to 100 connections
*** Operational MODE: preforking ***
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 22553)
spawned uWSGI worker 1 (pid: 22554, cores: 1)
spawned uWSGI worker 2 (pid: 22555, cores: 1)
spawned uWSGI worker 3 (pid: 22556, cores: 1)
spawned uWSGI worker 4 (pid: 22557, cores: 1)

Roberto De Ioris

unread,
May 29, 2012, 7:10:18 AM5/29/12
to pylons-...@googlegroups.com
> --

That is becasue --ini-paste is a shortcut you cannot use in the emperor
(it works only with plain config files, in your case it will use --ini
instead of --ini-paste).

Just add in your vassal config:

paste = config:%p

Internally it will be expanded as

paste = config:<absolute_project_path>/development.ini

(obviously you can use both forms)

--
Roberto De Ioris
http://unbit.it

doggy

unread,
Jun 1, 2012, 5:09:26 AM6/1/12
to pylons-...@googlegroups.com, rob...@unbit.it
Thank you, Roberto!

doggy

unread,
Jun 1, 2012, 6:38:39 AM6/1/12
to pylons-...@googlegroups.com, rob...@unbit.it
It's me again
I wrote a
paste = config:%p
in my ini file

When I run
an application it works fine

but when I run several applications
/sites-root/doggy/env/bin/uwsgi --uid doggy --gid doggy --emperor /sites-root/doggy/etc/*.ini
on the
ports are listed in the ini files, i see a same application(first in etc folder)

Roberto De Ioris

unread,
Jun 1, 2012, 6:55:50 AM6/1/12
to pylons-...@googlegroups.com
Be sure to quote the pattern after --emperor, otherwise your shell will
expand it.

doggy

unread,
Jun 1, 2012, 9:41:19 AM6/1/12
to pylons-...@googlegroups.com, rob...@unbit.it
Thank you!
Now I'm happy :)
Reply all
Reply to author
Forward
0 new messages