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
SocketTimeoutException: Read timed out when executing HTTPS requests #146
Comments
From craig.we...@gmail.com on September 06, 2012 01:49:14 I'm also experiencing this problem, the requests over HTTP consistently work whereas the requests over HTTPS are intermittently faulty, they come back with a timeout exception: 09-06 10:39:19.326: E/(6394): java.net.SocketTimeoutException: Read timed out |
From ma...@onlulu.com on October 01, 2012 08:07:02 Any news on this? Unfortunately the issue prevents me from using the google-http-java-client at all.. |
From yan...@google.com on October 01, 2012 18:42:57 Please try setting the read/connect timeout. There is an example here based on the Google API library, but it generalizes to any HttpTransport when calling createRequestFactory with the HttpRequestInitializer: https://code.google.com/p/google-api-java-client/wiki/FAQ#How_to_set_read/connect_timeouts_using_the_generated_libraries Status: RequestedFeedback |
From emmanuel.rodriguez on October 02, 2012 06:09:13 My app has the same problems. All http request that are done by the app are through SSL (HTTPS only) and I see this timeouts happening all the time. Increasing the socket timeouts make things worse because the app seems to be not responding as it's waiting for the timeout. Something strange is going on when creating the HTTPS connection. |
From atereshc...@stanfy.com.ua on October 02, 2012 06:28:20 We've ported our API from ApacheHttpClient to URLConnection and now struggling with the same timeouts. I think it's not a google-http-java-client issue or java.net.HttpURLConnection but it could be a broken implementation of org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_read() in Android 4.1 |
From ma...@onlulu.com on October 02, 2012 10:03:47 I forgot to mention, but I was already setting large timeouts trying to avoid the issue but, as emmanuel.rodriguez pointed out, this is only getting things worst. Is there any open issue in Android for this? |
From b...@google.com on October 02, 2012 10:17:27 Hello, you've reached the maintainer of SSL in Android. Both ApacheHttpClient and URLConnection should use the same OpenSSLSocketImpl implementation class by default (which calls NativeCrypto.SSL_read(). It is possible that a non-default SSLSocketFactory can be used, leading to the slower non-OpenSSL SSLSocketImpl to be used. I would use strace to verify what socket options are being set for timeout. |
From riv...@gmail.com on October 02, 2012 11:00:43 I've noticed that this is pure Android 4.1 problem - actually we've tested on Galaxy Tab, Nexus 7 and Asus Transformer and this issue exists only on Nexus. P.S. I could provide any additional logs needed. |
From b...@google.com on October 02, 2012 12:12:35 I don't know what the google-http-java-client maintainers would like, but if there was a "public static void main(String args[])" style test case .java file, I can try running it to see what the issue is. |
From emmanuel.rodriguez on October 03, 2012 08:01:15 At comment |
From b...@google.com on October 03, 2012 11:18:24 It is in the emulator if you can reproduce there, or if you can copy the binary over from there. |
From ma...@onlulu.com on November 20, 2012 02:35:20 Still experiencing this issue on google-http-java-client 1.12.0. |
From ivan.mas...@gmail.com on November 27, 2013 07:22:02 hello all, |
From riv...@gmail.com on November 27, 2013 07:35:35 We've found that it generally problem of WiFi connection (WiFi router, gateway etc). |
From tapas.mo...@gmail.com on April 25, 2014 13:11:31 hi, I am facing the same issue in my mobile network only. I am using 2G connection .It is working fine in normal http protocol. |
From ssymbol....@gmail.com on May 18, 2014 05:06:03 Did anything change? Was the problems resolved? |
From ssymbol....@gmail.com on May 18, 2014 05:06:56 I am using Android App Engine connected project and facing the same issue. I would be ahappy to get any solution |
From rmis...@google.com on May 19, 2014 05:10:43 |
From leo.qui...@gmail.com on July 19, 2014 04:09:33 I also have this issue. Seeing this both on a phone (wifi), and on the emulator java.net.SocketTimeoutException: Read timed out |
From petar.pe...@gmail.com on November 04, 2014 04:05:38 We have the same issue in production. Timeouts (CONN & SO_TIMEOUT) are set to 30 sec. This is currently happening on the following devices: samsung SM-N9005 / 4.4.2 |
From andreike...@gmail.com on December 08, 2014 07:53:40 Hello petar, Have you found a solution to the problem?? I'm having the same issue to model GT-I9515 and another devices too. java.net.SocketTimeoutException: Read timed out |
From riv...@gmail.com on December 08, 2014 11:05:12 I'm gonna repeat what was said - try different routers and see if problem occurs. |
From petar.pe...@gmail.com on December 08, 2014 12:33:53
Sadly, that would not be feasible at our side. We've got hunderds of devices all around the world. :( @andreike: I found no solution to this but on the other side there were no explicit customer complaints about it. I assume it happens when the customer/app user switches between WiFi/3G in the middle of a request being processed. For now, we have just disabled the error reporting (for this exception types only) and redesigned parts of our app around this issue (repeat request, graceful error handling, etc.) More feedback would be appreciated though. |
So if we will use google-http-java-client sameversion as Android 7.1(or above) , in our projects, then we will be free of this bug? |
I am seeing something similar, can someone else check the certificates and let me know if those certificates are also issued by Letsencrypt ? My theory is that the JDK/JRE contains neither the Let's Encrypt CA specifically nor the IdenTrust CA that cross signed it. |
Any fix for this? I am using Linux 18.0.4 and Java 8. have the same issue, 20 seconds timeout for reading a sheet. Seems the way suggested by google is not working:
The code is hosted on github. |
we just started seeing large consistent socket read timeouts with the python client with a timeout of 15s. Interestingly this was prefixed with rate limiter errors. I'm wondering if they're banning IPs? |
From ma...@onlulu.com on July 31, 2012 09:43:21
Version of google-http-java-client (e.g. 1.5.0-beta)? 1.10.3 Beta Java environment (e.g. Java 6, Android 2.3, App Engine)? Android 4.1 (Google Nexus) Describe the problem. I'm using an HttpTransport got with AndroidHttp.newCompatibleTransport() to perform multiple requests to a server using the HTTPS protocol. Both using WiFi and 3G, I sometimes get this exception when executing a request:
07-31 17:14:40.659: W/System.err(7558): java.net.SocketTimeoutException: Read timed out
07-31 17:14:40.659: W/System.err(7558): at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_read(Native Method)
07-31 17:14:40.659: W/System.err(7558): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:675)
07-31 17:14:40.659: W/System.err(7558): at libcore.io.Streams.readSingleByte(Streams.java:41)
07-31 17:14:40.659: W/System.err(7558): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:659)
07-31 17:14:40.659: W/System.err(7558): at libcore.io.Streams.readAsciiLine(Streams.java:201)
07-31 17:14:40.659: W/System.err(7558): at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:560)
07-31 17:14:40.659: W/System.err(7558): at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:813)
07-31 17:14:40.659: W/System.err(7558): at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:274)
07-31 17:14:40.659: W/System.err(7558): at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:486)
07-31 17:14:40.659: W/System.err(7558): at libcore.net.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:134)
07-31 17:14:40.659: W/System.err(7558): at com.google.api.client.http.javanet.NetHttpResponse.(NetHttpResponse.java:37)
07-31 17:14:40.667: W/System.err(7558): at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:91)
07-31 17:14:40.667: W/System.err(7558): at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:895)
Note that:
There are other users experiencing this issue with the error reporting library ACRA, which might use google-http-java-client as well. This is the link to the issue: https://code.google.com/p/acra/issues/detail?id=128 How would you expect it to be fixed? No idea, I don't even know if it's a library or system issue.
Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=146
The text was updated successfully, but these errors were encountered: