IBM MFP - 身份验证时出现间歇性 SocketTimeoutException

Posted

技术标签:

【中文标题】IBM MFP - 身份验证时出现间歇性 SocketTimeoutException【英文标题】:IBM MFP - getting intermittent SocketTimeoutException while authentication 【发布时间】:2018-08-29 14:34:02 【问题描述】:

我们在 Google Cloud 上提供 IBM MFP 8.0.0.00-20171220-1341 版本。 我们正在使用身份验证适配器进行登录。

在登录时,我们得到 java.net.SocketTimeoutException: timeout 异常。 请检查以下日志。


    com.mfpauth.impl.Authentication                             E java.net.SocketTimeoutException: timeout
            at okio.Okio$4.newTimeoutException(Okio.java:230)
            at okio.AsyncTimeout.exit(AsyncTimeout.java:285)
            at okio.AsyncTimeout$2.read(AsyncTimeout.java:241)
            at okio.RealBufferedSource.indexOf(RealBufferedSource.java:345)
            at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:217)
            at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:211)
            at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)
            at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:75)
            at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
            at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
            at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
            at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
            at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
            at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
            at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
            at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
            at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
            at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
            at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
            at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
            at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)
            at okhttp3.RealCall.execute(RealCall.java:69)
            at com.mfpauth.impl.Authentication.callAdapterWebService(Authentication.java:118)
            at com.mfpauth.impl.Authentication.getDealerProfileAttributes(Authentication.java:551)
            at com.mfpauth.impl.Authentication.validateCredentials(Authentication.java:229)
            at com.ibm.mfp.security.checks.base.CredentialsValidationSecurityCheck.authorize(CredentialsValidationSecurityCheck.java:59)
            at com.ibm.mfp.security.checks.base.UserAuthenticationSecurityCheck.authorize(UserAuthenticationSecurityCheck.java:68)
            at com.mfpauth.impl.Authentication.authorize(Authentication.java:99)
            at com.ibm.mfp.server.security.internal.context.ClientSecurityContextImpl$1.visit(ClientSecurityContextImpl.java:380)
            at com.ibm.mfp.server.security.internal.context.ClientSecurityContextImpl.iterateThroughSecurityChecks(ClientSecurityContextImpl.java:461)
            at com.ibm.mfp.server.security.internal.context.ClientSecurityContextImpl.processAuthorizationRequest(ClientSecurityContextImpl.java:370)
            at sun.reflect.GeneratedMethodAccessor360.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
            at java.lang.reflect.Method.invoke(Method.java:508)
            at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
            at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
            at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
            at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
            at com.sun.proxy.$Proxy246.processAuthorizationRequest(Unknown Source)
            at com.ibm.mfp.server.security.internal.services.PreAuthorizationServiceImpl.authorize(PreAuthorizationServiceImpl.java:36)
            at com.ibm.mfp.server.security.internal.rest.PreAuthorizationEndpoint$1.call(PreAuthorizationEndpoint.java:82)
            at com.ibm.mfp.server.security.internal.rest.PreAuthorizationEndpoint$1.call(PreAuthorizationEndpoint.java:79)
            at com.ibm.mfp.server.persistency.internal.transaction.StorageManagerImpl.doWithStorage(StorageManagerImpl.java:49)
            at com.ibm.mfp.server.security.internal.rest.PreAuthorizationEndpoint.authorize(PreAuthorizationEndpoint.java:78)
            at sun.reflect.GeneratedMethodAccessor359.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
            at java.lang.reflect.Method.invoke(Method.java:508)
            at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
            at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
            at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
            at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)
            at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
            at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
            at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
            at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
            at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
            at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
            at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
            at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1290)
            at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:778)
            at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
            at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1161)
            at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:82)
            at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:956)
            at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:280)
            at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:967)
            at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.wrapHandlerAndExecute(HttpDispatcherLink.java:359)
            at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:318)
            at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:471)
            at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:405)
            at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:285)
            at com.ibm.ws.http.channel.internal.inbound.HttpICLReadCallback.complete(HttpICLReadCallback.java:66)
            at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:504)
            at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:574)
            at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:929)
            at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1018)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
            at java.lang.Thread.run(Thread.java:811)
        Caused by: java.net.SocketException: Socket closed
            at java.net.SocketInputStream.read(SocketInputStream.java:215)
            at java.net.SocketInputStream.read(SocketInputStream.java:152)
            at okio.Okio$2.read(Okio.java:139)
            at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
            ... 81 more

当我们遇到这个间歇性问题时,什么阻碍了。这个问题是由于谷歌云而发生的吗?

【问题讨论】:

【参考方案1】:

这可能与 Google Cloud 无关。在您的安全检查中,您似乎在以下位置调用后端:

        at com.mfpauth.impl.Authentication.callAdapterWebService(Authentication.java:118)

为此,您正在使用 okhttp 库。

okhttp3 库的默认超时时间是 10 秒。您可能需要增加超时值并检查是否可以解决问题。

更多详情请参考:

Timeouts

okhttp3 timeout

【讨论】:

以上是关于IBM MFP - 身份验证时出现间歇性 SocketTimeoutException的主要内容,如果未能解决你的问题,请参考以下文章

没有客户端组件的基于 IBM MFP 适配器的身份验证

Safari 访问受 Windows 集成身份验证 (aka NTLM) 保护的网站时出现问题

IBM MFP8 - 调用适配器时主机无响应错误

如何在 IBM MFP 中获取所有现有的推送设备注册

当我尝试从 Android Emulator 调用 MFP 适配器时出现以下错误

现有 IONIC 1 项目迁移到 IBM Worklight(MobileFirst 平台“MFP”)