Front end returns 504
Uwsgi error log problem 1
1
2
3
|
Tue Jan 19 14:06:15 2021 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) BrokenPipeError: [Errno 32] Broken pipe(error caused by abnormal socket closure) broken pipe is an error that can be generated when send, write, or writeev, when one end is writing to a closed connection on the other end. error. |
Uwsgi error log problem 2
1
2
3
4
5
6
7
|
problem 2 Fri Apr 2 17:43:17 2021 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /cross_server/update_version/ (ip 192.168.10.1) !!! Fri Apr 2 17:43:17 2021 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during POST /cross_server/update_version/ (192.168.10.1) [ERROR][2021-04-02 17:43:17,212][setup.py:910]An un-handled exception was caught by salt's global exception handler: OSError: write error OSError: write error OSError: write error |
Analysis:
The client aborts the connection, and then Nginx closes the connection without telling uwsgi to abort. Then, when uwsgi returns the result, the socket has been closed
Solution
Add parameters to nginx configuration
1
2
3
|
uwsgi_send_timeout 1800; # Specifies the timeout for connecting to the backend uWSGI. uwsgi_connect_timeout 1800; # Specify the timeout for transmitting requests to uWSGI after the completion of the handshake. uwsgi_read_timeout 1800; # Specify the timeout for receiving uWSGI responses, and the timeout for receiving uWSGI responses after completing the handshake. |
uwsgi configuration add parameters
1
2
3
|
ignore-sigpipe= true #Make uWSGI not display SIGPIPE errors. ignore-write-errors= true #Make it so that it doesn't show things likeuwsgi_response_writev_headers_and_body_do error disable-write-exception= true #Generated when OSError is prevented from being written. |
Similar Posts:
- How to Solve Python socket:[Errno 32] Broken pipe
- java.net.SocketException: Broken pipe
- [Solved] Nginx proxy Timeout: upstream timed out (110: Connection timed out)
- [Solved] reactor.netty.http.client.PrematureCloseException: Connection prematurely closed BEFORE response
- Unable to return file stream in Python 3, uwsgi report error
- Solutions to nginx upstream timed out (Two Situations)
- Using Python HDFS module to operate Hadoop HDFS
- Execute the Jmeter Script Error: .org.apache.http.conn.httphostconnectexception: XXXX failed: unable to specify the solution of the requested address (Connect failed)
- HttpURLConnection Cannot write output after reading input.
- Python problem solving: ioerror: [errno 32] broken pipe