复现方法:
lean init
pip install -r requirements.txt
lean up
然后在浏览器中访问 /todos 就会提示 500 Internal Server Error。Traceback 如下:
[2017-10-25 20:39:49,413] ERROR in app: Exception on /todos [GET]
Traceback (most recent call last):
File "/path/to/your/project/venv/lib/python3.6/site-packages/flask_sockets.py", line 40, in __call__
handler, values = adapter.match()
File "/path/to/your/project/venv/lib/python3.6/site-packages/werkzeug/routing.py", line 1573, in match
raise NotFound()
werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/path/to/your/project/venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 595, in urlopen
self._prepare_proxy(conn)
File "/path/to/your/project/venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 816, in _prepare_proxy
conn.connect()
File "/path/to/your/project/venv/lib/python3.6/site-packages/urllib3/connection.py", line 326, in connect
ssl_context=context)
File "/path/to/your/project/venv/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 329, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/path/to/your/project/venv/lib/python3.6/site-packages/gevent/_ssl3.py", line 60, in wrap_socket
_session=session)
File "/path/to/your/project/venv/lib/python3.6/site-packages/gevent/_ssl3.py", line 232, in __init__
raise x
File "/path/to/your/project/venv/lib/python3.6/site-packages/gevent/_ssl3.py", line 228, in __init__
self.do_handshake()
File "/path/to/your/project/venv/lib/python3.6/site-packages/gevent/_ssl3.py", line 545, in do_handshake
self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:749)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/path/to/your/project/venv/lib/python3.6/site-packages/requests/adapters.py", line 440, in send
timeout=timeout
File "/path/to/your/project/venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "/path/to/your/project/venv/lib/python3.6/site-packages/urllib3/util/retry.py", line 388, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.leancloud.cn', port=443): Max retries exceeded with url: /1.1/classes/Todo?where=%7B%7D&order=-createdAt (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:749)'),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/path/to/your/project/venv/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/path/to/your/project/venv/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/path/to/your/project/venv/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/path/to/your/project/venv/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/path/to/your/project/venv/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/path/to/your/project/venv/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/path/to/your/project/views/todos.py", line 22, in show
todos = Query(Todo).descending('createdAt').find()
File "/path/to/your/project/venv/lib/python3.6/site-packages/leancloud/query.py", line 222, in find
content = self._do_request(self.dump())
File "/path/to/your/project/venv/lib/python3.6/site-packages/leancloud/query.py", line 182, in _do_request
return client.get('/classes/{0}'.format(self._query_class._class_name), params).json()
File "/path/to/your/project/venv/lib/python3.6/site-packages/leancloud/client.py", line 96, in new_func
return func(headers=headers, *args, **kwargs)
File "/path/to/your/project/venv/lib/python3.6/site-packages/leancloud/client.py", line 153, in new_func
response = func(*args, **kwargs)
File "/path/to/your/project/venv/lib/python3.6/site-packages/leancloud/client.py", line 203, in get
hooks=request_hooks,
File "/path/to/your/project/venv/lib/python3.6/site-packages/requests/sessions.py", line 521, in get
return self.request('GET', url, **kwargs)
File "/path/to/your/project/venv/lib/python3.6/site-packages/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/path/to/your/project/venv/lib/python3.6/site-packages/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/path/to/your/project/venv/lib/python3.6/site-packages/requests/adapters.py", line 506, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.leancloud.cn', port=443): Max retries exceeded with url: /1.1/classes/Todo?where=%7B%7D&order=-createdAt (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:749)'),))