Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.net.SocketTimeoutException: Read timed out #169

Closed
T0nyMa opened this issue May 21, 2014 · 7 comments
Closed

java.net.SocketTimeoutException: Read timed out #169

T0nyMa opened this issue May 21, 2014 · 7 comments

Comments

@T0nyMa
Copy link

T0nyMa commented May 21, 2014

We are using CF java client to deploy our apps. In deployment, we can see such timed out causing the deployment failed. Seems it is uploading the distribution to CF, and it exceed the default timeout.

Is there anyway to configure the timeout?

org.springframework.web.client.ResourceAccessException: I/O error on PUT request for "http://ccng.cfperf02.dctmlabs.com/v2/apps/cbd5048e-8d95-45f2-bea9-6ec38a6168bf/bits":Read timed out; nested exception is java.net.SocketTimeoutException: Read timed out
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:503) ~[spring-web-3.2.4.RELEASE.jar:3.2.4.RELEASE]
    at org.cloudfoundry.client.lib.rest.LoggingRestTemplate.doExecute(LoggingRestTemplate.java:54) ~[cloudfoundry-client-lib-1.0.2.BUILD-EMC.jar:na]
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:452) ~[spring-web-3.2.4.RELEASE.jar:3.2.4.RELEASE]
    at org.springframework.web.client.RestTemplate.put(RestTemplate.java:349) ~[spring-web-3.2.4.RELEASE.jar:3.2.4.RELEASE]
    at org.cloudfoundry.client.lib.rest.CloudControllerClientImpl.uploadApplication(CloudControllerClientImpl.java:1084) ~[cloudfoundry-client-lib-1.0.2.BUILD-EMC.jar:na]
    at org.cloudfoundry.client.lib.rest.CloudControllerClientImpl.uploadApplication(CloudControllerClientImpl.java:1061) ~[cloudfoundry-client-lib-1.0.2.BUILD-EMC.jar:na]
    at org.cloudfoundry.client.lib.CloudFoundryClient.uploadApplication(CloudFoundryClient.java:199) ~[cloudfoundry-client-lib-1.0.2.BUILD-EMC.jar:na]
    at org.cloudfoundry.client.lib.CloudFoundryOperations$uploadApplication$6.call(Unknown Source) ~[na:na]
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) ~[groovy-all-2.2.0.jar:2.2.0]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) ~[groovy-all-2.2.0.jar:2.2.0]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120) ~[groovy-all-2.2.0.jar:2.2.0]
    at com.emc.ngis.tools.cf.cf.impl.CfClientServiceImpl.deployNgis(CfClientServiceImpl.groovy:102) ~[upgrade-impl-0.0.1a.jar:na]
    at com.emc.ngis.tools.cf.api.CfClientService$deployNgis$2.call(Unknown Source) ~[na:na]
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) ~[groovy-all-2.2.0.jar:2.2.0]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) ~[groovy-all-2.2.0.jar:2.2.0]
    at com.emc.ngis.tools.upgrade.NgisDeployer.deployAsNewNgis(NgisDeployer.groovy:200) [upgrade-impl-0.0.1a.jar:na]
    at com.emc.ngis.tools.upgrade.NgisDeployer.deployNgis(NgisDeployer.groovy:111) [upgrade-impl-0.0.1a.jar:na]
    at com.emc.ngis.tools.upgrade.NgisDeployer.deploy(NgisDeployer.groovy:70) [upgrade-impl-0.0.1a.jar:na]
    at com.emc.ngis.tools.upgrade.NgisDeployer$deploy$0.call(Unknown Source) [upgrade-impl-0.0.1a.jar:na]
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) ~[groovy-all-2.2.0.jar:2.2.0]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) ~[groovy-all-2.2.0.jar:2.2.0]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112) ~[groovy-all-2.2.0.jar:2.2.0]
    at com.emc.ngis.tools.upgrade.AllDeploymentDeployer.deploy(AllDeploymentDeployer.groovy:50) [upgrade-impl-0.0.1a.jar:na]
    at com.emc.ngis.tools.upgrade.AbstractDeployer.execute(AbstractDeployer.groovy:45) [upgrade-impl-0.0.1a.jar:na]
    at com.emc.ngis.tools.upgrade.AbstractDeployer$execute.call(Unknown Source) [upgrade-impl-0.0.1a.jar:na]
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) ~[groovy-all-2.2.0.jar:2.2.0]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) ~[groovy-all-2.2.0.jar:2.2.0]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112) ~[groovy-all-2.2.0.jar:2.2.0]
    at com.emc.ngis.tools.upgrade.UpgradeRunner.upgrade(UpgradeRunner.groovy:33) [upgrade-impl-0.0.1a.jar:na]
    at com.emc.ngis.tools.upgrade.UpgradeRunner$upgrade$0.call(Unknown Source) [upgrade-impl-0.0.1a.jar:na]
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) ~[groovy-all-2.2.0.jar:2.2.0]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) ~[groovy-all-2.2.0.jar:2.2.0]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112) ~[groovy-all-2.2.0.jar:2.2.0]
    at com.emc.ngis.tools.cli.UpgradeMain.run(UpgradeMain.groovy:79) [upgrade-cli-0.0.1a.jar:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_40]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_40]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_40]
    at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_40]
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) [groovy-all-2.2.0.jar:2.2.0]
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) [groovy-all-2.2.0.jar:2.2.0]
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085) [groovy-all-2.2.0.jar:2.2.0]
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909) [groovy-all-2.2.0.jar:2.2.0]
    at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:901) [groovy-all-2.2.0.jar:2.2.0]
    at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:884) [groovy-all-2.2.0.jar:2.2.0]
    at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper.java:406) [groovy-all-2.2.0.jar:2.2.0]
    at org.codehaus.groovy.runtime.InvokerHelper$runScript.call(Unknown Source) [groovy-all-2.2.0.jar:2.2.0]
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) ~[groovy-all-2.2.0.jar:2.2.0]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) ~[groovy-all-2.2.0.jar:2.2.0]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120) ~[groovy-all-2.2.0.jar:2.2.0]
    at com.emc.ngis.tools.cli.UpgradeMain.main(UpgradeMain.groovy) [upgrade-cli-0.0.1a.jar:na]
