Heroku sock=backend Server Request Interrupted for a Flask SocketIO application Heroku sock=backend Server Request Interrupted for a Flask SocketIO application flask flask

Heroku sock=backend Server Request Interrupted for a Flask SocketIO application


This kind of "socket stream error" is raised by Flask when you cancel or resend the same request while on the server side (flask) you are still under computation in order to render layout corresponding to the initial request.

So it may be relative to timeout or network Error handling on both side (server/client).

Some question :

How long the request computation is during on server side ? How do you handle network error exception on server and client side ? Does exist any timeout on flask or client side ?

It is also possible that a new request is sent before the previous one is over..

Please share some code relative to request processing.


This worked for me:

from waitress import serve# app.run(host='0.0.0.0', port=port) # <---- REMOVE THIS# serve your flask app with waitress, instead of running it directly.serve(app, host='0.0.0.0', port=port) # <---- ADD THIS