IOError: [Errno 104] Connection reset by peer

Got an error while serving development mode in port 8000

Exception happened during processing of request from ('13.95.160.11', 1664)
Traceback (most recent call last):
 File "/usr/lib/python2.7/SocketServer.py", line 593, in process_request_thread
   self.finish_request(request, client_address)
 File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
   self.RequestHandlerClass(request, client_address, self)
 File "/usr/lib/python2.7/SocketServer.py", line 649, in __init__
   self.handle()
 File "/home/hlanganisa_user/frappe-fmcg/env/local/lib/python2.7/site-packages/werkzeug/serving.py", line 216, in handle
   rv = BaseHTTPRequestHandler.handle(self)
 File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
   self.handle_one_request()
 File "/home/hlanganisa_user/frappe-fmcg/env/local/lib/python2.7/site-packages/werkzeug/serving.py", line 247, in handle_one_request
   self.raw_requestline = self.rfile.readline()
IOError: [Errno 104] Connection reset by peer

what could be the reason.

Share the steps to reproduce this.

I have the same problem as well. My configuration is ubuntu 16 vm in the cloud connecting to mariadb in aws rdb

The same set of the source codes works fine if db sits on the same box.

Can this be looked at?

Regards,
Jian

Same problem with development image on localhost:8000,
but only with the development image.

The production vm on the localhost.8080 is working well.

May be this is the reason: /I’m on NAT network settings on both cases/

Getting this in 2025 on a brand new Ubuntu 24 server with stock mariadb config.

Installing frappe...
Updating DocTypes for frappe        : [========================================] 100%
Set Administrator password: 
Re-enter Administrator password: 
Traceback (most recent call last):
  File "/home/frappe/frappe-bench/env/lib/python3.12/site-packages/pymysql/connections.py", line 806, in _write_bytes
    self._sock.sendall(data)
ConnectionResetError: [Errno 104] Connection reset by peer

The server has max_allowed_packet = 128M. What gives?

Ubuntu 24.04.2 LTS to be specific.

Ok raising it to a ridiculous max_allowed_packet = 512M solved this.