Caused by: java.net.SocketTimeoutException: Read timed out
    at java.net.SocketInputStream.socketRead0(Native Method) ~[na:1.7.0_40]
    at java.net.SocketInputStream.read(SocketInputStream.java:152) ~[na:1.7.0_40]
    at java.net.SocketInputStream.read(SocketInputStream.java:122) ~[na:1.7.0_40]
    at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:160) ~[httpcore-4.3.jar:4.3]
    at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:84) ~[httpcore-4.3.jar:4.3]
    at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:273) ~[httpcore-4.3.jar:4.3]
    at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:140) ~[httpclient-4.3.1.jar:4.3.1]
    at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57) ~[httpclient-4.3.1.jar:4.3.1]
    at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:260) ~[httpcore-4.3.jar:4.3]
    at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:283) ~[httpcore-4.3.jar:4.3]
    at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:251) ~[httpclient-4.3.1.jar:4.3.1]
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:197) ~[httpclient-4.3.1.jar:4.3.1]
    at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:271) ~[httpcore-4.3.jar:4.3]
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123) ~[httpcore-4.3.jar:4.3]
    at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:682) ~[httpclient-4.3.1.jar:4.3.1]
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:486) ~[httpclient-4.3.1.jar:4.3.1]
    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863) ~[httpclient-4.3.1.jar:4.3.1]
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) ~[httpclient-4.3.1.jar:4.3.1]
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57) ~[httpclient-4.3.1.jar:4.3.1]
    at org.springframework.http.client.HttpComponentsClientHttpRequest.executeInternal(HttpComponentsClientHttpRequest.java:88) ~[spring-web-3.2.4.RELEASE.jar:3.2.4.RELEASE]
    at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:46) ~[spring-web-3.2.4.RELEASE.jar:3.2.4.RELEASE]
    at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:49) ~[spring-web-3.2.4.RELEASE.jar:3.2.4.RELEASE]
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:488) ~[spring-web-3.2.4.RELEASE.jar:3.2.4.RELEASE]
    ... 49 common frames omitted
@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/71730174. This repo is managed by the 'CF Java Experience' team.

@stupakov
Copy link

@T0nyMa - the LoggingRestTemplate class looks like it calls org.springframework.web.client.RestTemplate.doExecute(). The comments under this post suggest that the default timeout for RestTemplate comes from the system and this link shows how to change it.

Please let us know if this works for you or if you have more questions.

Thanks,
CF Community Support (@stupakov)

@jmtuley
Copy link

jmtuley commented Jun 13, 2014

@T0nyMa is this still a problem for you? If not, can we close the issue?

Thanks,
@jmtuley and @jfoley (CF Community Pair)

/cc @scottfrederick

@T0nyMa
Copy link
Author

T0nyMa commented Jun 16, 2014

sorry for the late response, we deploy build once a week. And for the latest one with the setting by @stupakov , so far it is good.

We can close this.

Thanks.

@T0nyMa T0nyMa closed this as completed Jun 16, 2014
@jbcpollak
Copy link

Hello, I'm running into this issue when trying to deploy a minimal Spring-Boot Jar from a hosted Jenkins instance (CloudBees). The jar is 54 MB, I don't think we have the ability to change a system-level property. Is there another work-around?

@mamacdon
Copy link

mamacdon commented Sep 8, 2014

@jbcpollak +1, please let me know if you find another workaround.

Aside: according to JVM docs, the default value of sun.net.client.defaultConnectTimeout and sun.net.client.defaultReadTimeout is -1, which seems inconsistent with the behavior described here: I would expect it to wait forever, not time out.

@jbcpollak
Copy link

@mamacdon - just an fyi - this problem magically disappeared for us, I think cloudbees had temporary connection problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants