/Users/i/Desktop/sparta/pythonPrac/venv/bin/python /Users/i/Desktop/sparta/pythonPrac/dbprac.py
Traceback (most recent call last):
File "/Users/i/Desktop/sparta/pythonPrac/dbprac.py", line 15, in <module>
db.users.insert_one(doc)
File "/Users/i/Desktop/sparta/pythonPrac/venv/lib/python3.8/site-packages/pymongo/collection.py", line 621, in insert_one
self._insert_one(
File "/Users/i/Desktop/sparta/pythonPrac/venv/lib/python3.8/site-packages/pymongo/collection.py", line 562, in _insert_one
self.__database.client._retryable_write(acknowledged, _insert_command, session)
File "/Users/i/Desktop/sparta/pythonPrac/venv/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1475, in _retryable_write
with self._tmp_session(session) as s:
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/contextlib.py", line 113, in __enter__
return next(self.gen)
File "/Users/i/Desktop/sparta/pythonPrac/venv/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1757, in _tmp_session
s = self._ensure_session(session)
File "/Users/i/Desktop/sparta/pythonPrac/venv/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1740, in _ensure_session
return self.__start_session(True, causal_consistency=False)
File "/Users/i/Desktop/sparta/pythonPrac/venv/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1685, in __start_session
self._topology._check_implicit_session_support()
File "/Users/i/Desktop/sparta/pythonPrac/venv/lib/python3.8/site-packages/pymongo/topology.py", line 538, in _check_implicit_session_support
self._check_session_support()
File "/Users/i/Desktop/sparta/pythonPrac/venv/lib/python3.8/site-packages/pymongo/topology.py", line 554, in _check_session_support
self._select_servers_loop(
File "/Users/i/Desktop/sparta/pythonPrac/venv/lib/python3.8/site-packages/pymongo/topology.py", line 238, in _select_servers_loop
raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: ac-nccivgp-shard-00-01.joa3ijk.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108),ac-nccivgp-shard-00-02.joa3ijk.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108),ac-nccivgp-shard-00-00.joa3ijk.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108), Timeout: 30s, Topology Description: <TopologyDescription id: 6355f999b2b46e5cc4e70527, topology_type: ReplicaSetNoPrimary, servers: [<ServerDescription ('ac-nccivgp-shard-00-00.joa3ijk.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('ac-nccivgp-shard-00-00.joa3ijk.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')>, <ServerDescription ('ac-nccivgp-shard-00-01.joa3ijk.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('ac-nccivgp-shard-00-01.joa3ijk.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')>, <ServerDescription ('ac-nccivgp-shard-00-02.joa3ijk.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('ac-nccivgp-shard-00-02.joa3ijk.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')>]>
종료 코드 1(으)로 완료된 프로세스
사용된 시간 약 1시간 / 회피시간 2시간 / 심적강도 4
몽고 DB 접속관련
문제 : 접속에 문제가 생김
해결 1
계정 아이디 비밀번호를 잘못한지 알고 다시 설정함
하지만 아이디 비밀번호 재 설정이 어디있는지 몰라서 다시 찾아다님
해결 2
계정이 0.0.0.0/0 어디나 허용을 해결하려고 함
해결 3
3.4 version으로 하려고 함
해결 4
certify 패키지를 이용하고, 몽고클라이언트 코드 마지막에 ‘tlsCAFile=ca’ 를 추가해서 해결함
추가해서 해결하는 방법에 대한 서투름이 많았음
원인
인터넷 환경에 따라 보안 관련 추가 설정을 해주어야 해서 해당 문제가 발생하기 때문이다.
MongoClient('mongodb+srv://<id>:<pw>@cluster0.joa3ijk.mongodb.net/?retryWrites=true&w=majority', tlsCAFile=ca)
tlsCAFile=ca
뒤에 꼭 붙여주기
느낀점
QNA를 적극적으로 활용하자
'개발 > 문제해결' 카테고리의 다른 글
Result Maps collection does not contain value for [resultMap & resultMap error] (0) | 2023.03.23 |
---|---|
웹개발 error 유형 정리 (0) | 2023.02.19 |
톰캣 서블릿 코드 작성과 실행 [HttpURLConnection 405 에러] (0) | 2022.12.26 |
서버로부터 get이 안되는 경우 문제 발생 (0) | 2022.10.26 |
파이참 맥에서 코드부분에 클릭안되는 경우 (0) | 2022.10.17 |