That another server which is client to your app terminated connection for
some reason. That's most common cause.

ma 11. maalisk. 2019 klo 21.53 Alex Snyder <[email protected]>
kirjoitti:

> There's no browser involved. Just another server. If I manually post it
> works fine.
>
> On Monday, March 11, 2019 at 2:17:22 PM UTC-5, Jani Tiainen wrote:
>>
>> Hi.
>>
>> Usually error means that client (browser) terminated connection before
>> request was completely handled and returned to client.
>>
>>
>>
>>
>> ma 11. maalisk. 2019 klo 17.58 Alex Snyder <[email protected]>
>> kirjoitti:
>>
>>> Hello,
>>> I'm working on a webhook receiver and all was working fine the other
>>> day. Now I'm receiving connection reset by peer errors. The data being
>>> posted is getting received so and I can't figure out why it all of a sudden
>>> started giving errors.
>>>
>>> Could it be that connections are coming in too quickly? It didn't have a
>>> problem with it before.
>>>
>>> I'm getting the following:
>>> Exception happened during processing of request from ('redacted', 58812)
>>> Traceback (most recent call last):
>>>   File
>>> "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/socketserver.py", line
>>> 650, in process_request_thread
>>>     self.finish_request(request, client_address)
>>>   File
>>> "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/socketserver.py", line
>>> 360, in finish_request
>>>
>>>     self.RequestHandlerClass(request, client_address, self)
>>>   File
>>> "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/socketserver.py", line
>>> 720, in __init__
>>>     self.handle()
>>>   File
>>> "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/site-packages/django/core/servers/basehttp.py",
>>> line 171, in han
>>> dle
>>>     self.handle_one_request()
>>>   File
>>> "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/site-packages/django/core/servers/basehttp.py",
>>> line 179, in han
>>> dle_one_request
>>>     self.raw_requestline = self.rfile.readline(65537)
>>>   File "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/socket.py",
>>> line 589, in readinto
>>>     return self._sock.recv_into(b)
>>> ConnectionResetError: [Errno 54] Connection reset by peer
>>>
>>>
>>> My View
>>>
>>> @require_POST
>>> @csrf_exempt
>>> def computer_checkin(request):
>>>     if request.method == 'POST':
>>>         #ip = get_client_ip(request)
>>>         print(request)
>>>         #request_data = json.loads(request.body.decode("utf-8"))
>>>         #print(ip)
>>>         return HttpResponse(201)
>>>     else:
>>>         return HttpResponse(400)
>>>         # if ip in allowed_ip:
>>>         #     #print(request_data['webhook']['webhookEvent'])
>>>         #     return HttpResponse('Pong')
>>>         # else
>>>         #     return HttpResponseForbidden('Permissions denied')
>>>
>>>
>>> This is what the sending server gives for an error:
>>> Exception while trying to post event to
>>> http://redacted:8000/webhooks/ComputerCheckIn - I/O error on POST
>>> request for "http://redacted:8000/webhooks/ComputerCheckIn":Connect to
>>> redacted:8000 [/redacted] failed: connect timed out; nested exception is
>>> org.apache.http.conn.ConnectTimeoutException: Connect to redacted:8000
>>> [/redacted] failed: connect timed out
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/343df769-44f3-4316-882e-a701280b358a%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/343df769-44f3-4316-882e-a701280b358a%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/12b526ed-da4c-4473-b813-7bbb2c787dfb%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/12b526ed-da4c-4473-b813-7bbb2c787dfb%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHn91odRxU1W7ttH-mbCLqUXyeMBSuzy78e%2BH7GJE-cS7Gfr%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to