[Errno 11001] getaddrinfo failed

win情况下,多个程序同时进行运行,但是超过一定运行数量就会报这个错误

Traceback (most recent call last):
  File "D:\installAll\python\Python310\lib\site-packages\urllib3\connection.py", line 174, in _new_conn
    conn = connection.create_connection(
  File "D:\installAll\python\Python310\lib\site-packages\urllib3\util\connection.py", line 72, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "D:\installAll\python\Python310\lib\socket.py", line 955, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed

完整报错内容:

Traceback (most recent call last):
  File "D:\installAll\python\Python310\lib\site-packages\urllib3\connection.py", line 174, in _new_conn
    conn = connection.create_connection(
  File "D:\installAll\python\Python310\lib\site-packages\urllib3\util\connection.py", line 72, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "D:\installAll\python\Python310\lib\socket.py", line 955, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\installAll\python\Python310\lib\site-packages\urllib3\connectionpool.py", line 700, in urlopen
    self._prepare_proxy(conn)
  File "D:\installAll\python\Python310\lib\site-packages\urllib3\connectionpool.py", line 994, in _prepare_proxy
    conn.connect()
  File "D:\installAll\python\Python310\lib\site-packages\urllib3\connection.py", line 358, in connect
    self.sock = conn = self._new_conn()
  File "D:\installAll\python\Python310\lib\site-packages\urllib3\connection.py", line 186, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x000001C31B601B40>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\installAll\python\Python310\lib\site-packages\requests\adapters.py", line 440, in send
    resp = conn.urlopen(
  File "D:\installAll\python\Python310\lib\site-packages\urllib3\connectionpool.py", line 785, in urlopen
    retries = retries.increment(
  File "D:\installAll\python\Python310\lib\site-packages\urllib3\util\retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.XXXXXX.com', port=443): Max retries exceeded with url: /toc/fml/04/03 (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001C31B601B40>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\work\XXXX\runXXXX\runArticleList.py", line 129, in <module>
    run()
  File "E:\work\XXXX\runXXXX\runArticleList.py", line 126, in run
    th_crawl(volume_info)
  File "E:\work\XXXXX\runXXXX\runArticleList.py", line 104, in th_crawl
    result_html = result_obj.result()
  File "D:\installAll\python\Python310\lib\concurrent\futures\_base.py", line 439, in result
    return self.__get_result()
  File "D:\installAll\python\Python310\lib\concurrent\futures\_base.py", line 391, in __get_result
    raise self._exception
  File "D:\installAll\python\Python310\lib\concurrent\futures\thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "E:\work\XXXX\runXXXX\runArticleList.py", line 86, in get_issue_html
    issue_html = get_html(issue_url)
  File "D:\installAll\python\Python310\lib\site-packages\retrying.py", line 49, in wrapped_f
    return Retrying(*dargs, **dkw).call(f, *args, **kw)
  File "D:\installAll\python\Python310\lib\site-packages\retrying.py", line 212, in call
    raise attempt.get()
  File "D:\installAll\python\Python310\lib\site-packages\retrying.py", line 247, in get
    six.reraise(self.value[0], self.value[1], self.value[2])
  File "D:\installAll\python\Python310\lib\site-packages\six.py", line 719, in reraise
    raise value
  File "D:\installAll\python\Python310\lib\site-packages\retrying.py", line 200, in call
    attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
  File "E:\work\XXXX\runXXXX\getHtml.py", line 37, in get_html
    res = requests.get(url=url, headers=headers, proxies=proxies, timeout=20, verify=False, allow_redirects=True)
  File "D:\installAll\python\Python310\lib\site-packages\requests\api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "D:\installAll\python\Python310\lib\site-packages\requests\api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "D:\installAll\python\Python310\lib\site-packages\requests\sessions.py", line 529, in request
    resp = self.send(prep, **send_kwargs)
  File "D:\installAll\python\Python310\lib\site-packages\requests\sessions.py", line 645, in send
    r = adapter.send(request, **kwargs)
  File "D:\installAll\python\Python310\lib\site-packages\requests\adapters.py", line 513, in send
    raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.XXXX.com', port=443): Max retries exceeded with url: /toc/fml/04/03 (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001C31B601B40>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')))

img

基本上重启后就没有问题了,但是隔一段时间还会遇到。

有没有

img


知道怎们是什么问题导致的吗