E/A Error, UnknownHostException, no address associated with hostname


  • Hi,
    on my poco x3 pro, android 11 (MIUI 12.5.1), i’m using DavX5 3.3.12.
    I very often get notifications telling me that it’s unable to resolve the host - while my phone is offline -.
    I’m using netguard as firewall, but have configured DavX5 to always be allowed.
    It seems as if davx5 assumes it’s connected and tries to sync until it fails.
    Is this maybe a known issue or a case with a fix that i just haven’t discovered?
    It works fine otherwise, when i manually sync there are no errors. When my phone is offline there’s even a message in the main davx5 screen notifying me about this state, so i assume it is capable of correctly detecting the connection status.
    This is the error:

    EXCEPTION
    java.net.UnknownHostException: Unable to resolve host "210801uocihsuwiujmk.nextcloud.hosting.zone": No address associated with hostname
    

    Here’s an excerpt from the logs:

    SOFTWARE INFORMATION
    
    ┌───────────────────────────────────┬────────────────────────────────────┬───────────┬─────────────────────────────────────┬───────┐
    │ Package                           │ Version                            │ Code      │ Installer                           │ Notes │
    ├───────────────────────────────────┼────────────────────────────────────┼───────────┼─────────────────────────────────────┼───────┤
    │ at.bitfire.davdroid               │ 3.3.12-ose                         │ 303120005 │ com.google.android.packageinstaller │       │
    │ org.dmfs.tasks                    │ 1.4.2                              │ 82200     │ com.google.android.packageinstaller │       │
    │ com.android.providers.contacts    │ 11                                 │ 30        │ —                                   │       │
    │ com.android.providers.calendar    │ 10.0.5.0                           │ 10000500  │ —                                   │       │
    │ com.google.android.apps.messaging │ 7.6.063 (Maple_RC06.phone_dynamic) │ 76063063  │ —                                   │       │
    └───────────────────────────────────┴────────────────────────────────────┴───────────┴─────────────────────────────────────┴───────┘
    
    
    SYSTEM INFORMATION
    
    Android version: 11 (RKQ1.200826.002 test-keys)
    Device: Xiaomi M2102J20SG (vayu)
    Locale(s): [de_DE]
    
    CONNECTVITY
    
    
     ☒ tun0
       - [ Transports: VPN Capabilities: INTERNET NOT_RESTRICTED TRUSTED VALIDATED NOT_ROAMING FOREGROUND NOT_CONGESTED NOT_SUSPENDED AdministratorUids: [] RequestorUid: -1 RequestorPackageName: null]
       - DNS: 8.8.8.8, 8.8.4.4, 2001:4860:4860::8888, 2001:4860:4860::8844
     ☐ rmnet_data1
       - [ Transports: CELLULAR Capabilities: IMS NOT_METERED TRUSTED NOT_VPN VALIDATED NOT_ROAMING FOREGROUND NOT_CONGESTED NOT_SUSPENDED TEMPORARILY_NOT_METERED LinkUpBandwidth>=15000Kbps LinkDnBandwidth>=30000Kbps Specifier: <TelephonyNetworkSpecifier [mSubId = 1]> AdministratorUids: [] RequestorUid: -1 RequestorPackageName: null]
       - DNS: 
    
    Data saver: disabled
    
    
    CONFIGURATION
    
    App standby bucket: 5
    Power saving disabled: yes
    System-wide synchronization: automatically
    
    Notifications:
     - sync isBlocked=false
      * syncProblems: importance=3
      * syncIoErrors: importance=1
      * syncWarnings: importance=2
     - cert4android: importance=3
     - status: importance=2
     - general: importance=3
     - debug: importance=4
    

  • Also, you should allow people to delete their posts (it’s currently not allowed after 1h has passed, but is crucially necessary if for example one notices that sensible information may have been disclosed, or just anything one does not want crawler-bots to scavenge for).

  • developer

    @polymo said in E/A Error, UnknownHostException, no address associated with hostname:

    Also, you should allow people to delete their posts (it’s currently not allowed after 1h has passed, but is crucially necessary if for example one notices that sensible information may have been disclosed, or just anything one does not want crawler-bots to scavenge for).

    Sounds good. I have disabled the time limit, so postings are now editable for 1 day and deletable forever.

    Do you want to delete it?


  • @rfc2822 i just wanted to edit it, but it didn’t allow me, so i though i’d just delete and re-create it, which greeted me with the same message.

  • developer

    @polymo Ok.

    I see there’s an active VPN connection. Does the problem also occur without this VPN connection?

    Can you connect to the host name with your Android’s browser?


  • @rfc2822 This is from netguard, which i don’t want to disable. otherwise i can connect to the host just fine, also through the browser. I can even sync just fine in general. It’s just that it seems to try to sync at times when my screen is off and there’s no connection (i only enable mobile data on demand).
    As for netguard, i’m using the always-on VPN feature of android, and the screen-on-rule evaluation of netguard (which is enabled by default) for certain apps; but davx5 is set as always allowed in any case.
    The strange thing is that this even happens in airplane mode sometimes.
    I’ll try with netguard disabled, this will probably take some time for results.

  • developer

    @polymo Sounds like the VPN is not ready at some time, but Android is already starting sync. Then DAVx5 starts to sync and because of the missing network connection, the above error appears.

    Normally, Android should start sync only when there’s an Internet connection (which is why it checks Internet availability regularly).


  • @rfc2822 So, i disabled netguard for the last 9 hours with the phone in airplane mode. I got none of the sync failed messages, interestingly. Then i disabled airplane mode (no internet connection yet) - still nothing. 10 minutes later i enabled netguard, but not mobile data (nor wifi -> still being offline) - which is when the davx5 sync-fail messages appeared.
    Captive portal checks and similar things, as suggested by the netguard wiki/internet, are enabled/allowed, so regular connectivity checks should succeed (confirmed by all related system feedback mechanisms working as expected). I’m not sure which part is faulty now; but davx5 is the only app that pops up those ~connection failed notifications, no other app does, and i have a few that also sync data or use push notifications etc.

  • developer

    @polymo Well DAVx5 just syncs when Android tells it to sync. To sync, it resolves the host name by using the system API, which fails. I don’t know what it should do else…


  • @rfc2822 Maybe do a check for internet connectivity before doing the resolving part.
    I’ve posted this question in the netguard forum too, maybe i can get a hint there.
    My wild guess is that it’s related to the vpn-nature of netguard and that something creates a situation in which either connectivity is falsely reported or is in an ambiguous state in which syncing is triggered anyway, and only davx5 reacts with an error message.
    I can see the ambiguous state being a valid case, as netguard refreshes its rules in certain cases (like screen on/off, wifi/mobile data on/off), effectively restarting the vpn service, i think; which sometimes felt like the exact point at which those messages appeared.


  • OK, the developer of netguard suggested removing davx5 completely from all rule evaluation by the app (not just whitelisting it) which now seems to make it work as expected. Looks like it was an android/netguard/vpn issue to begin with


  • Here’s a link to an article (in german ) that mentions what is very likely the source of this issue:
    https://www.kuketz-blog.de/android-conversations-und-seltsame-dns-anfragen-in-netguard/

    They mention that when an always-on VPN is active and a DNS request is made with no network available (no DNS servers assigned to the interfaces) android seems to return a list of default DNS servers (possibly as fallback).
    So it may be in the best interest of the app trying to establish a connection to check for actual network availability first.

Similar topics

  • 10
  • 4
  • 1