[GH-ISSUE #443] gunicorn 19 compatibility #332

Open
opened 2026-02-27 16:38:54 +03:00 by kerem · 2 comments
Owner

Originally created by @normaldotcom on GitHub (Sep 30, 2014).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/443

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?

Originally created by @normaldotcom on GitHub (Sep 30, 2014). Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/443 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. ``` bash $ /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?
Author
Owner

@BertoX commented on GitHub (Oct 11, 2014):

Hi,
I confirm this issue on archlinux

Bert

<!-- gh-comment-id:58762805 --> @BertoX commented on GitHub (Oct 11, 2014): Hi, I confirm this issue on archlinux Bert
Author
Owner

@slaxor commented on GitHub (Oct 16, 2014):

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

<!-- gh-comment-id:59408838 --> @slaxor commented on GitHub (Oct 16, 2014): 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
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtmgr#332
No description provided.