AdguardTeam / AdguardForAndroid

Open bug tracker for Android version of AdGuard.
https://adguard.com/
1.31k stars 89 forks source link

Lost network when Adguard is not foreground when using Automatic proxy. #5338

Open TigerBeanst opened 4 months ago

TigerBeanst commented 4 months ago

Please answer the following questions for yourself before submitting an issue

AdGuard version

4.4.189(10171804)

Environment

HTTPS filtering

Root access

Integration with AdGuard VPN

Routing mode

Automatic proxy

Which DNS server do you use?

Custom DNS

DNS protocol

None

Custom DNS

127.0.0.1:1053

Issue Details

If I keep Adguard on foreground, it works ok (almost all the time). If it in under background, my device will lost internet after a little time. I have sent the screenrecorder and logs to you.

It maybe cause by Clash For Android, the test version, which can use Shizuku to proxy network by tun. I use the Shizuku mode. Although I didnot turn on TUN mode, just turn on http/socks5 proxy and dns, but maybe the Shizuku mode will still break Adguard's Automatic proxy.

Base on #5287 , I create a new issue here. https://github.com/AdguardTeam/AdguardForAndroid/issues/5287#issuecomment-2134839064

Versty commented 4 months ago

@TigerBeanst Could you add detailed steps on how to reproduce this issue? Please add an info about Shizuku mode as well.

playaz44 commented 4 months ago

I was just about to write the same problem because I bounced with automatic messages from support. I identified an issue where if some other app messes with something on the connections (e.g. another VPN app) adguard sometimes freezes and you can't turn on protection manually or automatically. You must kill adguard to enable protection. I probably also know the reason for this, I checked in the root logs adguard access and it is in proxy mode requested only once at adguard startup, if something changes in the connection later, adguard does not request root access and is not able to set Internet system routes. The solution is to request root rights in proxy mode every time when adguard disables protection for some reason.

playaz44 commented 3 months ago

Ref

Versty commented 2 months ago

@TigerBeanst Does the issue persist on latest version of AdGuard (4.6.1)?

Versty commented 1 month ago

@TigerBeanst Any updates?

Versty commented 1 month ago

@playaz44 Could you also check with AdGuard for Android 4.6.1?

playaz44 commented 1 month ago

@playaz44 Could you also check with AdGuard for Android 4.6.1?

Hello, yes, the problem persists. I have pixel 7 pro root without sizuku

Versty commented 1 month ago

@playaz44

adguard sometimes freezes and you can't turn on protection manually or automatically. You must kill adguard to enable protection. I probably also know the reason for this, I checked in the root logs adguard access and it is in proxy mode requested only once at adguard startup, if something changes in the connection later, adguard does not request root access and is not able to set Internet system routes. The solution is to request root rights in proxy mode every time when adguard disables protection for some reason.

Are you allowing root access for AdGuard for the Once or Forever time period while starting the protection?

TigerBeanst commented 1 month ago

@TigerBeanst Any updates?

Sorry about being late. I have tried 4.7.10(10212591), it still lose my network.

Versty commented 1 month ago

@TigerBeanst @playaz44 We would like to take a look at the logs from your devices. Could you please collect the logs and send the file to our email following the steps below?

  1. Enable debug logging: Settings -> General -> Advanced -> Logging level -> Debug

  2. Wait for the issue to be reproduced, then remember the exact time when it happened

  3. Collect logs: Settings -> General -> Advanced -> Export logs and system info

  4. Send this file to devteam@adguard.com:

    • mention the 5338 number in the subject
    • specify the exact time when the issue occurred
TigerBeanst commented 1 month ago

@Versty Sent ;)

Versty commented 1 month ago

@TigerBeanst We are currently examining your logs and see that you have changed logging level to debug at 19:58:34. Did you experience the issue with network loss after that point and up until the time you exported the logs?

playaz44 commented 1 month ago

@playaz44

adguard sometimes freezes and you can't turn on protection manually or automatically. You must kill adguard to enable protection. I probably also know the reason for this, I checked in the root logs adguard access and it is in proxy mode requested only once at adguard startup, if something changes in the connection later, adguard does not request root access and is not able to set Internet system routes. The solution is to request root rights in proxy mode every time when adguard disables protection for some reason.

Are you allowing root access for AdGuard for the Once or Forever time period while starting the protection?

Root rights for adguard it's granted forever. The problem I wrote about is that adguard get root rights once at the start of the app and later never again ask for root perms.

//edit: I sent logs and provided the time of adguard crashed in email

TigerBeanst commented 1 month ago

@TigerBeanst We are currently examining your logs and see that you have changed logging level to debug at 19:58:34. Did you experience the issue with network loss after that point and up until the time you exported the logs?

Yes

playaz44 commented 1 month ago

I sent logs to support email almost a month ago highlighting this issue, can someone check it out?

Versty commented 3 weeks ago

@playaz44 We have received and examined your logs, thank you! Currently we are trying to reproduce this issue on our side and are looking for a proper fix.

Versty commented 3 weeks ago

@TigerBeanst @playaz44 Please disable the IPv6 filtering option in the low-level settings and monitor the application behavior for a while. Let me know if the issue persists.

playaz44 commented 3 weeks ago

@TigerBeanst @playaz44 Please disable the IPv6 filtering option in the low-level settings and monitor the application behavior for a while. Let me know if the issue persists.

After disabling ipv6 filtering the problem is resolved. Is the problem known or do I have open a new issue?

Versty commented 3 weeks ago

@playaz44 Glad to hear that the temporary solution helped. Will be resolved in this issue, so no need to create a new one.

Versty commented 1 week ago

@playaz44 Does this issue reproduce on your device in Local VPN operating mode with enabled IPv6 filtering option?

playaz44 commented 1 week ago

@playaz44 Does this issue reproduce on your device in Local VPN operating mode with enabled IPv6 filtering option?

I tested ipv6 filtering enabled in auto proxy and local vpn mode, the problem only occurs in auto proxy mode. On a local VPN, everything works as it should.

Versty commented 6 days ago

@playaz44 Would you mind sending more logs from your device in auto proxy mode with enabled IPv6 filtering? We need it in order to find and eliminate the exact cause.

If so, please follow the steps:

  1. Enable debug logging: Settings -> General -> Advanced -> Logging level -> Debug.

  2. Reproduce the problem, then remember the exact time when it happened.

  3. Collect logs: Settings -> General -> Advanced -> Export logs and system info.

  4. Send this file to qa@adguard.com:

    • include [android] keyword and 5338 in the subject of your email
    • specify the exact time when the issue occurred
playaz44 commented 1 day ago

@playaz44 Would you mind sending more logs from your device in auto proxy mode with enabled IPv6 filtering? We need it in order to find and eliminate the exact cause.

If so, please follow the steps:

  1. Enable debug logging: Settings -> General -> Advanced -> Logging level -> Debug.

  2. Reproduce the problem, then remember the exact time when it happened.

  3. Collect logs: Settings -> General -> Advanced -> Export logs and system info.

  4. Send this file to qa@adguard.com:

    • include [android] keyword and 5338 in the subject of your email
    • specify the exact time when the issue occurred

@Versty 4 days with IPv6 filtering enabled and I can't reproduce this issue, it looks like it's been magically fixed.