커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
서버에 데이터를 입력하는데 계속 오류가 나네여
undefined주차
북마크
장*표
댓글
4
추천
0
조회수
10
조회수
10
답변 완료
from pymongo import MongoClient
client = MongoClient('mongodb+srv://test:1234@cluster0.zebecxh.mongodb.net/Cluster0?retryWrites=true&w=majority')
db = client.dbsparta

doc ={
    'name':'bob',
    'age':27
}

db.users.insert_one(doc)

Traceback (most recent call last):

 File "D:/개인 폴더/내일배움/test/dbprac.py", line 10, in <module>

  db.users.insert_one(doc)

 File "D:\개인 폴더\내일배움\test\venv\lib\site-packages\pymongo\collection.py", line 621, in insert_one

  self._insert_one(

 File "D:\개인 폴더\내일배움\test\venv\lib\site-packages\pymongo\collection.py", line 562, in _insert_one

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

 File "D:\개인 폴더\내일배움\test\venv\lib\site-packages\pymongo\mongo_client.py", line 1447, in _retryable_write

  with self._tmp_session(session) as s:

 File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 113, in __enter__

  return next(self.gen)

 File "D:\개인 폴더\내일배움\test\venv\lib\site-packages\pymongo\mongo_client.py", line 1729, in _tmp_session

  s = self._ensure_session(session)

 File "D:\개인 폴더\내일배움\test\venv\lib\site-packages\pymongo\mongo_client.py", line 1712, in _ensure_session

  return self.__start_session(True, causal_consistency=False)

 File "D:\개인 폴더\내일배움\test\venv\lib\site-packages\pymongo\mongo_client.py", line 1657, in __start_session

  self._topology._check_implicit_session_support()

 File "D:\개인 폴더\내일배움\test\venv\lib\site-packages\pymongo\topology.py", line 538, in _check_implicit_session_support

  self._check_session_support()

 File "D:\개인 폴더\내일배움\test\venv\lib\site-packages\pymongo\topology.py", line 554, in _check_session_support

  self._select_servers_loop(

 File "D:\개인 폴더\내일배움\test\venv\lib\site-packages\pymongo\topology.py", line 238, in _select_servers_loop


  raise ServerSelectionTimeoutError(

pymongo.errors.ServerSelectionTimeoutError: ac-q0zpiby-shard-00-02.zebecxh.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1124),ac-q0zpiby-shard-00-01.zebecxh.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1124),ac-q0zpiby-shard-00-00.zebecxh.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1124), Timeout: 30s, Topology Description: <TopologyDescription id: 6309c38a0e4df3c3c0214d95, topology_type: ReplicaSetNoPrimary, servers: [<ServerDescription ('ac-q0zpiby-shard-00-00.zebecxh.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('ac-q0zpiby-shard-00-00.zebecxh.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1124)')>, <ServerDescription ('ac-q0zpiby-shard-00-01.zebecxh.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('ac-q0zpiby-shard-00-01.zebecxh.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1124)')>, <ServerDescription ('ac-q0zpiby-shard-00-02.zebecxh.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('ac-q0zpiby-shard-00-02.zebecxh.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1124)')>]>


Process finished with exit code 1


서버에 타임아웃이 일어난거 같은데 이유를 모르겠네여ㅠㅠ


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