AndresVillan / pyafipws

Automatically exported from code.google.com/p/pyafipws
GNU General Public License v3.0
0 stars 0 forks source link

Error de conexión nro 104 #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. incluir pyrece en un proyecto de django version 1.1
2. generar un ticket de acceso con wsaa.py para un cuit determinado
3. invocar al método ultnro del módulo wsfe.py (pyrece 1.18)  

What is the expected output? What do you see instead?
La salida normal es un int con la información del último id de transacción.
(para el cuit especificado)
Se obtiene un error en socket [Errno 104] "Connection reset by peer"

What version of the product are you using? On what operating system?
Versión 1.18 (pyrece)
python 2.6.1

Please provide any additional information below.

incluyo el traceback de django con el código de error específico:

error(104, 'Connection reset by peer')
Traceback (most recent call last):
  File "/home/alan/proyectosdj/hexa662/rece/views.py", line 429, in
conexion_afip
    last_id = wsfe.ultnro(client, datos_autenticar[0], datos_autenticar[1],
CUIT)
  File "/home/alan/proyectosdj/hexa662/rece/wsfe.py", line 62, in ultnro
    'cuit' : cuit
  File "/home/alan/proyectosdj/hexa662/rece/soap.py", line 56, in <lambda>
    return lambda self=self,xml="", *args, **kwargs:
self.call(attr,xml,*args,**kwargs)
  File "/home/alan/proyectosdj/hexa662/rece/soap.py", line 76, in call
    self.xml_response = self.send(method, self.xml_request)
  File "/home/alan/proyectosdj/hexa662/rece/soap.py", line 113, in send
    response, content = self.http.request(location,"POST", body=xml,
headers=headers)
  File "/usr/lib/python2.6/site-packages/httplib2/__init__.py", line 1068,
in request
    (response, content) = self._request(conn, authority, uri, request_uri,
method, body, headers, redirections, cachekey)
  File "/usr/lib/python2.6/site-packages/httplib2/__init__.py", line 872,
in _request
    (response, content) = self._conn_request(conn, request_uri, method,
body, headers)
  File "/usr/lib/python2.6/site-packages/httplib2/__init__.py", line 841,
in _conn_request
    conn.request(method, request_uri, body, headers)
  File "/usr/lib/python2.6/httplib.py", line 874, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.6/httplib.py", line 911, in _send_request
    self.endheaders()
  File "/usr/lib/python2.6/httplib.py", line 868, in endheaders
    self._send_output()
  File "/usr/lib/python2.6/httplib.py", line 740, in _send_output
    self.send(msg)
  File "/usr/lib/python2.6/httplib.py", line 699, in send
    self.connect()
  File "/usr/lib/python2.6/site-packages/httplib2/__init__.py", line 757,
in connect
    self.sock =_ssl_wrap_socket(sock, self.key_file, self.cert_file)
  File "/usr/lib/python2.6/ssl.py", line 350, in wrap_socket
    suppress_ragged_eofs=suppress_ragged_eofs)
  File "/usr/lib/python2.6/ssl.py", line 118, in __init__
    self.do_handshake()
  File "/usr/lib/python2.6/ssl.py", line 293, in do_handshake
    self._sslobj.do_handshake()
error: [Errno 104] Connection reset by peer

Nota: intenté demorar el proceso de conexión según se recomienda en un
artículo de stackoverflow para el error nro 104 en python sin éxito. Para
detener el script utilicé "time.sleep(1)" en la instrucción anterior a
"...results = client.FEUltNroRequest(..."

Original issue reported on code.google.com by hexa...@gmail.com on 14 Mar 2010 at 5:40

Attachments:

GoogleCodeExporter commented 9 years ago
El error 104 de socket se informó a AFIP (webservices@afip.gov.ar). Horas 
después de
informarlo no se ha vuelto a generar la excepción en python. El módulo wsfe 
devuelve
el valor esperado normalmente.

Original comment by hexa...@gmail.com on 15 Mar 2010 at 6:25

GoogleCodeExporter commented 9 years ago
Gracias por reportarlo, seguramente era un problema temporario de los 
servidores de 
AFIP.
En estos casos, habría que probarlo por linea de comandos para descartar que 
no sea un 
problema de django.
Si vuelve a ocurrir, por favor habría que abrir nuevamente este ticket.

Original comment by reingart@gmail.com on 20 Mar 2010 at 11:06