Apps icon indicating copy to clipboard operation
Apps copied to clipboard

"Unable to fetch list of apps" not handled gracefully for DNS or Network errors

Open dm-canteen opened this issue 10 months ago • 10 comments

I am frequently with no WiFi/Cellular and have the GrapheneOS Apps updater checking during these periods.

I frequently get a notification that Apps was "Unable to fetch list of apps" along with the error java.net.UnknownHostException: Unable to resolve host "apps.grapheneos.org"...

Would it be possible to have this error be handle gracefully, so that when offline Apps will just silently fail to check for updates?

Many thanks for your time

dm-canteen avatar Mar 28 '24 06:03 dm-canteen

It already should only be checking when online.

thestinger avatar Mar 28 '24 12:03 thestinger

Are you using a VPN? It seems that some of them falsely claim that device is online when it isn't, or isn't yet.

muhomorr avatar Mar 29 '24 07:03 muhomorr

I'm not using a VPN, but i think this might occur when switching between WiFi networks. I did also discover you can disable the notification channel "Background update check failed" but I still think java.net.UnknownHostException shouldn't notify.

dm-canteen avatar Apr 01 '24 20:04 dm-canteen

You probably want to know if your network is broken.

thestinger avatar Apr 01 '24 20:04 thestinger

@dm-canteen Switching between Wi-Fi networks will trigger the OS considering internet temporarily unavailable including stopping jobs.

thestinger avatar Apr 01 '24 20:04 thestinger

You probably want to know if your network is broken.

It could indeed be broken, but if so it's the default behavior of my router(s) and Graphene when switching. If I immediately tap the notification and then check for updates it goes through fine. It seems the job is run after re-connecting but my network isn't actually ready; a la:

It seems that some of them falsely claim that device is online when it isn't, or isn't yet.

Feel free to close if you think it's just a quirk of my setup

dm-canteen avatar Apr 01 '24 20:04 dm-canteen

@dm-canteen Are internet connectivity checks enabled in Settings -> Network & internet -> Internet connectivity checks ?

muhomorr avatar Apr 02 '24 10:04 muhomorr

I've reproduced this issue by disabling internet connectivity checks, connecting to a Wi-Fi network with no internet access and then running the UpdateCheckJob: adb shell cmd jobscheduler run app.grapheneos.apps 1001

muhomorr avatar Apr 02 '24 10:04 muhomorr

It's an expected consequence of internet connectivity checks being off if they're off.

thestinger avatar Apr 02 '24 15:04 thestinger

Yes, they are enabled and set to the GrapheneOS servers. I also noticed PrivateDNS was set to Automatic, which I have just changed to Off.

dm-canteen avatar Apr 02 '24 15:04 dm-canteen

Me too.

Sfcyber avatar May 10 '24 01:05 Sfcyber

@Sfcyber

Me too.

Are you using a VPN? Are internet connectivity checks enabled in Settings -> Network & internet -> Internet connectivity checks ?

dm-canteen avatar May 15 '24 01:05 dm-canteen

If your VPN is causing the issue, it implies that the VPN is not properly reporting when it's up or down.

thestinger avatar May 15 '24 01:05 thestinger

How to solve. That's the message I get.

Unable to download Vanadium: Unable to resolve the server name.

Details: java.net.UnknownHostException: Unable to resolve host "apps.grapheneos.org": No address associated with hostname

Sfcyber avatar Jun 01 '24 00:06 Sfcyber

@Sfcyber Your network isn't allowing resolving the apps.grapheneos.org domain name. You'll need to fix that.

thestinger avatar Jun 01 '24 00:06 thestinger

My network? Just now the webview has been updated, only Vanadium does not update.

Sfcyber avatar Jun 01 '24 00:06 Sfcyber

Yes, this error means that your network isn't working correctly. It means it can't correct to apps.grapheneos.org because it can't resolve the name to an IP via DNS. This is an issue with your DNS or network connection.

java.net.UnknownHostException: Unable to resolve host "apps.grapheneos.org": No address associated with hostname

thestinger avatar Jun 01 '24 00:06 thestinger

@Sfcyber Your network isn't allowing resolving the apps.grapheneos.org domain name. You'll need to fix that.

My network? Just now the webview has been updated, only Vanadium does not update.

Sfcyber avatar Jun 01 '24 00:06 Sfcyber

Yes, this error means that your network isn't working correctly. It means it can't correct to apps.grapheneos.org because it can't resolve the name to an IP via DNS. This is an issue with your DNS or network connection.

java.net.UnknownHostException: Unable to resolve host "apps.grapheneos.org": No address associated with hostna

automatic DNS

Sfcyber avatar Jun 01 '24 00:06 Sfcyber

It's an issue with your network. If you're using a VPN, it's an issue with the VPN. If you're not, it's an issue with the mobile data or Wi-Fi connection depending on which you're using.

thestinger avatar Jun 01 '24 00:06 thestinger

It's not a bug.

thestinger avatar Jun 01 '24 00:06 thestinger

Does not appear to be a bug. There isn't really much that can be done to work around this in Apps as far as we can tell.

thestinger avatar Jun 01 '24 00:06 thestinger

Does not appear to be a bug. There isn't really much that can be done to work around this in Apps as far as we can tell.

OK, I'm going to make some changes here, then I'll let you know here. Thanks

Sfcyber avatar Jun 01 '24 00:06 Sfcyber