CAS单点登录中了休假魔咒-ERROR client.util.CommonUtils 442 getResponseFromServer- Unexpected end of file from s

最近家里三桩喜事,妹妹订婚、小宝办酒、大哥乔迁新居,请了三天假,最后一天讨论组爆出cas 登录总是403跨越问题,

初步分析可能是cas登录成功了 casclient没有处理成功导致casclient未登陆状态。

休假回来,查看系统日志发现,

CasServer  登录成功了

CasClient 报错

 

 ERROR client.util.CommonUtils 442 getResponseFromServer- Unexpected end of file from server

 

在stackoverflow找到答案,如下: 
“Unexpected end of file” implies that the remote server accepted and closed the connection without sending a response. It’s possible that the remote system is too busy to handle the request, or that there’s a network bug that randomly drops connections.

With the information available it’s impossible to say what’s going wrong. If you have access to the servers in question you can use packet sniffing tools to find what exactly is sent and received, and look at logs to of the server process to see if there are any error messages. 
意思就是说“意外的文件结束”意味着远程服务器接受并关闭连接,而不发送响应。远程系统可能太忙,无法处理请求,或者有网络错误随机丢弃连接。 

查看网络问题ping 不通,让运维开通ICMP

 

观察日志:

现象消失

问题又复现:

查看日志

11-Sep-2019 11:56:06.964 SEVERE [http-bio-8443-exec-2298] org.apache.coyote.http11.AbstractHttp11Processor.process Error processing request
 java.lang.IllegalArgumentException: Control character in cookie value or attribute.
        at org.apache.tomcat.util.http.LegacyCookieProcessor.isV0Separator(LegacyCookieProcessor.java:729)
        at org.apache.tomcat.util.http.LegacyCookieProcessor.processCookieHeader(LegacyCookieProcessor.java:526)
        at org.apache.tomcat.util.http.LegacyCookieProcessor.parseCookieHeader(LegacyCookieProcessor.java:256)
        at org.apache.catalina.connector.Request.parseCookies(Request.java:3059)
        at org.apache.catalina.connector.Request.getServerCookies(Request.java:2075)
        at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:1211)
        at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:918)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:497)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:285)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)

 

获取tomcat pid

 netstat -antp | grep 8080

查看pid状态

 netstat -antp | grep 121112

 

Linux中查看socket状态:
cat /proc/net/sockstat #(这个是ipv4的)

sockets: used 137
TCP: inuse 49 orphan 0 tw 3272 alloc 52 mem 46
UDP: inuse 1 mem 0
RAW: inuse 0
FRAG: inuse 0 memory 0
说明:
sockets: used:已使用的所有协议套接字总量
TCP: inuse:正在使用(正在侦听)的TCP套接字数量。其值≤ netstat –lnt | grep ^tcp | wc –l
TCP: orphan:无主(不属于任何进程)的TCP连接数(无用、待销毁的TCP socket数)
TCP: tw:等待关闭的TCP连接数。其值等于netstat –ant | grep TIME_WAIT | wc –l
TCP:alloc(allocated):已分配(已建立、已申请到sk_buff)的TCP套接字数量。其值等于netstat –ant | grep ^tcp | wc –l
TCP:mem:套接字缓冲区使用量(单位不详。用scp实测,速度在4803.9kB/s时:其值=11,netstat –ant 中相应的22端口的Recv-Q=0,Send-Q≈400)
UDP:inuse:正在使用的UDP套接字数量
RAW:
FRAG:使用的IP段数量

 

 

后记:

出差又报错

查询原因是:

从后端调用rest接口,该接口属于内部接口.

处理方式

访问的url链接中,不用域名,而是选用ip+端口的方式.

 

又报错了

"Unexpected end of file" implies that the remote server accepted and closed the connection without sending a response. It's possible that the remote system is too busy to handle the request, or that there's a network bug that randomly drops connections.

远程系统太忙了没法处理请求,一种是网络问题随机丢弃连接

With the information available it's impossible to say what's going wrong. If you have access to the servers in question you can use packet sniffing tools to find what exactly is sent and received, and look at logs to of the server process to see if there are any error messages.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

未来AI编程

共鸣===鼓励 打赏您随意

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值