커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
mongoDB ServerSelectionTimeoutError
undefined주차
북마크
김*일
댓글
3
추천
0
조회수
15
조회수
15
답변 완료

ServerSelectionTimeoutError 가 발생하여

https://teamsparta.notion.site/3-93abb2b1163f4cda947279f621578e85 링크를 참조해서 certifi 패키지 받고 코드 작성 하였습니다.


그래도 error가 발생해서,

https://spartacodingclub.kr/community/fastqna/all/645214a6f4bec9d88cc8e443/mongoDB%20%EC%83%9D%EC%84%B1%EC%9D%B4%20%EC%95%88%EB%90%A9%EB%8B%88%EB%8B%A4%20%E3%85%9C%E3%85%9C

위 링크 참조해서 pymongo 4.3.3 버전받고 실행시켜 봤습니다.


그랬더니 OperationFailure error 가 발생하고 authentication 실패했다고 나옵니다


스파르타 즉문즉답





작성한 코드 및 에러 메세지

Traceback (most recent call last):

 File "/Users/kimkwang-il/Workspace/InnovationCamp/WebComprehensiveClass/pythonprac/dbprac.py", line 13, in <module>

  db.users.insert_one(doc)

 File "/Users/kimkwang-il/Workspace/InnovationCamp/WebComprehensiveClass/pythonprac/venv/lib/python3.8/site-packages/pymongo/collection.py", line 628, in insert_one

  self._insert_one(

 File "/Users/kimkwang-il/Workspace/InnovationCamp/WebComprehensiveClass/pythonprac/venv/lib/python3.8/site-packages/pymongo/collection.py", line 569, in _insert_one

  self.__database.client._retryable_write(acknowledged, _insert_command, session)

 File "/Users/kimkwang-il/Workspace/InnovationCamp/WebComprehensiveClass/pythonprac/venv/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1476, in _retryable_write

  return self._retry_with_session(retryable, func, s, None)

 File "/Users/kimkwang-il/Workspace/InnovationCamp/WebComprehensiveClass/pythonprac/venv/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1349, in _retry_with_session

  return self._retry_internal(retryable, func, session, bulk)

 File "/Users/kimkwang-il/Workspace/InnovationCamp/WebComprehensiveClass/pythonprac/venv/lib/python3.8/site-packages/pymongo/_csot.py", line 105, in csot_wrapper

  return func(self, *args, **kwargs)

 File "/Users/kimkwang-il/Workspace/InnovationCamp/WebComprehensiveClass/pythonprac/venv/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1381, in _retry_internal

  with self._get_socket(server, session) as sock_info:

 File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/contextlib.py", line 113, in __enter__

  return next(self.gen)

 File "/Users/kimkwang-il/Workspace/InnovationCamp/WebComprehensiveClass/pythonprac/venv/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1217, in _get_socket

  with server.get_socket(handler=err_handler) as sock_info:

 File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/contextlib.py", line 113, in __enter__

  return next(self.gen)

 File "/Users/kimkwang-il/Workspace/InnovationCamp/WebComprehensiveClass/pythonprac/venv/lib/python3.8/site-packages/pymongo/pool.py", line 1407, in get_socket

  sock_info = self._get_socket(handler=handler)

 File "/Users/kimkwang-il/Workspace/InnovationCamp/WebComprehensiveClass/pythonprac/venv/lib/python3.8/site-packages/pymongo/pool.py", line 1520, in _get_socket

  sock_info = self.connect(handler=handler)

 File "/Users/kimkwang-il/Workspace/InnovationCamp/WebComprehensiveClass/pythonprac/venv/lib/python3.8/site-packages/pymongo/pool.py", line 1378, in connect

  sock_info.authenticate()

 File "/Users/kimkwang-il/Workspace/InnovationCamp/WebComprehensiveClass/pythonprac/venv/lib/python3.8/site-packages/pymongo/pool.py", line 870, in authenticate

  auth.authenticate(creds, self)

 File "/Users/kimkwang-il/Workspace/InnovationCamp/WebComprehensiveClass/pythonprac/venv/lib/python3.8/site-packages/pymongo/auth.py", line 549, in authenticate

  auth_func(credentials, sock_info)

 File "/Users/kimkwang-il/Workspace/InnovationCamp/WebComprehensiveClass/pythonprac/venv/lib/python3.8/site-packages/pymongo/auth.py", line 475, in _authenticate_default

  return _authenticate_scram(credentials, sock_info, "SCRAM-SHA-1")

 File "/Users/kimkwang-il/Workspace/InnovationCamp/WebComprehensiveClass/pythonprac/venv/lib/python3.8/site-packages/pymongo/auth.py", line 241, in _authenticate_scram

  res = sock_info.command(source, cmd)

 File "/Users/kimkwang-il/Workspace/InnovationCamp/WebComprehensiveClass/pythonprac/venv/lib/python3.8/site-packages/pymongo/pool.py", line 767, in command

  return command(

 File "/Users/kimkwang-il/Workspace/InnovationCamp/WebComprehensiveClass/pythonprac/venv/lib/python3.8/site-packages/pymongo/network.py", line 166, in command

  helpers._check_command_response(

 File "/Users/kimkwang-il/Workspace/InnovationCamp/WebComprehensiveClass/pythonprac/venv/lib/python3.8/site-packages/pymongo/helpers.py", line 181, in _check_command_response

  raise OperationFailure(errmsg, code, response, max_wire_version)

pymongo.errors.OperationFailure: bad auth : authentication failed, full error: {'ok': 0, 'errmsg': 'bad auth : authentication failed', 'code': 8000, 'codeName': 'AtlasError'}

취소
 공유
취소
댓글 0
댓글 알림
나의얼굴