We are getting this error frequently in our crashlytics. Android app is not able to make connection to backend server. The error is not occurred for all users and is occurring for some users at different times. Sometimes reinstalling the app work, sometimes using VPN worked for users. However if we hit the backend server from postman or from any other way it is working.
The backend base path is in this format http://abc.xyz.in:8080 The backend server is hosted in aws via Elastic Beanstalk and route53. Domain is purchased via goDaddy.
Here is the stack trace <{our domain}> could not be resolved: network error.
org.xbill.DNS.Address.lookupHostName (Address.java:272)
org.xbill.DNS.Address.getByName (Address.java:311)
stock.ledger.commons.CustomHttpDns.lookup (CustomHttpDns.kt:62)
okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress (RouteSelector.kt:169)
okhttp3.internal.connection.RouteSelector.nextProxy (RouteSelector.kt:131)
okhttp3.internal.connection.RouteSelector.next (RouteSelector.kt:73)
okhttp3.internal.connection.ExchangeFinder.findConnection (ExchangeFinder.kt:205)
okhttp3.internal.connection.ExchangeFinder.findHealthyConnection (ExchangeFinder.kt:106)
okhttp3.internal.connection.ExchangeFinder.find (ExchangeFinder.kt:74)
okhttp3.internal.connection.RealCall.initExchange$okhttp (RealCall.java:255)
okhttp3.internal.connection.ConnectInterceptor.intercept (ConnectInterceptor.kt:32)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.kt:109)
okhttp3.internal.cache.CacheInterceptor.intercept (CacheInterceptor.kt:95)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.kt:109)
okhttp3.internal.http.BridgeInterceptor.intercept (BridgeInterceptor.kt:83)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.kt:109)
okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept (RetryAndFollowUpInterceptor.kt:76)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.kt:109)
stock.ledger.core.network.HttpErrorInterceptor.intercept (HttpErrorInterceptor.kt:19)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.kt:109)
com.mocklets.pluto.PlutoInterceptor.intercept (PlutoInterceptor.kt:12)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.kt:109)
stock.ledger.data.interceptor.HeaderInterceptor.intercept (HeaderInterceptor.kt:40)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.kt:109)
okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp (RealCall.kt:201)
okhttp3.internal.connection.RealCall$AsyncCall.run (RealCall.kt:517)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
java.lang.Thread.run (Thread.java:923)
We tried adding an interceptor for such error and calling backend from different domain, however it worked sometimes and sometimes still gives the error.
This is a generic error that is observed when a user doesn`t have a proper connection or user is using a restricted network like an office network that only allows specific URLs while others URLs were blocked.