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

EOFException in cloud endpoints java client #230

Closed
wonderfly opened this issue Jan 9, 2015 · 5 comments

Comments

@wonderfly
Copy link
Contributor

@wonderfly wonderfly commented Jan 9, 2015

From supp...@stacktype.com on June 09, 2013 21:35:45

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:283)
06-10 03:53:45.397: W/System.err(1460): at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:495)
06-10 03:53:45.677: W/System.err(1460): at libcore.net.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:134)
06-10 03:53:46.037: W/System.err(1460): at com.google.api.client.http.javanet.NetHttpResponse.(NetHttpResponse.java:37)
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.executeUnparsed(AbstractGoogleClientRequest.java:412)
06-10 03:53:46.198: W/System.err(1460): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:345)
06-10 03:53:46.198: W/System.err(1460): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.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: http://code.google.com/p/google-http-java-client/issues/detail?id=230

@wonderfly

This comment has been minimized.

Copy link
Contributor Author

@wonderfly wonderfly commented Jan 9, 2015

From Asaf...@gmail.com on November 07, 2013 03:43:59

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:274)
11-07 13:33:26.489: W/System.err(29365): at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:486)
11-07 13:33:26.494: W/System.err(29365): at libcore.net.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:134)
11-07 13:33:26.494: W/System.err(29365): at com.google.api.client.http.javanet.NetHttpResponse.(NetHttpResponse.java:37)
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.executeUnparsed(AbstractGoogleClientRequest.java:410)
11-07 13:33:26.499: W/System.err(29365): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
11-07 13:33:26.499: W/System.err(29365): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)

@wonderfly

This comment has been minimized.

Copy link
Contributor Author

@wonderfly wonderfly commented Jan 9, 2015

From francesc...@gmail.com on February 02, 2014 10:52:37

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

@wonderfly

This comment has been minimized.

Copy link
Contributor Author

@wonderfly wonderfly commented Jan 9, 2015

From ykph...@gmail.com on February 06, 2014 18:36:19

I am getting the same issue with NetHttpTransport on Android 4.1. I switched to ApacheHttpTransport and the issue was gone.

@taylorsloan

This comment has been minimized.

Copy link

@taylorsloan taylorsloan commented Feb 20, 2015

Maybe this will help someone but I was having this issue too. I switched to ApacheHttpTransport and got an exception that said my server wasn't responding instead of the EOFException. It was intermittent just like the EOFException so I figured it was the same error causing it but a more concise message. So then I assumed that I was just doing too much work in my server's api method. I changed my backend code to be more efficient and switched back to AndroidHttp.newCompatibleTransport() and haven't had any problems since.

@Keshava11

This comment has been minimized.

Copy link

@Keshava11 Keshava11 commented Feb 3, 2016

In my project just running clean and rebuild android project removed the issue.

@wonderfly wonderfly removed their assignment May 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.