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

Not getting any response from Retrofit GET api call #1332

Closed
MacSimmy opened this issue Nov 30, 2015 · 1 comment
Closed

Not getting any response from Retrofit GET api call #1332

MacSimmy opened this issue Nov 30, 2015 · 1 comment

Comments

@MacSimmy
Copy link

Hi,
Sometimes I do not get response from GET api call using Retrofit. I dont know what causing the problem actualluy but sometimes when app run first time after installation, I get this error. Full log from Retrofit Library are below:

11-30 15:44:18.810 22172-22229/com.retail D/Retrofit: ---- ERROR https://api.parse.com/1/classes/HomeContent/50ddQ9dQZb
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit: java.net.UnknownHostException: Unable to resolve host "api.parse.com": No address associated with hostname
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at java.net.InetAddress.lookupHostByName(InetAddress.java:457)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:252)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at java.net.InetAddress.getAllByName(InetAddress.java:215)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.HostResolver$1.getAllByName(HostResolver.java:29)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:232)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:124)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:272)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:211)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:373)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:323)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:491)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at retrofit.client.UrlConnectionClient.readResponse(UrlConnectionClient.java:73)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at retrofit.client.UrlConnectionClient.execute(UrlConnectionClient.java:38)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:326)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at retrofit.Platform$Android$2$1.run(Platform.java:142)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at java.lang.Thread.run(Thread.java:818)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:  Caused by: android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at libcore.io.Posix.android_getaddrinfo(Native Method)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:55)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at java.net.InetAddress.lookupHostByName(InetAddress.java:438)
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:252) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at java.net.InetAddress.getAllByName(InetAddress.java:215) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.HostResolver$1.getAllByName(HostResolver.java:29) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:232) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:124) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:272) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:211) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:373) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:323) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:491) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at retrofit.client.UrlConnectionClient.readResponse(UrlConnectionClient.java:73) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at retrofit.client.UrlConnectionClient.execute(UrlConnectionClient.java:38) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:326) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at retrofit.CallbackRunnable.run(CallbackRunnable.java:42) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at retrofit.Platform$Android$2$1.run(Platform.java:142) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit:     at java.lang.Thread.run(Thread.java:818) 
11-30 15:44:18.810 22172-22229/com.retail D/Retrofit: ---- END ERROR

I really want to know it this problem from Retrofit or My back end which is Parse.com

@JakeWharton
Copy link
Member

The network is unable to resolve your host. This isn't a problem with Retrofit and it's something your application code has to handle.

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

2 participants