【发布时间】:2020-02-11 19:28:53
【问题描述】:
我在使用Openshift 中的 gunicorn 版本 19.9.0 运行我的应用程序 [Docker Image] 时遇到了这个问题。我没有使用 nginx 设置 [secure_scheme_headers]:https://github.com/benoitc/gunicorn/issues/1766.
Gunicorn 配置
gunicorn --chdir /src/app wsgi:application --bind 0.0.0.0:8000 --workers 4 --timeout 180 -k gevent
错误
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base_async.py", line 66, in handle
six.reraise(*sys.exc_info())
File "/usr/local/lib/python3.7/site-packages/gunicorn/six.py", line 625, in reraise
raise value
File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base_async.py", line 49, in handle
req = six.next(parser)
File "/usr/local/lib/python3.7/site-packages/gunicorn/http/parser.py", line 41, in __next__
self.mesg = self.mesg_class(self.cfg, self.unreader, self.req_count)
File "/usr/local/lib/python3.7/site-packages/gunicorn/http/message.py", line 181, in __init__
super(Request, self).__init__(cfg, unreader)
File "/usr/local/lib/python3.7/site-packages/gunicorn/http/message.py", line 54, in __init__
unused = self.parse(self.unreader)
File "/usr/local/lib/python3.7/site-packages/gunicorn/http/message.py", line 230, in parse
self.headers = self.parse_headers(data[:idx])
File "/usr/local/lib/python3.7/site-packages/gunicorn/http/message.py", line 74, in parse_headers
remote_addr = self.unreader.sock.getpeername()
OSError: [Errno 107] Transport endpoint is not connected```
# Fix
I was able to fix the issue by shifting the older version of gunicorn==19.7.1
and gevent didn't work with the older version of the gunicorn.
https://github.com/benoitc/gunicorn/issues/1913
【问题讨论】:
-
这里没有足够的信息。您使用的是什么 gunicorn 配置?
-
使用单个命令运行没有太多配置
-
看起来像这个问题#1913。尚未修复。
-
@dirkgroten 当我使用 Docker Image 在 Opeshift 中运行应用程序时出现问题。上面是 Gunicorn 运行命令作为入口。
-
Gunicorn 使用 gunicorn==19.7.1 没有任何问题。根本原因gunicorn版本,去老版本后问题解决了。