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

UnknownHostException leads to error screen #860

Open
sk22 opened this issue Oct 21, 2024 · 1 comment
Open

UnknownHostException leads to error screen #860

sk22 opened this issue Oct 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@sk22
Copy link
Contributor

sk22 commented Oct 21, 2024

1. Environment

Version: 0.10.1
Device: Xiaomi 2201123G
System: Android 14 (API 34)

2. Describe the bug

I currently use Tailscale to connect to my NAS by hostname ("nas") – this leads to the app crashing when Tailscale isn't turned on.

I'd propose catching the exception (or network exceptions in general) and displaying something like a toast notification about the connection failure.

Version: 0.10.1
Device: Xiaomi 2201123G
System: Android 14 (API 34)

Stack trace: 

java.net.UnknownHostException: Unable to resolve host "nas": No address associated with hostname
	at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:156)
	at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103)
	at java.net.InetAddress.getAllByName(InetAddress.java:1152)
	at okhttp3.Dns$Companion$DnsSystem.lookup(Dns.kt:6)
	at okhttp3.internal.connection.RealRoutePlanner.plan(RealRoutePlanner.kt:469)
	at okhttp3.internal.connection.FastFallbackExchangeFinder.launchTcpConnect(FastFallbackExchangeFinder.kt:10)
	at okhttp3.internal.connection.FastFallbackExchangeFinder.find(FastFallbackExchangeFinder.kt:61)
	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:126)
	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:1015)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:126)
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:139)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:126)
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:174)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:126)
	at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:96)
	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:48)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
	at java.lang.Thread.run(Thread.java:1012)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@3245efc, Dispatchers.IO]
Caused by: android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)
	at libcore.io.Linux.android_getaddrinfo(Native Method)
	at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:133)
	at libcore.io.BlockGuardOs.android_getaddrinfo(BlockGuardOs.java:222)
	at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:133)
	at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:135)
	... 19 more

@sk22 sk22 added the bug Something isn't working label Oct 21, 2024
@quantenzitrone
Copy link

Same on Android 8.1.0 (API 27)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants