【问题标题】:Virtual env: Connection in use error虚拟环境:使用中的连接错误
【发布时间】:2014-04-29 21:18:53
【问题描述】:

我正在处理 github 克隆文件夹,并创建了我的第一个分支。切换分支/关闭终端后,我回到我的项目目录根目录并照常运行:

  $ source venv/bin/activate
    (venv)$ foreman start
    14:13:42 web.1  | started with pid 5591
    14:13:42 web.1  | 2014-04-29 14:13:42 [5591] [INFO] Starting gunicorn 18.0
    14:13:42 web.1  | 2014-04-29 14:13:42 [5591] [ERROR] Connection in use: ('0.0.0.0', 5000)
    14:13:42 web.1  | 2014-04-29 14:13:42 [5591] [ERROR] Retrying in 1 second.
    14:13:43 web.1  | 2014-04-29 14:13:43 [5591] [ERROR] Connection in use: ('0.0.0.0', 5000)
    14:13:43 web.1  | 2014-04-29 14:13:43 [5591] [ERROR] Retrying in 1 second.
    14:13:44 web.1  | 2014-04-29 14:13:44 [5591] [ERROR] Connection in use: ('0.0.0.0', 5000)
    14:13:44 web.1  | 2014-04-29 14:13:44 [5591] [ERROR] Retrying in 1 second.
    14:13:45 web.1  | 2014-04-29 14:13:45 [5591] [ERROR] Connection in use: ('0.0.0.0', 5000)
    14:13:45 web.1  | 2014-04-29 14:13:45 [5591] [ERROR] Retrying in 1 second.
    14:13:46 web.1  | 2014-04-29 14:13:46 [5591] [ERROR] Connection in use: ('0.0.0.0', 5000)
    14:13:46 web.1  | 2014-04-29 14:13:46 [5591] [ERROR] Retrying in 1 second.
    14:13:47 web.1  | 2014-04-29 14:13:47 [5591] [ERROR] Can't connect to ('0.0.0.0', 5000)
    14:13:47 web.1  | exited with code 1
    14:13:47 system | sending SIGTERM to all processes
    SIGTERM received

我收到了这个错误,但我无法弄清楚问题是什么。跟分支有关系吗?

【问题讨论】:

    标签: git github virtualenv


    【解决方案1】:

    您仍然有一个 gunicorn 实例正在运行。 foreman 运行 gunicorn 的守护进程实例,因此如果您关闭终端,它仍将在后台运行。出于这个原因,在关闭终端之前,您应该始终按 Ctrl + C 领班。但是有一种方法可以杀死服务器。

    首先你可以通过$ ps ax|grep unicorn找到独角兽的id来杀死它,然后使用gunicorn实例的id$ kill <id>

    您也可以使用$ pkill gunicorn

    【讨论】:

      猜你喜欢
      • 2019-09-24
      • 2020-07-13
      • 2016-05-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-13
      • 1970-01-01
      • 2023-02-04
      相关资源
      最近更新 更多