AdguardTeam / AdguardForiOS

The most advanced ad blocker for iOS
https://adguard.com/
GNU General Public License v3.0
1.46k stars 203 forks source link

AdGuard TestFlight build 4.3.3 (947) breaks internet when switching WiFi/4G #1958

Open dobby1970 opened 2 years ago

dobby1970 commented 2 years ago

Prerequisites

Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

Issue Details

Expected Behavior

adguard should restart itself to fix issues with network ### Actual Behavior adguard is blocking all internet connection I don't even get push notifications, it get fixed if you turn off and on adguard manually ### Screenshots
Screenshot:

Additional Information

ghost commented 2 years ago

I have the same issue, but on the App Store release version.

Restarting the app does not resolve the issue in my situation, only a full device restart does.

Toggling off DNS protection allows the internet to work again, but as soon as it's toggled back on the internet stops working again on mobile data.

I have pulled debug logs for this whilst the issue was happening. @ameshkov, where would you like me to send these?

ameshkov commented 2 years ago

@gGkAC3qfszbdViFkw4Fk9ooS2u yeah, the log will be helpful.

Restarting the app does not resolve the issue in my situation, only a full device restart does.

Quick question - do you have another VPN app working at the same time?

ghost commented 2 years ago

@ameshkov I have no VPN apps, or any other network altering capabilities.

AdGuard_logs.zip

ameshkov commented 2 years ago

@sfionov need your expertise here.

Look for NWPathMonitor received the current path update lines in the log. It seems that at some point after receiving one of that callbacks the existing connection stops working and times out.

sfionov commented 2 years ago

@ameshkov I see that on 16:51:27 NWPathMonitor detected network change to pdp_ip0. Curl was reconnected and eventually switched to single IPv6 connection.

However, there was additional NWPathMonitor network change detections, last on 16:51:32. After that, on 16:51:40, Curl connection was timed out, and several subsequent requests too.

I assume that something in network configuration was changed between 16:51:27 and 16:51:32 (local address?) but was not detected, so DNS proxy wasn't restarted.

zzebrum commented 2 years ago

@dobby1970 does the issue still happen on the latest AdGuard version 4.4.0?

ghost commented 2 years ago

@dobby1970 does the issue still happen on the latest AdGuard version 4.4.0?

For what it's worth, this same issue has since been reported multiple times on Reddit and Telegram. Unchecked on other support mediums. Examples below.

Telegram @Antonio Birota Reddit u/secpoc

An issue was raised in the incorrect repo for another report of the above. https://github.com/AdguardTeam/AdGuardHome/issues/4566

antplus commented 2 years ago

Upgrading to v4.4.0 made no difference in my case. DNS fails when going from WIFI to cellular. I tested with both AdGuard VPN and ProtonVPN as well no VPN. All tests lead to no DNS on cellular. Toggling airplane mode does not fix the issue either, the only option is to disable AdGuard Pro.

ameshkov commented 2 years ago

Okay now I am really puzzled, the change in v4.4.0 should've resolved it (and it did resolve it for many users, but apparently not for everyone).

@antplus could you please reproduce the issue, export the logs and send them to devteam@adguard.com?

Please mention this issue in the email.

antplus commented 2 years ago

@ameshkov I will gather the logs in the morning following the transition to cellular. I ran through all the tests again today after rebooting the phone to rule out any issues after the v4.4.0 upgrade, still just a dns blackhole once out of wifi range.

EDIT. Logs have been sent to the dev team email.

EDIT2: I did test the bootstrap options to see if there was a DOH/DOT resolution issue (using plain internet based DNS addresses), that did not help either.

ameshkov commented 2 years ago

@antplus thank you for the logs!

The reason for this:

  1. The switch occurs between an IPv4-only and IPv6-only network.
  2. At the same time, it tries to use the system default DNS (which are set by AdGuard VPN), which are IPv4.
  3. It cannot reach those DNS servers using the supplied bootstrap servers.

The quick fix would be to manually set bootstrap DNS servers to the following list (that includes both IPv4 and IPv6):

94.140.14.140
2a10:50c0::1:ff
antplus commented 2 years ago

Thanks @ameshkov .

This might be a silly question, but how are multiple bootstrap addresses added? The UI says "bootstrap IP address", entering the single IPv4 works fine but I cannot add the v6 address. I also tried a comma separated entry which gives an error. With the single v4 bootstrap address the phone still fails to resolve any DNS entries on cellular.

ameshkov commented 2 years ago

They should be just comma-separated. However, the validation fails if at least one of them is unavailable so setting these two is tricky, need to do that when you're connected to a network where both a present.

Self-note: syntax validation is enough for this place, we shouldn't try to be smarter than that

antplus commented 2 years ago

They should be just comma-separated. However, the validation fails if at least one of them is unavailable so setting these two is tricky, need to do that when you're connected to a network where both a present.

Self-note: syntax validation is enough for this place, we shouldn't try to be smarter than that

I've tried both space, comma, carriage return, etc. Not seeing the option to add the second address.

image

++++++++

image

antplus commented 2 years ago

Any updates on this? Can I ask what was fixed in v4.4.0 that is not available for me? I don't have a special configuration or device. A couple of years ago when I started using AdGuard Pro with ProtonVPN everything worked flawlessly, it then started degrading to a point where it sometimes worked to now, which is completely broken. So I'll ask again, what was fixed in v4.4.0 and why doesn't it apply to my setup?

antplus commented 2 years ago

Bumping the above, please help.

ameshkov commented 2 years ago

Nothing changed yet. As I've said, to pass the validation check you need to be on the network that supports both IPv4 and IPv6. Unfortunately, until the issue is fully resolved this is the only way.

antplus commented 2 years ago

Just checking in after 3 months. Any news here? Is the DNS blackhole issue on IOS cellular sorted?

tehguitarist commented 2 years ago

Checking in on this, seeing if there is a fix in the works?