artiya4u / google-http-java-client

Automatically exported from code.google.com/p/google-http-java-client
0 stars 0 forks source link

EOFException in cloud endpoints java client #230

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Version of google-http-java-client (e.g. 1.15.0-rc)?

google-api-client-1.14.1-beta.jar
google-api-client-android-1.14.1-beta.jar
google-http-client-1.14.1-beta.jar
google-http-client-android-1.14.1-beta.jar
google-http-client-gson-1.14.1-beta.jar
google-oauth-client-1.14.1-beta.jar

Java environment (e.g. Java 6, Android 2.3, App Engine)?

Android 4.2.2, With App python engine backend 1.8 using cloud endpoints.

Describe the problem.

I have an android app that uses a cloud endpoints python backend. I get an 
EOFException in my android app for some requests. But the same requests, when 
retried don't give the EOFException.This does not happen for all request, but 
only for 5-10% of them.

06-10 03:53:45.057: W/System.err(1460):     at 
android.os.AsyncTask$2.call(AsyncTask.java:287)
06-10 03:53:45.057: W/System.err(1460):     at 
java.util.concurrent.FutureTask.run(FutureTask.java:234)
06-10 03:53:45.057: W/System.err(1460):     at 
android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
06-10 03:53:45.057: W/System.err(1460):     at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
06-10 03:53:45.057: W/System.err(1460):     at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
06-10 03:53:45.057: W/System.err(1460):     at 
java.lang.Thread.run(Thread.java:856)
06-10 03:53:45.107: W/System.err(1460): Caused by: java.io.EOFException
06-10 03:53:45.167: W/System.err(1460):     at 
libcore.io.Streams.readAsciiLine(Streams.java:203)
06-10 03:53:45.197: W/System.err(1460):     at 
libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:573)
06-10 03:53:45.288: W/System.err(1460):     at 
libcore.net.http.HttpEngine.readResponse(HttpEngine.java:821)
06-10 03:53:45.297: W/System.err(1460):     at 
libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:28
3)
06-10 03:53:45.397: W/System.err(1460):     at 
libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.jav
a:495)
06-10 03:53:45.677: W/System.err(1460):     at 
libcore.net.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.j
ava:134)
06-10 03:53:46.037: W/System.err(1460):     at 
com.google.api.client.http.javanet.NetHttpResponse.<init>(NetHttpResponse.java:3
7)
06-10 03:53:46.057: W/System.err(1460):     at 
com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:95
)
06-10 03:53:46.057: W/System.err(1460):     at 
com.google.api.client.http.HttpRequest.execute(HttpRequest.java:980)
06-10 03:53:46.097: W/System.err(1460):     at 
com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnp
arsed(AbstractGoogleClientRequest.java:412)
06-10 03:53:46.198: W/System.err(1460):     at 
com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnp
arsed(AbstractGoogleClientRequest.java:345)
06-10 03:53:46.198: W/System.err(1460):     at 
com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(Ab
stractGoogleClientRequest.java:463)
06-10 03:53:46.247: W/System.err(1460):     at 
com.androidapp.android.ServerUtilities.postMessage(ServerUtilities.java:154)

How would you expect it to be fixed?

I would appreciate if there is a workaround till this issue is fixed.

Original issue reported on code.google.com by supp...@stacktype.com on 10 Jun 2013 at 4:35

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
same issue here with different version - GAE 1.8.6 SDK and 
google-http-client-android-1.16.0-rc.jar.

11-07 13:33:26.479: W/System.err(29365): java.io.EOFException
11-07 13:33:26.489: W/System.err(29365):    at 
libcore.io.Streams.readAsciiLine(Streams.java:203)
11-07 13:33:26.489: W/System.err(29365):    at 
libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:560)
11-07 13:33:26.489: W/System.err(29365):    at 
libcore.net.http.HttpEngine.readResponse(HttpEngine.java:813)
11-07 13:33:26.489: W/System.err(29365):    at 
libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:27
4)
11-07 13:33:26.489: W/System.err(29365):    at 
libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.jav
a:486)
11-07 13:33:26.494: W/System.err(29365):    at 
libcore.net.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.j
ava:134)
11-07 13:33:26.494: W/System.err(29365):    at 
com.google.api.client.http.javanet.NetHttpResponse.<init>(NetHttpResponse.java:3
7)
11-07 13:33:26.494: W/System.err(29365):    at 
com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:94
)
11-07 13:33:26.494: W/System.err(29365):    at 
com.google.api.client.http.HttpRequest.execute(HttpRequest.java:964)
11-07 13:33:26.494: W/System.err(29365):    at 
com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnp
arsed(AbstractGoogleClientRequest.java:410)
11-07 13:33:26.499: W/System.err(29365):    at 
com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnp
arsed(AbstractGoogleClientRequest.java:343)
11-07 13:33:26.499: W/System.err(29365):    at 
com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(Ab
stractGoogleClientRequest.java:460)

Original comment by Asaf...@gmail.com on 7 Nov 2013 at 11:43

GoogleCodeExporter commented 9 years ago
I had the same issue and I resolved by reorganizing the code, but I don't know 
what exactly fixed it, (and sorry I can't rollback at the moment...):

- added the correct intent-filter for the service
- used only local variables for the client endpoint models (i.e. don't use the 
same model twice)
- removed LocalBroadcastManager at all, that was used for returning the result.

hope it may help

Original comment by francesc...@gmail.com on 2 Feb 2014 at 6:52

GoogleCodeExporter commented 9 years ago
I am getting the same issue with NetHttpTransport on Android 4.1. I switched to 
ApacheHttpTransport and the issue was gone.

Original comment by ykph...@gmail.com on 7 Feb 2014 at 2:36

GoogleCodeExporter commented 9 years ago
I switched to ApacheHttpTransport but I started facing other exceptions like 
javax.net.ssl.SSLException: Write error: ssl,  javax.net.ssl.SSLException: Read 
error: ssl etc. It happens generally when switch from 4G to wifi or wifi to 4G. 

Original comment by uttamgu...@gmail.com on 13 Feb 2015 at 1:41