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

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='mdfe-homologacao.svrs.rs.gov.br', port=443) #288

Open
crsilveira opened this issue Dec 2, 2020 · 2 comments

Comments

@crsilveira
Copy link
Contributor

Estou tentando enviar a MDFe , e tenho o erro acima, alguém sabe como resolver, ou pode me dar um caminho ... ?

raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='mdfe-homologacao.svrs.rs.gov.br', port=443): Max retries exceeded with url: /ws/MDFeRecepcao/MDFeRecepcao.asmx (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f49c397d790>: Failed to establish a new connection: [Errno -2] Nome ou serviço desconhecido'))

@danimaribeiro
Copy link
Owner

De tempos em tempos acontece esse erro de DNS com os servidore do RS, depois de um tempo volta ao normal.
Pra resolver rapidamente tu pode trocar para o DNS do google 8.8.8.8, ou fazer um ping para o endereço:
ping mdfe-homologacao.svrs.rs.gov.br, pegar o IP retornado e colocar no seu arquivo /etc/hosts

@crsilveira
Copy link
Contributor Author

crsilveira commented Dec 3, 2020

Q estranho não mudei nada e hoje , voltou o erro :
Situação: 242
Mensagem: Rejeição: Elemento mdfeCabecMsg inexistente no SOAP HeaderChave NFe

Pra isso tinha feito - a linha 247 e a 251

def _send_zeep(first_operation, client, xml_send):
240 import pudb;pu.db
241 parser = etree.XMLParser(strip_cdata=False)
242 xml = etree.fromstring(xml_send, parser=parser)
243 namespaceMDFe = xml.find(".//{http://www.portalfiscal.inf.br/mdfe}MDFe")
244 if namespaceMDFe is not None:
245 ¦ namespaceMDFe.set("xmlns", "http://www.portalfiscal.inf.br/mdfe")
246 requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
247 xml_um = etree.fromstring(
248 ¦ '<mdfeCabecMsg xmlns="http://www.portalfiscal.inf.br/mdfe/wsdl/MDFeConsulta"><cUF>SP</cUF><versaoDados>3.00</versaoDados></mdfeCabecMsg>'
249 )
250 with client.settings(raw_response=True):
251 ¦ response = client.service[first_operation](xml, _soapheaders=[xml_um])
252 ¦ response, obj = sanitize_response(response.text)
253 ¦ return {
254 ¦ ¦ "sent_xml": xml_send,
255 ¦ ¦ "received_xml": response,
256 ¦ ¦ "object": obj.Body.getchildren()[0],
257 ¦ }

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