webvirtmgr
webvirtmgr copied to clipboard
gunicorn 19 compatibility
I recently updated to Django 1.7 / gunicorn 19.1.1 and webvirtmgr no longer starts with manage.py. Gunicorn emits an error about the command being depreciated and the server halts.
$ /usr/bin/env python2 /srv/webvirtmgr/manage.py run_gunicorn -c /srv/webvirtmgr/conf/gunicorn.conf.py
WARNING:root:No local_settings file found.
!!!
!!! WARNING: This command is deprecated.
!!!
!!! You should now run your application with the WSGI interface
!!! installed with your project. Ex.:
!!!
!!! gunicorn myproject.wsgi:application
!!!
!!! See https://docs.djangoproject.com/en/1.5/howto/deployment/wsgi/gunicorn/
!!! for more info.
!!!
Traceback (most recent call last):
File "/srv/webvirtmgr/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
output = self.handle(*args, **options)
File "/usr/lib/python2.7/site-packages/gunicorn/management/commands/run_gunicorn.py", line 113, in handle
DjangoApplicationCommand(options, admin_media_path).run()
File "/usr/lib/python2.7/site-packages/gunicorn/app/base.py", line 185, in run
super(Application, self).run()
File "/usr/lib/python2.7/site-packages/gunicorn/app/base.py", line 71, in run
Arbiter(self).run()
File "/usr/lib/python2.7/site-packages/gunicorn/arbiter.py", line 169, in run
self.manage_workers()
File "/usr/lib/python2.7/site-packages/gunicorn/arbiter.py", line 477, in manage_workers
self.spawn_workers()
File "/usr/lib/python2.7/site-packages/gunicorn/arbiter.py", line 542, in spawn_workers
time.sleep(0.1 * random.random())
File "/usr/lib/python2.7/site-packages/gunicorn/arbiter.py", line 209, in handle_chld
self.reap_workers()
File "/usr/lib/python2.7/site-packages/gunicorn/arbiter.py", line 459, in reap_workers
raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
Is there an alternative startup method I can use with gunicorn 19?
Hi, I confirm this issue on archlinux
Bert
On archlinux I fixed it with:
sed -i -e '/^command=/d' -e '$a command=/usr/bin/gunicorn-python2 webvirtmgr.wsgi:application' /etc/supervisor.d/webvirtmgr.ini
systemctl restart supervisord
as root of course oh and also you need to have gunicorn-python2 installed