Forums

IOError: write error on Flask app

Good morning, I have a flask website and the error log of my app I see lots of these errors. I also see inconsistencies between the number users that register to the website and the number of js events that I log on that click (js events are more than the actual number of new users)

2021-11-12 18:52:51,751: IOError: write error

2021-11-12 19:42:06,542: IOError: write error

2021-11-12 23:44:59,603: IOError: write error

2021-11-12 23:44:59,605: IOError: write error

2021-11-12 23:53:12,543: IOError: write error

2021-11-13 04:48:20,375: IOError: write error

2021-11-13 12:20:06,908: IOError: write error

2021-11-13 13:02:58,820: IOError: write error

There is no other info on the type of error.

Does anyone know what could it be? I'm only a beginner developers.

Thanks a lot for your help!

If you're getting a lot of write errors, it suggests that your site is running slowly and people are timing out -- either one of your views is taking more than five minutes to return a response, and so the system is timing out the request, or it's just slow enough that the person who is using the site is closing the browser tab or going to a different site. In both cases, this means that when your code tries to write the response to the connection to the browser, it discovers that the connection is closed -- hence the write error. This help page has more information.

Does your site feel slow when you're accessing it normally? Or perhaps the slow view is just the registration view specifically? We have some hints and tips on how to identify and fix performance problems here.