Error One:
Encounter a very strange problem, web.py code inside the error
IOError: [Errno] Broken pipe
Start command:
Nohup python xxx.py >> Xxx.log &
SSH log on to the machine, boot, does not appear
IOError problem occurs when remote SSH executes the startup script
View the process PID, LL/PROC/<PID>/FD found that stderr is the FD 2 file, unexpectedly is a pipe, is a broken pipe, the wrong place to find
Guess is SSH login in the past, Nohup will redirect stderr, default redirect to stdout, but SSH session stdout should be pipe, because the output from the remote machine to upload to the machine
Nohup redirect stderr to this pipe, when the SSH session ends, the pipe will naturally be closed, so when the program code in the stderr inside write things, will be error
Error Two:
In response to the above problems single-machine execution time, found no longer error, but in order to deal with the previous use of Nginx as a reverse proxy, the results appear
IOError: [Errno] Broken pipe
By F12 discovery, post loads a JS file timeout and appears 504 time-out
Check JS file no problem,
Recall, before the use of nginx before, this problem has been resolved, why suddenly appeared,
After data query, using the above nginx configuration to solve
The read time setting should be too short to cause a timeout:
Location/{Proxy_read_timeout 300; ...... ..... }
This kind of problem makes a person egg ache.
This article is from the "Crazy_sir" blog, make sure to keep this source http://douya.blog.51cto.com/6173221/1836848
Python Problem Solving: IOError: [Errno] Broken pipe