작성
·
517
·
수정됨
0
안녕하세요 강사님 run_test_hello_channel.py을 실행했더니 생기는 오류에 대해서 질문드립니다.
실행을 했을시 True가 나올때도 있지만
Traceback (most recent call last):
File "D:\23_project\django_channels\venv\lib\site-packages\redis\asyncio\connection.py", line 709, in connect
await self._connect()
File "D:\23_project\django_channels\venv\lib\site-packages\redis\asyncio\connection.py", line 744, in _connect
reader, writer = await asyncio.open_connection(
File "C:\Users\honge\AppData\Local\Programs\Python\Python310\lib\asyncio\streams.py", line 47, in open_connection
transport, _ = await loop.create_connection(
File "C:\Users\honge\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1016, in create_connection
infos = await self._ensure_resolved(
File "C:\Users\honge\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1395, in _ensure_resolved
return await loop.getaddrinfo(host, port, family=family, type=type,
File "C:\Users\honge\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 855, in getaddrinfo
return await self.run_in_executor(
File "C:\Users\honge\AppData\Local\Programs\Python\Python310\lib\concurrent\futures\thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "C:\Users\honge\AppData\Local\Programs\Python\Python310\lib\socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11002] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\23_project\django_channels\run_test_hello_channel.py", line 23, in <module>
asyncio.run(main())
File "C:\Users\honge\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\honge\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 641, in run_until_complete
return future.result()
File "D:\23_project\django_channels\run_test_hello_channel.py", line 16, in main
await channel_layer.send('hello', message_dict)
File "D:\23_project\django_channels\venv\lib\site-packages\channels_redis\core.py", line 218, in send
await connection.zremrangebyscore(
File "D:\23_project\django_channels\venv\lib\site-packages\redis\asyncio\client.py", line 484, in execute_command
conn = self.connection or await pool.get_connection(command_name, **options)
File "D:\23_project\django_channels\venv\lib\site-packages\redis\asyncio\connection.py", line 1525, in get_connection
await connection.connect()
File "D:\23_project\django_channels\venv\lib\site-packages\redis\asyncio\connection.py", line 715, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 11002 connecting to redis-10519.c294.ap-northeast-1-2.ec2.cloud.redislabs.com:10519. 11002.
위와 같은 에러가 발생할 때도 있습니다.
혹시 지역이 일본으로 해놓아 거리때문에 생기는 이슈또는 너무 많은 요청에 의한 이슈일까요??
답변 1
1
안녕하세요.
에러 메세지 중간에 보면, 아래 예외가 먼저 발생한 듯 보입니다.
socket.gaierror: [Errno 11002] getaddrinfo failed
이는 dns lookup에 실패했을 때 발생하는 데요. 제가 슬라이드에 알려드린 대로, 쓰시는 컴퓨터의 dns 서버 설정에 1.1.1.1 을 추가해보시겠어요?
화이팅입니다. :-)