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

055e - Rethink freezes when network changes #1358

Closed
Kamika242 opened this issue Apr 11, 2024 · 29 comments
Closed

055e - Rethink freezes when network changes #1358

Kamika242 opened this issue Apr 11, 2024 · 29 comments
Assignees
Labels
bug Something isn't working P0 Priority: 0 (urgent and important)

Comments

@Kamika242
Copy link

Kamika242 commented Apr 11, 2024

Hi there,

when I leave my home wifi or another to mobile connection and the other way around, Rethink often freezes and blocks all connections, no way to open the app, only stopping the app via Androids app management helps here out. Had the same behavior with 055d, always went back to 055a from each subsequent version. Oppo Reno2, Android 11.

Sent a bug report from the app via email.

Anyway, RethinkDNS is awesome!

@ignoramous
Copy link
Collaborator

ignoramous commented Apr 11, 2024

We've got reports of this (ex on reddit), but don't see this issue ourselves, unfortunately.

  • Have you change any setting in Configure -> Network? If so, which ones?
  • Can you see if this issue persists in v055e (released to f-droid, GitHub, website)
  • Are you using System DNS or other custom upstream DNS? If so, which one?

@ignoramous ignoramous self-assigned this Apr 11, 2024
@ignoramous ignoramous added bug Something isn't working P0 Priority: 0 (urgent and important) labels Apr 11, 2024
@Kamika242
Copy link
Author

  • Have you change any setting in Configure -> Network? If so, which ones?

No, only the alternative DNS-Server to "Rethink". (Using Rethink-Plus and internal block lists normally)

Yes, the issue persists, F-Droid version. Today I have an home internet failure since the morning hours, but I only realised it after waking up through an information SMS from my provider, Rethink was frozen again on my phone, I think since the beginning of the internet failure. A try to open Rethink leads to a black screen, but sometimes to nothing.

  • Are you using System DNS or other custom upstream DNS? If so, which one?

Androids DNS preference (private DNS) ist set to "off", on my Fritzbox (router) is the AdGuard DNS set for covering the whole home network.

@ignoramous
Copy link
Collaborator

ignoramous commented Apr 12, 2024

Rethink was frozen again on my phone, I think since the beginning of the internet failure. A try to open Rethink leads to a black screen, but sometimes to nothing.

Very worrying.

Are you technical enough to grab adb logcat output (tutorial) exactly from when this issue happens? If so, enable Verbose mode in Configure -> Settings -> Log level, before capturing it.

You can email me the captured logs at mz at celzero dot com, if you're comfortable doing so (pls mention this github issue in the email).

on my Fritzbox (router) is the AdGuard DNS set for covering the whole home network

But Rethink is setup to use RDNS+ and not System DNS, correct?

@Kamika242
Copy link
Author

Very worrying.

Are you technical enough to grab adb logcat output (tutorial) exactly from when this issue happens? If so, enable Verbose mode in Configure -> Settings -> Log level, before capturing it.

Yes, I will try later. Years ago I had for one time something to do with logcat, so I have to look again, how it works.

But Rethink is setup to use RDNS+ and not System DNS, correct?

Correct! Additionally the same offline blocklists as set for RDNS+, if the DNS-Server fails and switches to RDNS Default, as set in Configuration->Network->Select Alternative DNS.

@anxiouslelimo
Copy link

I too had this issue. Resolved by toggling off "Never Proxy DNS" in Configure-DNS

@Kamika242
Copy link
Author

Ah, thanks for the hint, @anxiouslelimo. I will try this (again), but I can remember, that I just tried it with toggling every option, except experimental options, I leave them at "off" in principle.

@Kamika242
Copy link
Author

Kamika242 commented Apr 15, 2024

Issue still persists with "Never Proxy DNS" set to off. Just went out to pick a parcel from the parcel station, no connection to the DHL app there (and no other connections). I was able to open Rethink, seen the start screen with 0 app entries and 2 DNS entries, no other sections were selectable (frozen), had to force a stop of Rethink via Androids app management, opened Rethink again and the connections counter were quickly running up to more than 200 connections for each DNS and apps. It seems like the app freezes only in some parts, but the protocols are written again.

Edit: Arrived at home and while I wrote this comment on my tablet, no connections and a frozen Rethink again on the smartphone.

@ignoramous
Copy link
Collaborator

Arrived at home and while I wrote this comment on my tablet, no connections and a frozen Rethink again on the smartphone.

