1. 程式人生 > 其它 >java.net.SocketException: Broken pipe (Write failed) /413 Request Entity Too Large 異常問題排查

java.net.SocketException: Broken pipe (Write failed) /413 Request Entity Too Large 異常問題排查

技術標籤:常見異常集合https

@[TOC](java.net.SocketException: Broken pipe (Write failed) /413 Request Entity Too Large 異常問題排查)

線上專案偶發性的遇到 java.net.SocketException: Broken pipe (Write failed)

java.net.SocketException: Broken pipe (Write failed)
	at java.net.SocketOutputStream.socketWrite0(Native Method)
	at java.
net.SocketOutputStream.socketWrite(SocketOutputStream.java:109) at java.net.SocketOutputStream.write(SocketOutputStream.java:153) at sun.security.ssl.OutputRecord.writeBuffer(OutputRecord.java:431) at sun.security.ssl.OutputRecord.write(OutputRecord.java:417) at sun.security.ssl.SSLSocketImpl.writeRecordInternal
(SSLSocketImpl.java:876) at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:847) at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123) .......

或者在postman上面模擬請求直接413 提示的很明顯
413 Request Entity Too Large
在這裡插入圖片描述

通過和正常請求的報文比較發現出現這種異常請求的請求body中的報文內容都是偏大的;
然後讓對方開發看了一下他們的nginx預設的配置 client_max_body_size 1m;

而我們這邊的請求報文體大概是2M 左右所以導致了資料傳輸的時間 服務端的nginx修改一下配置項重啟就可以