[BUG] - DNS settings ignored on WiFi connection: Application failing to honour manual configurations
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 4.2k
- Forks
- 3.1k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 7
Description
Actual behaviour
The application does not honour the manual DNS settings configured on my WiFi connection. However, I can access from Chrome
Expected behaviour
The application should use the manual DNS settings that are configured on my WiFi connection.
Steps to reproduce
- Connect to a WiFi network with manual DNS settings configured
- Open the application and access a website or service that requires DNS resolution
- Notice that the application does not use the manual DNS settings configured on the WiFi
Can this problem be reproduced with the official owncloud server?
(url: https://demo.owncloud.org, user: test, password: test)
Environment data
Android version: 13
Device model: SM-G780G (Samsung S20FE)
Stock or customized system: No
ownCloud app version: 3.0.4
Logs
ownCloud log (data/owncloud.log)
D: 2023-03-11 23:22:25:355(LogsProvider.kt:46) .startLogging()release start logging 3.0.4 218bd6fcd
V: 2023-03-11 23:22:27:527(MainApp.kt:142) $onCreate.onActivityPaused()SettingsActivity onPause() ending
D: 2023-03-11 23:22:27:540(MainApp.kt:102) $onCreate.onActivityCreated()LogsListActivity onCreate(Bundle) starting
V: 2023-03-11 23:22:27:556(MainApp.kt:129) $onCreate.onActivityStarted()LogsListActivity onStart() starting
V: 2023-03-11 23:22:27:557(MainApp.kt:138) $onCreate.onActivityResumed()LogsListActivity onResume() starting
V: 2023-03-11 23:22:28:014(MainApp.kt:146) $onCreate.onActivityStopped()SettingsActivity onStop() ending
V: 2023-03-11 23:22:28:015(MainApp.kt:155) $onCreate.onActivitySaveInstanceState()SettingsActivity onSaveInstanceState(Bundle) starting
V: 2023-03-11 23:22:29:326(MainApp.kt:142) $onCreate.onActivityPaused()LogsListActivity onPause() ending
V: 2023-03-11 23:22:29:335(MainApp.kt:129) $onCreate.onActivityStarted()SettingsActivity onStart() starting
V: 2023-03-11 23:22:29:337(MainApp.kt:138) $onCreate.onActivityResumed()SettingsActivity onResume() starting
V: 2023-03-11 23:22:29:671(MainApp.kt:146) $onCreate.onActivityStopped()LogsListActivity onStop() ending
V: 2023-03-11 23:22:29:673(MainApp.kt:159) $onCreate.onActivityDestroyed()LogsListActivity onDestroy() ending
V: 2023-03-11 23:22:30:661(MainApp.kt:142) $onCreate.onActivityPaused()SettingsActivity onPause() ending
V: 2023-03-11 23:22:30:667(MainApp.kt:159) $onCreate.onActivityDestroyed()LoginActivity onDestroy() ending
V: 2023-03-11 23:22:30:678(MainApp.kt:159) $onCreate.onActivityDestroyed()FileDisplayActivity onDestroy() ending
V: 2023-03-11 23:22:30:690(FileDisplayActivity.kt:174) .onCreate()onCreate() start
D: 2023-03-11 23:22:30:692(MainApp.kt:102) $onCreate.onActivityCreated()FileDisplayActivity onCreate(Bundle) starting
I: 2023-03-11 23:22:30:697(AccountAuthenticator.java:91) .addAccount()Adding account with type owncloud and auth token null
V: 2023-03-11 23:22:30:719(FileDisplayActivity.kt:240) .onCreate()onCreate() end
D: 2023-03-11 23:22:30:720(AppRater.java:53) .appLaunched()The app has been launched 9 times
D: 2023-03-11 23:22:30:720(AppRater.java:69) .appLaunched()The number of launches already exceed 2, the default number of launches, so let's check some dates
D: 2023-03-11 23:22:30:720(AppRater.java:71) .appLaunched()Current moment is 1678573350720
D: 2023-03-11 23:22:30:721(AppRater.java:72) .appLaunched()The date of the first launch + days until prompt is 1678570915294172800000
D: 2023-03-11 23:22:30:721(AppRater.java:74) .appLaunched()The date of the neutral click + days until neutral click is 086400000
V: 2023-03-11 23:22:30:722(MainApp.kt:129) $onCreate.onActivityStarted()FileDisplayActivity onStart() starting
D: 2023-03-11 23:22:30:724(DrawerActivity.kt:390) .updateQuota()Update Quota
V: 2023-03-11 23:22:30:726(FileDisplayActivity.kt:687) .onResume()onResume() start
V: 2023-03-11 23:22:30:727(MainApp.kt:138) $onCreate.onActivityResumed()FileDisplayActivity onResume() starting
W: 2023-03-11 23:22:30:727(DrawerActivity.kt:502) .setDrawerMenuItemChecked()setDrawerMenuItemChecked has been called with invalid menu-item-ID
V: 2023-03-11 23:22:30:727(FileDisplayActivity.kt:703) .onResume()onResume() end
V: 2023-03-11 23:22:30:735(OperationsService.java:120) .onDestroy()Destroying service
D: 2023-03-11 23:22:30:779(OperationsService.java:92) .onCreate()Creating service
V: 2023-03-11 23:22:30:782(FileDisplayActivity.kt:707) .onPause()onPause() start
V: 2023-03-11 23:22:30:782(MainApp.kt:142) $onCreate.onActivityPaused()FileDisplayActivity onPause() ending
V: 2023-03-11 23:22:30:783(FileDisplayActivity.kt:718) .onPause()onPause() end
D: 2023-03-11 23:22:30:793(FileActivity.java:385) $OperationsServiceConnection.onServiceConnected()Operations service connected
D: 2023-03-11 23:22:30:797(MainApp.kt:102) $onCreate.onActivityCreated()LoginActivity onCreate(Bundle) starting
V: 2023-03-11 23:22:30:823(MainApp.kt:129) $onCreate.onActivityStarted()LoginActivity onStart() starting
V: 2023-03-11 23:22:30:824(MainApp.kt:138) $onCreate.onActivityResumed()LoginActivity onResume() starting
V: 2023-03-11 23:22:30:872(MainApp.kt:146) $onCreate.onActivityStopped()FileDisplayActivity onStop() ending
V: 2023-03-11 23:22:30:873(FileDisplayActivity.kt:673) .onSaveInstanceState()onSaveInstanceState() start
V: 2023-03-11 23:22:30:874(MainApp.kt:155) $onCreate.onActivitySaveInstanceState()FileDisplayActivity onSaveInstanceState(Bundle) starting
V: 2023-03-11 23:22:30:875(FileDisplayActivity.kt:683) .onSaveInstanceState()onSaveInstanceState() end
V: 2023-03-11 23:22:30:876(MainApp.kt:146) $onCreate.onActivityStopped()SettingsActivity onStop() ending
V: 2023-03-11 23:22:30:878(MainApp.kt:159) $onCreate.onActivityDestroyed()SettingsActivity onDestroy() ending
D: 2023-03-11 23:22:42:214(OwnCloudClient.java:90) .<init>()#57Creating OwnCloudClient
D: 2023-03-11 23:22:42:215(OwnCloudClient.java:128) .saveExecuteHttpMethod()Executing in request with id 1242f5f9-b9f9-4294-bad6-0feca7d8c5ca
E: 2023-03-11 23:22:42:345(RemoteOperationResult.java:119) .<init>()---------------------------------
Create RemoteOperationResult from exception.
Message: UnknownHostException: Unable to resolve host "owncloud.dino.io": No address associated with hostname
Stacktrace: java.net.UnknownHostException: Unable to resolve host "owncloud.dino.io": 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:49)
at okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.kt:164)
at okhttp3.internal.connection.RouteSelector.nextProxy(RouteSelector.kt:129)
at okhttp3.internal.connection.RouteSelector.next(RouteSelector.kt:71)
at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:213)
at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:108)
at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:76)
at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:245)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:82)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:197)
at okhttp3.internal.connection.RealCall.execute(RealCall.kt:148)
at com.owncloud.android.lib.common.http.methods.nonwebdav.HttpMethod.onExecute(HttpMethod.kt:44)
at com.owncloud.android.lib.common.http.methods.nonwebdav.GetMethod.onExecute(GetMethod.kt:41)
at com.owncloud.android.lib.common.http.methods.HttpBaseMethod.execute(HttpBaseMethod.kt:75)
at com.owncloud.android.lib.common.OwnCloudClient.saveExecuteHttpMethod(OwnCloudClient.java:136)
at com.owncloud.android.lib.common.OwnCloudClient.executeHttpMethod(OwnCloudClient.java:106)
at com.owncloud.android.lib.resources.status.StatusRequester.request(StatusRequester.kt:85)
at com.owncloud.android.lib.resources.status.GetRemoteStatusOperation.tryToConnect(GetRemoteStatusOperation.kt:61)
at com.owncloud.android.lib.resources.status.GetRemoteStatusOperation.run(GetRemoteStatusOperation.kt:49)
at com.owncloud.android.lib.common.operations.RemoteOperation.runOperation(RemoteOperation.java:264)
at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:229)
at com.owncloud.android.lib.resources.status.services.implementation.OCServerInfoService.getRemoteStatus(OCServerInfoService.kt:53)
at com.owncloud.android.data.server.datasources.implementation.OCRemoteServerInfoDataSource.getRemoteStatus(OCRemoteServerInfoDataSource.kt:77)
at com.owncloud.android.data.server.datasources.implementation.OCRemoteServerInfoDataSource.getServerInfo(OCRemoteServerInfoDataSource.kt:92)
at com.owncloud.android.data.server.repository.OCServerInfoRepository.getServerInfo(OCServerInfoRepository.kt:31)
at com.owncloud.android.domain.server.usecases.GetServerInfoAsyncUseCase.run(GetServerInfoAsyncUseCase.kt:30)
at com.owncloud.android.domain.server.usecases.GetServerInfoAsyncUseCase.run(GetServerInfoAsyncUseCase.kt:26)
at com.owncloud.android.domain.BaseUseCaseWithResult.execute(BaseUseCaseWithResult.kt:30)
at com.owncloud.android.extensions.ViewModelExt$runUseCaseWithResult$1.invokeSuspend(ViewModelExt.kt:62)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
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)
... 46 more
---------------------------------
D: 2023-03-11 23:22:42:348(ViewModelExt.kt:64) $runUseCaseWithResult.invokeSuspend()Use case executed: GetServerInfoAsyncUseCase with result: Error(throwable=com.owncloud.android.domain.exceptions.ServerNotReachableException)
D: 2023-03-11 23:22:43:671(OwnCloudClient.java:90) .<init>()#58Creating OwnCloudClient
D: 2023-03-11 23:22:43:673(OwnCloudClient.java:128) .saveExecuteHttpMethod()Executing in request with id 78c99b52-b55f-4194-a027-996075c9a424
E: 2023-03-11 23:22:43:680(RemoteOperationResult.java:119) .<init>()---------------------------------
Create RemoteOperationResult from exception.
Message: UnknownHostException: Unable to resolve host "owncloud.dino.io": No address associated with hostname
Stacktrace: java.net.UnknownHostException: Unable to resolve host "owncloud.dino.io": No address associated with hostname
at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:124)
at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103)
at java.net.InetAddress.getAllByName(InetAddress.java:1152)
at okhttp3.Dns$Companion$DnsSystem.lookup(Dns.kt:49)
at okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.kt:164)
at okhttp3.internal.connection.RouteSelector.nextProxy(RouteSelector.kt:129)
at okhttp3.internal.connection.RouteSelector.next(RouteSelector.kt:71)
at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:213)
at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:108)
at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:76)
at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:245)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:82)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:197)
at okhttp3.internal.connection.RealCall.execute(RealCall.kt:148)
at com.owncloud.android.lib.common.http.methods.nonwebdav.HttpMethod.onExecute(HttpMethod.kt:44)
at com.owncloud.android.lib.common.http.methods.nonwebdav.GetMethod.onExecute(GetMethod.kt:41)
at com.owncloud.android.lib.common.http.methods.HttpBaseMethod.execute(HttpBaseMethod.kt:75)
at com.owncloud.android.lib.common.OwnCloudClient.saveExecuteHttpMethod(OwnCloudClient.java:136)
at com.owncloud.android.lib.common.OwnCloudClient.executeHttpMethod(OwnCloudClient.java:106)
at com.owncloud.android.lib.resources.status.StatusRequester.request(StatusRequester.kt:85)
at com.owncloud.android.lib.resources.status.GetRemoteStatusOperation.tryToConnect(GetRemoteStatusOperation.kt:61)
at com.owncloud.android.lib.resources.status.GetRemoteStatusOperation.run(GetRemoteStatusOperation.kt:49)
at com.owncloud.android.lib.common.operations.RemoteOperation.runOperation(RemoteOperation.java:264)
at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:229)
at com.owncloud.android.lib.resources.status.services.implementation.OCServerInfoService.getRemoteStatus(OCServerInfoService.kt:53)
at com.owncloud.android.data.server.datasources.implementation.OCRemoteServerInfoDataSource.getRemoteStatus(OCRemoteServerInfoDataSource.kt:77)
at com.owncloud.android.data.server.datasources.implementation.OCRemoteServerInfoDataSource.getServerInfo(OCRemoteServerInfoDataSource.kt:92)
at com.owncloud.android.data.server.repository.OCServerInfoRepository.getServerInfo(OCServerInfoRepository.kt:31)
at com.owncloud.android.domain.server.usecases.GetServerInfoAsyncUseCase.run(GetServerInfoAsyncUseCase.kt:30)
at com.owncloud.android.domain.server.usecases.GetServerInfoAsyncUseCase.run(GetServerInfoAsyncUseCase.kt:26)
at com.owncloud.android.domain.BaseUseCaseWithResult.execute(BaseUseCaseWithResult.kt:30)
at com.owncloud.android.extensions.ViewModelExt$runUseCaseWithResult$1.invokeSuspend(ViewModelExt.kt:62)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with OwnCloudClient.java and HttpMethod.kt, then follow the provided stack trace through okhttp3.Dns$Companion$DnsSystem.lookup. Reproduce the failure on Android 13 with manual WiFi DNS settings and compare it with the official ownCloud server. Done means the application resolves the server and no longer reports UnknownHostException in this configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile-dev, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100