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

Notifications "Error checking for updates connection refused failed host lookup" Happening when offline #1120

Open
S7venLights opened this issue Nov 25, 2023 · 32 comments
Labels
bug Something isn't working HTTP This bug/feature is related to downloads or other HTTP requests

Comments

@S7venLights
Copy link

S7venLights commented Nov 25, 2023

Describe the bug
I've had this bug for over a month now, only getting time to report now.
When my phone is offline in airplane mode the app still attempts update checks on my 3 hour schedule.
I know, because I get a bunch of individual notification all at once for each app that fails. The notifications fill up my screen, one on top of the other and aren't grouped. . Most say 'failed host lookup'
This happens whether or not the setting 'Disable background updates when not on wifi' is toggled on or off.
When i am connected to wifi in airplane mode, updates work fine.

Expected behavior: The app wouldn't attempt updates if the phone is offline and wifi is off.

To Reproduce
Mentioned above.
I also use InviZible pro in VPN mode, but I've excluded Obtainium from going through TOR.

Screenshots and Logs
Not necessary, logs just show each app saying "failed host lookup"

Please complete the following information:

  • Device: Pixel 3
  • OS: GrapheneOS
  • Obtainium Version: 0.14.35-beta (PS when will Obtainium qualify as Vesion 1? I've been here since the start, it seems pretty complete haha)

Additional context
Thanks for the app as always.

@S7venLights S7venLights added bug Something isn't working to check Issue has not been reviewed labels Nov 25, 2023
@S7venLights S7venLights changed the title "Error checking for updates connection refused failed host lookup" Happening when offline Notifications "Error checking for updates connection refused failed host lookup" Happening when offline Nov 25, 2023
@ImranR98 ImranR98 removed the to check Issue has not been reviewed label Dec 1, 2023
@ImranR98
Copy link
Owner

I haven't been able to reproduce this - airplane mode works fine for me. Could you confirm if this is happening even with VPN completely turned off? I'm wondering if this interferes even if Obtainium is excluded.

Also could you provide screenshots of the errors showing up individually? They should be grouped.

PS when will Obtainium qualify as Vesion 1?

I would probably have removed the beta label by now if it wasn't for #608.

@ImranR98 ImranR98 added the needs follow up Further information is requested label Dec 17, 2023
@S7venLights
Copy link
Author

signal-2023-12-20-235621

@ImranR98
Copy link
Owner

Ah okay - the ungrouped notifications are normal since it's not the same host (multiple apps from the same host will result in a single grouped notification).

The screenshot shows wifi+VPN - is this happening even when both are off?

@S7venLights
Copy link
Author

S7venLights commented Dec 21, 2023

It happens only while wifi is off, although I Ieft the phone on last night with no wifi or data connection and the VPN disabled as you asked before and this issue didn't present. Testing with the VPN only (no internet) today again.

@ImranR98
Copy link
Owner

ImranR98 commented Jan 1, 2024

Not sure if there are any updates on your end but the BG task plugin was changed in v0.15.0 so the behaviour might be different now.

@S7venLights
Copy link
Author

Behavior has been different, no longer had errors showing, but also background updates seemed to stop working (There were no checks happening) but i see 0.15.11 has enabled 'start on boot' for the BG task, so I imagine that will fix things. This issue is probably closed

@krohrsb
Copy link

krohrsb commented Feb 10, 2024

This happens to me once or twice a day. No VPN involved, at home wifi available. I had just figured my phone went into some sleep type mode where wifi maybe isn't on or some such. I'll try to be more cognizant of conditions next time now that I know there is an issue about it.

@S7venLights
Copy link
Author

Background updates have been working again, I occasionally get the list of notifications of all the error checking updates when offline still.

Perhaps a separate issue, all of the DivestOS f-droid repo apps have been getting 'Connection timed out' errors for days now.
May be the repo server is down or may be an Obtainium issue I'm not sure.

@DwainZwerg
Copy link
Contributor

DwainZwerg commented Feb 11, 2024

Perhaps a separate issue, all of the DivestOS f-droid repo apps have been getting 'Connection timed out' errors for days now. May be the repo server is down[…].

Doesn't seem to be the case. At least it looks good in the browser (but that doesn't necessarily have to tell anything): https://divestos.org/apks/official/fdroid/repo/

@Grishnackh
Copy link

I get the same error recurringly when the phone is in airplane mode. This can be quiet annoying especially when the alarm of the notification wakes you up in the night. It would be highly appreciated if the checks would only happen when there is an active internet connection.

@OkyDooky
Copy link

I have the same issue as Grishnackh. This has been going on for months for me, but when it woke me up this morning (because I forgot to silence notifications), I decided something needed to be done. Kind of glad it's not just me, but I hope it gets resolved soon.

@ceskyDJ
Copy link

ceskyDJ commented Apr 17, 2024

I think I have similar problems like other posters from this thread. Sometimes I wake up and see a few notifications from Obtainium saying that the host lookup failed (from Obtainium logs):
Screenshot_20240417_070909.jpg

I don't use VPN or any of the special ”night modes“ triggering airplane mode or something like that. I just use DND (Do Not Disturb) mode provided by Android (14). The device seems to stay connected according to logs from Home Assistant, so it's a little weird behavior. I don't know, why the host lookup fails at all. This is an output from the ICMP ping sensor:
Screenshot_20240417_073529_Home Assistant.jpg

So, I want to help a bit more but I just don't know what kind of information could help you to identify the cause. If you get an idea, please give me a message.

@ImranR98 ImranR98 removed the needs follow up Further information is requested label May 22, 2024
@S7venLights
Copy link
Author

This issue hasn't presented for a long while now, probably fixed

@Grishnackh
Copy link

The issue still persists when you're connected to a permanent VPN and then switch to airplane mode. When the scheduled check is triggered, the error appears as notification recurringly.

@ImranR98 ImranR98 added the HTTP This bug/feature is related to downloads or other HTTP requests label Jun 15, 2024
@S7venLights
Copy link
Author

The issue still persists when you're connected to a permanent VPN and then switch to airplane mode. When the scheduled check is triggered, the error appears as notification recurringly.

Not for me in the same conditions. May be unique to your device or sources?

@cybgh7
Copy link

cybgh7 commented Jun 19, 2024

I can confirm the issue persists with current Obtainium version on a Pixel 8 with GrapheneOS. I am using RethinkDNS, which is creating a permanent active VPN. As soon as WiFi is disabled, a lot of those (ungrouped) error messages appear.

@cybgh7
Copy link

cybgh7 commented Jun 26, 2024

Is there any more information I can give to find the root cause of that problem? I guess it must have to do something with the always-on-vpn (RethinkDNS).

@Grishnackh
Copy link

In my opinion the check in

if (netResult.contains(ConnectivityResult.none)) {
is insufficient. When wifi and mobile data is turned off but you're connected to a permanent VPN (like RethinkDNS) the above check will return ConnectivityResult.vpn most likely (not tested).

One solution could be a real connection attempt with a network request. I don't like that too much, maybe it's enough to simply check for mobile, wifi, ethernet, bluetooth or other. If none of these are active, one could assume that the device has no internet connection.

By the way: the plugin "Connectivity" 3.0.6 used for the connectivity check is deprecated. Better use connectivity_plus: 6.0.3 instead.

@ceskyDJ
Copy link

ceskyDJ commented Jun 27, 2024

In my opinion the check in

if (netResult.contains(ConnectivityResult.none)) {
is insufficient. When wifi and mobile data is turned off but you're connected to a permanent VPN (like RethinkDNS) the above check will return ConnectivityResult.vpn most likely (not tested).

One solution could be a real connection attempt with a network request. I don't like that too much, maybe it's enough to simply check for mobile, wifi, ethernet, bluetooth or other. If none of these are active, one could assume that the device has no internet connection.

By the way: the plugin "Connectivity" 3.0.6 used for the connectivity check is deprecated. Better use connectivity_plus: 6.0.3 instead.

Hi, as you seem to understand it pretty well… Could you look at it and make a pull request, please?

@Grishnackh
Copy link

I just investigated a bit in the debugger. When you're only connected to a (permanent) VPN the connectivity check indeed returns [ConnectivityResult.vpn]. When you're connected to both, a wifi and VPN, the check results in [ConnectivityResult.wifi, ConnectivityResult.vpn].

While testing I discovered the option "Disable background updates when not on WiFi". I'll first check if this already resolves my issues with the current background checks. Have you tried this already, @ceskyDJ?

@ceskyDJ
Copy link

ceskyDJ commented Jun 27, 2024

I don't have these problems after some update. It seems like the problems stayed just for users who uses permanent VPNs (which I used to use, but not use these days).

@ImranR98
Copy link
Owner

@Grishnackh thanks for looking into this. Sounds like if the connectivity result contains vpn and nothing else, we can assume there is no internet.

@ImranR98 ImranR98 added the TODO Issue to focus on for the next release label Jun 29, 2024
@ImranR98
Copy link
Owner

While testing I discovered the option "Disable background updates when not on WiFi". I'll first check if this already resolves my issues

This would also resolve the issue but not on mobile data.

@issuant
Copy link

issuant commented Jun 30, 2024

signal-2023-12-20-235621

Same issue. Phone is permanently in airplane mode with an always-on vpn.

Background updates are (and always have been) turned off but a 'Checking for updates' notification shows up once the phone is turned on and moments later, there's a loud notification accompanied with errors like in the screenshot.

If you clear them and open Obtanium or an app page within, it repeats itself. Although 'Check for updates on startup' and 'on opening an App detail page' are both enabled, it could just error out with a no internet message.

@cybgh7
Copy link

cybgh7 commented Jun 30, 2024

While testing I discovered the option "Disable background updates when not on WiFi". I'll first check if this already resolves my issues with the current background checks. Have you tried this already, @ceskyDJ?

This option does not solve the problem for me. When background updates are enabled and the mentioned option "Disable background updates when not on WiFi" is enabled the error messages still occur when WiFi and mobile data are disabled and always-on-vpn exists (when turning on WiFi again).

ImranR98 added a commit that referenced this issue Jul 15, 2024
- Attempt bugfix for error when on VPN (#1120)
- Translation fixes (#1699)
- GitHub search bugfix (#1705)
- Fix missing trailing slash for path-less URLs (#1715)
- Rename Codeberg to Forgejo (#1722)
- Rename "Version String Extraction" to "Trim Version String" for non-HTML Sources (#1723)
@ImranR98
Copy link
Owner

I added the ConnectivityResult.vpn check suggested by @Grishnackh: https://github.com/ImranR98/Obtainium/releases/tag/v1.1.14
Not sure if it helps with every scenario mentioned above, we'll see if the error still occurs.

@ImranR98 ImranR98 removed the TODO Issue to focus on for the next release label Jul 15, 2024
@Grishnackh
Copy link

After upgrading to 1.1.14 the issue is gone for me, I had no more annoying notifications. Thank you very much, @ImranR98.

@wanzh5
Copy link

wanzh5 commented Jul 17, 2024

I added the ConnectivityResult.vpn check suggested by @Grishnackh: https://github.com/ImranR98/Obtainium/releases/tag/v1.1.14 Not sure if it helps with every scenario mentioned above, we'll see if the error still occurs.

It seems that version v1.1.14 still has a bug. When I turn on WIFI and VPN, it still prompts "Host search failed".

@Grishnackh
Copy link

@wanzh5 Are you sure this is related to this issue? The fix from @ImranR98 addressed particularly the situation when you're connected to a (permanent) VPN without any other connection like wifi, bluetooth or ethernet. The above fix won't apply when you're connected to wifi + VPN.

Do you use any ad blockers or custom DNS settings?

@cybgh7
Copy link

cybgh7 commented Jul 18, 2024

I can also confirm the problem is gone in v1.1.14, thanks!

@bats6931
Copy link

I'm still getting this issue in v1.1.23. I'm an always-on VPN user. Once I open the app, the update check seems to work fine. Happy to try and provide more info if needed.

@etorres07
Copy link

FWIW, giving Obtainium unrestricted battery permissions solved this for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working HTTP This bug/feature is related to downloads or other HTTP requests
Projects
None yet
Development

No branches or pull requests