Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erro em consulta básica - Max retries exceeded with url #66

Closed
patrickacioli opened this issue Jun 17, 2019 · 1 comment
Closed

Erro em consulta básica - Max retries exceeded with url #66

patrickacioli opened this issue Jun 17, 2019 · 1 comment

Comments

@patrickacioli
Copy link

Pessoal,

Estou tentando realizar a implementação do pynfe, preparei o ambiente e tentei rodar o sample de exemplo na documentação, porém é retornado um error. Segue o traceback.

Traceback (most recent call last):
  File "/home/acioli/.local/lib/python3.6/site-packages/urllib3/connection.py", line 160, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/home/acioli/.local/lib/python3.6/site-packages/urllib3/util/connection.py", line 57, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/acioli/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 603, in urlopen
    chunked=chunked)
  File "/home/acioli/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 344, in _make_request
    self._validate_conn(conn)
  File "/home/acioli/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 843, in _validate_conn
    conn.connect()
  File "/home/acioli/.local/lib/python3.6/site-packages/urllib3/connection.py", line 316, in connect
    conn = self._new_conn()
  File "/home/acioli/.local/lib/python3.6/site-packages/urllib3/connection.py", line 169, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f030c8bfc88>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/acioli/.local/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/home/acioli/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 641, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/home/acioli/.local/lib/python3.6/site-packages/urllib3/util/retry.py", line 399, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='homologacao.nfe.sefaz.mt.gov.br', port=443): Max retries exceeded with url: /nfews/v2/services/NfeStatusServico4?wsdl (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f030c8bfc88>: Failed to establish a new connection: [Errno -2] Name or service not known',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "teste.py", line 9, in <module>
    xml = con.status_servico('nfe')
  File "/home/acioli/.local/lib/python3.6/site-packages/pynfe/processamento/comunicacao.py", line 266, in status_servico
    return self._post(url, xml)
  File "/home/acioli/.local/lib/python3.6/site-packages/pynfe/processamento/comunicacao.py", line 436, in _post
    raise e
  File "/home/acioli/.local/lib/python3.6/site-packages/pynfe/processamento/comunicacao.py", line 432, in _post
    result = requests.post(url, xml, headers=self._post_header(), cert=chave_cert, verify=False)
  File "/home/acioli/.local/lib/python3.6/site-packages/requests/api.py", line 116, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/home/acioli/.local/lib/python3.6/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/acioli/.local/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/acioli/.local/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/home/acioli/.local/lib/python3.6/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='homologacao.nfe.sefaz.mt.gov.br', port=443): Max retries exceeded with url: /nfews/v2/services/NfeStatusServico4?wsdl (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f030c8bfc88>: Failed to establish a new connection: [Errno -2] Name or service not known',))

Percebi que há um relato parecido com esse erro no google groups.

juniortada added a commit that referenced this issue Jun 17, 2019
@juniortada
Copy link
Member

Corrigido Patrick, obrigado pela contribuição!

thiagosm added a commit to thiagosm/PyNFe that referenced this issue Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants