OSError: headers already sent #331
-
I'm getting this error on every socket disconnect and it is flooding my logs. I'm hesitant to open a bug request because I won't be surprised if this is somehow a problem of my code's usage. I found a similar bug reported and fixed here: miguelgrinberg/Flask-SocketIO#377 But the fix for that issue was to upgrade python-engineio and I am currently on the latest version. Relevant versions: Flask-SocketIO==5.3.3 I have traced through the code with a pdb on the request causing the error and I can't see anything that stands out as wrong. It is hitting this part of the code in engineio/server.py:
Then it proceeds on with a normal response:
and finally errors:
With:
The errors happen only on a disconnect and it happens on every disconnect. It is easy to reproduce. It isn't causing any problems with our users but it causes many errors in our logs so I'd like to fix it if possible. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
This may be a regression of that old bug, I don't think this is something that you are doing wrong. What I need to know to help me troubleshoot is the versions of the following packages (whichever you have installed): simple-websocket |
Beta Was this translation helpful? Give feedback.
-
simple-websocket==1.0.0 |
Beta Was this translation helpful? Give feedback.
I found out that this error does not occur on engineio version 4.7.1. So I will treat that as a fix for now.