Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to run server: mongo ServerSelectionTimeoutError #3

Open
slobLX opened this issue May 17, 2019 · 1 comment
Open

failed to run server: mongo ServerSelectionTimeoutError #3

slobLX opened this issue May 17, 2019 · 1 comment

Comments

@slobLX
Copy link

slobLX commented May 17, 2019

when I use 'python manage.py runserver 192.168.110.8:8000', the error occurs:

File "/home1/liuxin/task1/Chatbot_CN/Chatbot_KG/util/mongo_model.py", line 40, in find_MONGO_one
datas = collection.find_one({'judgementId':ids})
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/collection.py", line 1262, in find_one
for result in cursor.limit(-1):
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/cursor.py", line 1189, in next
if len(self.__data) or self._refresh():
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/cursor.py", line 1087, in _refresh
self.__session = self.__collection.database.client._ensure_session()
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1563, in _ensure_session
return self.__start_session(True, causal_consistency=False)
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1516, in __start_session
server_session = self._get_server_session()
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1549, in _get_server_session
return self._topology.get_server_session()
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/topology.py", line 427, in get_server_session
None)
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/topology.py", line 199, in _select_servers_loop
self._error_message(selector))
pymongo.errors.ServerSelectionTimeoutError: 10.0.0.8:27017: timed out

@charlesXu86
Copy link
Owner

when I use 'python manage.py runserver 192.168.110.8:8000', the error occurs:

File "/home1/liuxin/task1/Chatbot_CN/Chatbot_KG/util/mongo_model.py", line 40, in find_MONGO_one
datas = collection.find_one({'judgementId':ids})
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/collection.py", line 1262, in find_one
for result in cursor.limit(-1):
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/cursor.py", line 1189, in next
if len(self.__data) or self._refresh():
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/cursor.py", line 1087, in _refresh
self.__session = self.__collection.database.client._ensure_session()
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1563, in _ensure_session
return self.__start_session(True, causal_consistency=False)
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1516, in __start_session
server_session = self._get_server_session()
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1549, in _get_server_session
return self._topology.get_server_session()
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/topology.py", line 427, in get_server_session
None)
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/topology.py", line 199, in _select_servers_loop
self._error_message(selector))
pymongo.errors.ServerSelectionTimeoutError: 10.0.0.8:27017: timed out

这个是mongodb链接错误,你把mongo的url改一下,或者注释掉就可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants