GrapheneOS / AppStore

MIT License
268 stars 29 forks source link

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

Closed dm-canteen closed 4 months ago

dm-canteen commented 6 months ago

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

thestinger commented 6 months ago

It already should only be checking when online.

muhomorr commented 6 months ago

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.

dm-canteen commented 6 months ago

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.

thestinger commented 6 months ago

You probably want to know if your network is broken.

thestinger commented 6 months ago

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

dm-canteen commented 6 months ago

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

muhomorr commented 6 months ago

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

muhomorr commented 6 months ago

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

thestinger commented 6 months ago

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

dm-canteen commented 6 months ago

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.

Sfcyber commented 5 months ago

Me too.

dm-canteen commented 4 months ago

@Sfcyber

Me too.

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

thestinger commented 4 months ago

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

Sfcyber commented 4 months ago

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

thestinger commented 4 months ago

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

Sfcyber commented 4 months ago

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

thestinger commented 4 months ago

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

Sfcyber commented 4 months ago

@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 commented 4 months ago

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

thestinger commented 4 months ago

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 commented 4 months ago

It's not a bug.

thestinger commented 4 months ago

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.

Sfcyber commented 4 months ago

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