Try ERPNext Buy Support Partners Foundation

Server Error (BrokenPipeError: [Errno 32] Broken pipe)

When I keep my session idle over night and open it in the next morning, it appear as server error, unless I clear my browser cache. How can i resolve and prevent this problem?

Server Error
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 52, in application
init_request(request)
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 117, in init_request
frappe.local.http_request = frappe.auth.HTTPRequest()
File “/home/frappe/frappe-bench/apps/frappe/frappe/auth.py”, line 51, in init
frappe.local.login_manager = LoginManager()
File “/home/frappe/frappe-bench/apps/frappe/frappe/auth.py”, line 113, in init
self.make_session(resume=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/auth.py”, line 188, in make_session
full_name=self.full_name, user_type=self.user_type)
File “/home/frappe/frappe-bench/apps/frappe/frappe/sessions.py”, line 194, in init
self.resume()
File “/home/frappe/frappe-bench/apps/frappe/frappe/sessions.py”, line 255, in resume
data = self.get_session_record()
File “/home/frappe/frappe-bench/apps/frappe/frappe/sessions.py”, line 273, in get_session_record
r = self.get_session_data()
File “/home/frappe/frappe-bench/apps/frappe/frappe/sessions.py”, line 287, in get_session_data
data = self.get_session_data_from_cache()
File “/home/frappe/frappe-bench/apps/frappe/frappe/sessions.py”, line 304, in get_session_data_from_cache
print(‘deleting…’)
BrokenPipeError: [Errno 32] Broken pipe

Is there a solution to this error? I am encountering it as well after my session stayed open for long

For temporary solution, you can clear your browser’s cache, it will work fine, but I could not find out the best solution yet.

@usopheak Why the session is idle ?

Is it development environment ? If yes then you have to kill the process of the frappe, node, redis, and have to start bench.

But, if you are using development environment as production environment i.e using bench start in virtual machine (VM). Then you have to do setup for the production using nginx and supervisord

For me. I take a backup from my current server and make new server and restore it again that’s working with me

I’m doing a bench destroy-all-sessions but I have to do almost every day. It needs permanent fixing

This is a network infrastructure problem; only your local providers can help you identify and remedy your particular case.

Actually ended up noticing that on the server where I had this issue, Scheduled jobs weren’t running. Which means the clear-expired-sessions job wasn’t being executed, leading to the Brokenpipe error on sessions.py
FIX = Make sure the scheduled jobs are running.

1 Like