之前:Service-A ===> Service-B
(在{em> https
上正常工作)
现在:Service-A ===> Service-B
(在 http
上)
我确保将service A
配置为使用 http 进行请求,但是出现以下错误:
[2019-09-02 02:15:11,579] ERROR in app: Exception on /api/users [POST]
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/view/__init__.py", line 243, in decorated_function
return make_request()
File "./app/view/__init__.py", line 222, in make_request
response = f(parsed_params)
....
REDACTED
....
File "./app/user.py", line 620, in create_user
headers=cls._USER_AGENT_HEADER
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 112, in post
return request('post', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 490, in send
raise ConnectionError(err, request=request)
ConnectionError: ('Connection aborted.', BadStatusLine("''",))
如果我将协议重新设置为 https ,则会收到Unknown SSLProtocol
错误,因此Service-B
肯定位于 http 上。
User-Agent
标头设置正确。我尝试将其修改为一个空的标头和一个web browser标头,但似乎没有任何影响。
错误似乎是间歇性发生的,并且错误的频率有所不同。
请求版本: 2.18.4