As mentioned above (#1358 (comment)), if you can grab logs from exactly when this happens, that'll help us debug and fix it.

@Kamika242
Copy link
Author

As mentioned above (#1358 (comment)), if you can grab logs from exactly when this happens, that'll help us debug and fix it.

I sent an email with a logcat attachment on last saturday, as mentioned above.

@anxiouslelimo
Copy link

@Kamika242 It doesn't happen to me anymore with Never Proxy DNS OFF as well as ON. Strange. Can you try clearing the cache once, force stop and restart the connection.

@ignoramous
Copy link
Collaborator

ignoramous commented Apr 16, 2024

sent an email with a logcat attachment on last saturday,

Thanks I got it. There's nothing in those logs to suggest connections were frozen. Also, I don't spot a network change in the logs either; you'll have to capture logs as you switch from wifi to mobile (not after) -- you can do this by turning off wifi & letting mobile network take over. I'll keep looking though.

@Kamika242
Copy link
Author

Kamika242 commented Apr 16, 2024

@anxiouslelimo, @ignoramous

Can you try clearing the cache once, force stop and restart the connection.

Tried several things yesterday. First I went back to v055a with an backup, the best working version for me until now, everything was fine. Later I updated to v055e again with an backup, disaster, error-messages and no or only very slow connection to RDNS+, fallback to alternative DNS server. Activated flight-mode, uninstalled completely with CLEANING CACHE AND APP DATA before, restarted device, installed v055a from a local apk, imported a suitable backup, deactivated flight-mode, updated to v055e via F-Droid, imported a suitable backup from the last previous installation, everything was fine, no error-messages again and connection to RDNS+ is very fast.
I had to setup a new Wireguard connection to my home-router (Fritzbox) and I changed the option "Total Lockdown" in the Wireguard settings to on. (Didn't realise this option before)

First I wanted to stay on v055a, but I also wanted to reproduce the faulty behaviour of v055e for a better logcat. I especially installed a logcat app from F-Droid, went out of home to physio therapy today, no connection interuptions and no freezes after changing to mobile network and even not the other way around, when I came back home.

I will still watch the situation, but I think cleaning of app data and cache really might have solved the problem. Until now v055e is running very smooth for the first time. 👍🏻

@Kamika242
Copy link
Author

Kamika242 commented Apr 16, 2024

@ignoramous

you can do this by turning off wifi & letting mobile network take over. I'll keep looking though.

I tried this several times, but it didn't trigger the issue. Only when W-Fi gets out of reach and the device changes by itself to mobile network and when the Wi-Fi network is reached again the issue is/was triggered. Ok, I could have set the Wi-Fi in my router to on or off, but I hadn't thought of that before. 😁

@Kamika242
Copy link
Author

Command back, rejoiced too soon, unfortunately. Rethink just was frozen and all connections were interrupted without any change of the network connection. Phone was laying on the couch beside me and I can't trace the time when it happened and a trigger. On an Android 9 tablet with Rethink and Orbot no such problems, apart from very rare crashes.

@ignoramous
Copy link
Collaborator

Another user writes,

Hi there. I am not sure if this is a bug or if I have done something wrong:
To be able to resolve hostnames on my local network, I think I'm forced to set DNS to 'System DNS'.

This works fine on my local dual-stack network, but as soon as I leave my wifi, Rethink can't resolve any DNS names. My guess is that this is due to the fact that my mobile network uses IPv6 DNS servers. So after trying various settings, the only workaround I could find was to set 'IP version' to 'Auto'.

Is this the expected behaviour or should I open an issue on Github?

@Kamika242
Copy link
Author

Kamika242 commented Apr 27, 2024

the only workaround I could find was to set 'IP version' to 'Auto'.

I am back on v055a for more than one week now, absolutely no problems, IP version in Rethink is set to IP4 from the beginning, because in my homenetwork I use IP4 only. I am on dual-stack too, but have set up my Fritzbox to force IP4 only, no need for IP6 and everything works fine.
This time I don't want to update to v055e again, no need for try and error again.

Anyway, the IP4 in home network and IP6 in mobile network context sounds very plausible to me.

@ignoramous
Copy link
Collaborator

ignoramous commented Apr 27, 2024

This time I don't want to update to v055e again

But: Will you try v055h? ;) We tried to fix this scenario some more by:

  1. Retrying System DNS over different IPs routes (irrespective of the tunnel IP version set to IPv4 or Auto or IPv6).
  2. Better tracking and consolidation of connectable routes (using Android's built-in APIs). This was mostly complicated by WireGuard as some of the peers may or may not support IPv4 / IPv6.

@Kamika242
Copy link
Author

Kamika242 commented Apr 27, 2024

But: Will you try v055h? ;)

Yes, definitely! 😁 (But I wait until it is available on F-Droid)

I will keep on reporting then.

Thx and have a nice weekend!

@Kamika242
Copy link
Author

Meanwhile I tried v055g from F-Droid, issue still persists. Settings: IP-version AUTO, perform connection checks ON. I think the IP4/6 stuff is not the fundamental problem, because everything works fine in v055a with IP4 only setting.

@ignoramous
Copy link
Collaborator

issue still persists

We can't reproduce what you're seeing (ie, "freezing") and hence don't know what the fix is.

Are you technical enough to capture and share logs from adb logcat (instructions above)?

@Kamika242
Copy link
Author

I just sent 2 logs via email, the last one on April, 18 including a detailed description, because I cant narrow down the exact time frame when the issue happens. There is nothing more I can do.

@Kamika242
Copy link
Author

Kamika242 commented May 10, 2024

No improvement in v055h. I'm currently in hospital and have free WiFi here which sometimes drops the connection after non usage for a certain time and also if not, RethinkDNS stops connecting often by itself, only the app freezes less frequently than before. Tried to turn on and off several options, disabled experimental functions, nothing helps.

The curious thing, the network log looks as if everything is good or at least some connections are possible while the dns log shows only connection failures. None of these problems on a Samsung Galaxy Tab A9+ here and at home and on an old Huawei MediaPad M5 at home.

screenshots network:

Screenshot_2024-05-09-14-43-47-24_c8cbde12d3521911922be4eee6a05664

dns:

Screenshot_2024-05-09-14-44-02-00_c8cbde12d3521911922be4eee6a05664

I think I'll stay on v055a forever on my Oppo, it's working fine, but with a little bit more power consumption, I can live with that.

@michaelblyons
Copy link

I'm currently in hospital

Get well soon! ❤️‍🩹

@ignoramous
Copy link
Collaborator

ignoramous commented May 10, 2024

Yikes. Get well soon.

only the app freezes less frequently than before

What do you mean by "app freezes"? Can you be more specific?

the network log looks as if everything is good or at least some connections are possible while the dns log shows only connection failures

Network logs are pointing to two things:

  • K9 Mail, Unbekannt are blocked by user-set rules. If you tap on those network log entries (against those apps) a bottomsheet should come up and, you should see just why it was blocked in the top right-hand corner of that bottomsheet.
  • Fritz is being forwarded over some user-set proxy.

As for DNS log, can you tap on the entries that are failing (the ones with ), and see what the footer of the bottomsheet that comes up, shows?

As for the logs you sent, there are no errors. I believe the logs are lost before you have had the chance to capture them, and so, can you increase the buffer size and then capture the next time you see this issue? To email these bigger-sized logs over email (mz at celzero dot com), you'd have to gzip / compress them first.

# note the current size; the default is usually 256kb
adb logcat -g

# increase log buffer size to 16mb
adb logcat -G 16M

# see if it switched to 16mb
adb logcat -g

# now, at some later time, when Rethink "freezes", capture logs again
# make sure Rethink is at "Verbose" in Configure -> Settings -> Log level

@Kamika242
Copy link
Author

Yikes. Get well soon.

Thx, it's just much better right now.

What do you mean by "app freezes"? Can you be more specific?

In some versions nothing happens when clicking the app icon or the dropdown menu entry, in some versions the surface of Rethink appears, but no actions are possible or instantly only a black screen appears. Tried v055i this night, in the morning all connections were blocked again and only a black screen for Rethink, nothing else. In every case the internet connection is blocked, only a forced stop in Android's app menu helps here out and then Rethink is working fine again for an unspecified time.

Network logs are pointing to two things:

* K9 Mail, Unbekannt are _blocked_ by user-set rules. If you tap on those network log entries (against those apps) a _bottomsheet_ should come up and, you should see just why it was blocked in the top right-hand corner of that _bottomsheet_.

* Fritz is being forwarded over some user-set proxy.

In K9 is nothing blocked by myself, K9 works normally when Rethink works normally.

Yes, Fritz (and 8 other apps) is always tunneled through Wireguard to my home network, these connections seem so work anyway, when all non tunneled connections are blocked by the issue. Curious.
But as I told, none of these problems in v055a, there must be a major change in on of the following versions, which causes the issue.

I'll try it again with the logcats. "Verbose" is set since you told me to do this in one of the past comments. I have a logcat app installed, isn't it much better than logcats via ADB?
The main problem is again, that the issue can't be reproduced "on command" and that I can't narrow down the exact time, when the issue happens.

Thank you and have a nice weekend, all of you!

@Kamika242
Copy link
Author

Folks, good news! I went back to v055a as always with an appropriate backup fitting this version and everything was fine again. Just wanted to try something in v055i two days later, made an update via F-Droid, toggled EVERY option in every section of v055i once, stopped and startet Rethink via the button and since that everything works smooth and stable for days and nights now, no app-freezes and/or connection drops anymore, I connected to several Wi-Fi networks in between and also made some device restarts from others reasons, the issue seems to be gone 🙏🏻. I could have had this idea earlier. 😁
Maybe it was really only a specific setting, which was "stucked" from the beginning on.

Thanks for your patience!

@ignoramous
Copy link
Collaborator

We've tried to improve some DNS related things in v055j that may have fixed what you're seeing. Can you try and let us know?

@Kamika242
Copy link
Author

Kamika242 commented May 31, 2024

We've tried to improve some DNS related things in v055j that may have fixed what you're seeing. Can you try and let us know?

Also in v055j and v055l (F-Droid) no problems concerning this issue anymore, I think it's gone! 🎉

@ignoramous
Copy link
Collaborator

ignoramous commented May 31, 2024

I think it's gone! 🎉

Thank you for showing so much patience and being generous with your time to help test this (:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P0 Priority: 0 (urgent and important)
Projects
None yet
Development

No branches or pull requests

4 participants