yourlabs / django-autocomplete-light

A fresh approach to autocomplete implementations, specially for Django. Status: v4 alpha, v3 stable, v2 & v1 deprecated.
https://django-autocomplete-light.readthedocs.io
MIT License
1.81k stars 468 forks source link

ConnectionResetError: [Errno 54] Connection reset by peer #1236

Open nlarusstone opened 3 years ago

nlarusstone commented 3 years ago

I'm getting ConnectionResetError: [Errno 54] Connection reset by peer when trying to navigate to my autocomplete views.

I'm running Python 3.9.1 and django-autocomplete-light==3.8.1.

----------------------------------------
2021-04-19 17:53:58,716  INFO [basehttp.py:157] "GET /platform_app/autocomplete/?q=foo%20barararraw HTTP/1.1" 200 46
----------------------------------------
Exception occurred during processing of request from ('127.0.0.1', 61266)
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 650, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 720, in __init__
    self.handle()
  File "/Users/nlarusstone/.virtualenvs/platform/lib/python3.9/site-packages/django/core/servers/basehttp.py", line 174, in handle
    self.handle_one_request()
  File "/Users/nlarusstone/.virtualenvs/platform/lib/python3.9/site-packages/django/core/servers/basehttp.py", line 182, in handle_one_request
    self.raw_requestline = self.rfile.readline(65537)
  File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socket.py", line 704, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [Errno 54] Connection reset by peer

It doesn't happen with any other URL in my app, which is why I'm suspicious of dal

nlarusstone commented 3 years ago

Debouncing (such as https://github.com/yourlabs/django-autocomplete-light/issues/188#issuecomment-692403134) helps -- which makes me think this is even more likely an issue in dal

jpic commented 3 years ago

@nlarusstone #188 concerns the old jquery script we had in DAL, which BTW has been ported to a WebComponent in yourlabs.io/oss/autocomplete-light

DAL now uses select2 JS

nlarusstone commented 3 years ago

Hmmm that's interesting, thanks for pointing that out. I still think there's an issue with DAL since I only see that connection error when interacting with autocomplete fields.

I also only see it when running in development/debug mode....