lyft / confidant

Confidant: your secret keeper. https://lyft.github.io/confidant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Manual installation fails: ImportError: No module named wsgi

russmac opened this issue · comments

For v1.1 following manual installation instructions exactly with no specific changes on Debian 8.x produces this error:

(venv)root@confidant:/srv/confidant# gunicorn wsgi:app --workers=2 -k gevent
[2016-09-03 01:58:30 +0000] [10080] [INFO] Starting gunicorn 19.3.0
[2016-09-03 01:58:30 +0000] [10080] [INFO] Listening at: http://127.0.0.1:8000 (10080)
[2016-09-03 01:58:30 +0000] [10080] [INFO] Using worker: gevent
[2016-09-03 01:58:30 +0000] [10085] [INFO] Booting worker with pid: 10085
[2016-09-03 01:58:30 +0000] [10085] [ERROR] Exception in worker process:
Traceback (most recent call last):
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 507, in spawn_worker
    worker.init_process()
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/workers/ggevent.py", line 192, in init_process
    super(GeventWorker, self).init_process()
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 118, in init_process
    self.wsgi = self.app.wsgi()
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
    return self.load_wsgiapp()
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/util.py", line 355, in import_app
    __import__(module)
ImportError: No module named wsgi
Traceback (most recent call last):
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 507, in spawn_worker
    worker.init_process()
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/workers/ggevent.py", line 192, in init_process
    super(GeventWorker, self).init_process()
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 118, in init_process
    self.wsgi = self.app.wsgi()
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
    return self.load_wsgiapp()
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/util.py", line 355, in import_app
    __import__(module)
ImportError: No module named wsgi
[2016-09-03 01:58:30 +0000] [10085] [INFO] Worker exiting (pid: 10085)
Traceback (most recent call last):
  File "/srv/confidant/venv/bin/gunicorn", line 11, in <module>
    sys.exit(run())
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
    WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 189, in run
    super(Application, self).run()
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 72, in run
    Arbiter(self).run()
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 174, in run
    self.manage_workers()
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 477, in manage_workers
    self.spawn_workers()
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 541, in spawn_workers
    time.sleep(0.1 * random.random())
  File "/srv/confidant/venv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 214, in handle_chld
    self.reap_workers()
  File "/srv/confidant/venv/local/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>

Ah. Sorry, I moved some stuff around to make pip installation of confidant work properly and missed updating some docs. Now you invoke gunicorn like this:

gunicorn confidant.wsgi:app -k gevent

Docs fixed in #98 and 21b73ca. I've built and published the fixes as well.

Let me know if this solves your problem and thank you for the bug report!

Thanks @ryan-lane this resolved the issue.