Forums

"OSError: write error" on error logs

Hi! Lately my flask app has been loading a quite a bit more slowly, and all I'm seeing in the error.log are "OSError: write error".

This is a copy of the error log's content:

  • 2024-09-27 09:44:24,725: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),)': /api/5307650/store/
  • 2024-09-27 11:08:07,100: OSError: write error
  • 2024-09-27 11:08:07,860: OSError: write error
  • 2024-09-27 11:36:58,428: OSError: write error
  • ... [many more of these errors] ...
  • 2024-09-27 14:08:08,144: OSError: write error
  • 2024-09-27 14:08:08,549: OSError: write error
  • 2024-09-27 14:08:16,501: OSError: write error

Could this have something to do with the AWS server where this is hosted? Please let me know if there's something I could do from my side, as this is affecting the performance of the app.

Thank you!

This error is a symptom of a situation when your code can't send the response for a request because the client disconnected (you can find matching lines in the server log). It usually means that the request is being processed too slowly -- I't start with checking that and if so, establishing what is exactly being slow.