zoukankan      html  css  js  c++  java
  • gunicorn启动报错gunicorn.errors.HaltServer

    启动gunicorn报错:

    # gunicorn -b :9008 -w 2 webserver:app
    2013-12-10 09:12:58 [29701] [INFO] Starting gunicorn 0.14.3
    2013-12-10 09:12:58 [29701] [INFO] Listening at: http://0.0.0.0:9008 (29701)
    2013-12-10 09:12:58 [29701] [INFO] Using worker: sync
    2013-12-10 09:12:58 [29704] [INFO] Booting worker with pid: 29704
    2013-12-10 09:12:58 [29705] [INFO] Booting worker with pid: 29705
    2013-12-10 09:12:58 [29704] [INFO] Worker exiting (pid: 29704)
    2013-12-10 09:12:58 [29705] [INFO] Worker exiting (pid: 29705)
    Traceback (most recent call last):
      File "/root/.virtualenvs/py268/bin/gunicorn", line 8, in <module>
        load_entry_point('gunicorn==0.14.3', 'console_scripts', 'gunicorn')()
      File "/root/.virtualenvs/py268/lib/python2.6/site-packages/gunicorn/app/wsgiapp.py", line 32, in run
        WSGIApplication("%prog [OPTIONS] APP_MODULE").run()
      File "/root/.virtualenvs/py268/lib/python2.6/site-packages/gunicorn/app/base.py", line 129, in run
        Arbiter(self).run()
      File "/root/.virtualenvs/py268/lib/python2.6/site-packages/gunicorn/arbiter.py", line 184, in run
        self.halt(reason=inst.reason, exit_status=inst.exit_status)
      File "/root/.virtualenvs/py268/lib/python2.6/site-packages/gunicorn/arbiter.py", line 279, in halt
        self.stop()
      File "/root/.virtualenvs/py268/lib/python2.6/site-packages/gunicorn/arbiter.py", line 327, in stop
        self.reap_workers()
      File "/root/.virtualenvs/py268/lib/python2.6/site-packages/gunicorn/arbiter.py", line 413, in reap_workers
        raise HaltServer(reason, self.WORKER_BOOT_ERROR)
    gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
    

    解决:

    使用debug模式查看更多信息--log-level=debug

    gunicorn -b :9008 -w 2 webserver:app  --log-level=debug

     发现是import error

    添加pythonpath以及import的资源目录添加__init__.py文件使之成为一个package即可

    export PYTHONPATH=/home/..
    
  • 相关阅读:
    NOP源码分析六--实体、数据的分层与处理。
    NOP源码分析七---继续
    NOP源码分析 八---set的存储
    Nop 源码分析四 任务系统
    NOP源码分析五,文件位置等详细内容,感冒真难受,嗓子痒又疼。。
    1
    mobx
    ts随笔
    13.vue-vuex
    13.vue-axios
  • 原文地址:https://www.cnblogs.com/sudawei/p/3467919.html
Copyright © 2011-2022 走看看