AdguardTeam / AdguardForiOS

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

Local VPN intermittently failing to reconnect when out of range of wifi, preventing internet access (DoH3) #2184

Closed ghost closed 1 year ago

ghost commented 1 year ago

Issue Details

Expected Behavior

Local VPN reconnects when connecting to mobile connection after dropping out of range of wifi.

Actual Behavior

Local VPN intermittently fails to reconnect after falling out of range of wifi and switching to a mobile connection, causing a total loss of internet until the mobile data is toggled manually, forcing the local VPN to connect again.

Additional Information

Logs sent to apple@adguard.com, with the GH issue as the subject.

ameshkov commented 1 year ago

Could you please check if there are any crash reports from AdGuard tunnel?

Settings -> Privacy -> Analytics & Improvements -> Analytics Data

ghost commented 1 year ago

@ameshkov not for 4.5, only from 4.4.6.

{"app_name":"AdguardPro","timestamp":"2023-06-13 18:04:18.00 +1000","app_version":"4.4.6","slice_uuid":"1AE268C5-97A1-335E-88AF-E8EDEF94B502","adam_id":1126386264,"build_version":"998","bundleID":"com.adguard.AdguardPro","duration_ms":"42113650","share_with_app_devs":0,"is_first_party":0,"bug_type":"145","os_version":"iPhone OS 16.6 (20G5037d)","incident_id":"1F56F849-0189-4B2B-9935-DB9A286F7F45","name":"AdguardPro","roots_installed":0}
Date/Time:        2023-06-13 06:22:21.246 +1000
End time:         2023-06-13 18:04:14.897 +1000
OS Version:       iPhone OS 16.6 (Build 20G5037d)
Architecture:     arm64e
Report Version:   40
Incident Identifier: 1F56F849-0189-4B2B-9935-DB9A286F7F45

Data Source:      Microstackshots
Shared Cache:     18FB2CDD-45A1-3B8E-9F27-16B9DA8288BB slid base address 0x1aa1ac000, slide 0x2a1ac000

Command:          AdguardPro
Path:             /private/var/containers/Bundle/Application/6F742D70-D68E-4B3C-861A-0D661029B171/AdguardPro.app/AdguardPro
Identifier:       com.adguard.AdguardPro
Version:          4.4.6 (998)
Adam ID:          1126386264
Is First Party:   No
Beta Identifier:  84B8B475-51EE-4EBE-9993-C2D5311BAE89
Resource Coalition ID: 1170
Architecture:     arm64
Parent:           UNKNOWN [1]
PID:              3349

Event:            disk writes
Action taken:     none
Writes:           1073.75 MB of file backed memory dirtied over 42114 seconds (25.50 KB per second average), exceeding limit of 12.43 KB per second over 86400 seconds
Writes limit:     1073.74 MB
Limit duration:   86400s
Writes caused:    1073.75 MB
Writes duration:  42114s
Duration:         42113.65s
Duration Sampled: 2.22s
Steps:            7 (10.49 MB/step)

Hardware model:   iPhone14,2
Active cpus:      6
HW page size:     16384
VM page size:     16384
ameshkov commented 1 year ago

@jslawler look for a file named "Tunnel" there

ghost commented 1 year ago

@ameshkov Tunnel logs sent to apple@adguard.com.

Versty commented 1 year ago

@jslawler Hi! We have examined the logs and crash report from your device, there is nothing pointing to specific errors in the AdGuard app. In your case, the unstable operation of the application may be caused by the beta version of iOS itself.

Versty commented 1 year ago

@jslawler Temporary closed, please reopen if the issue reproduces on a stable version of iOS.

ghost commented 1 year ago

@Versty there's been a few more reports on Telegram of the VPN reconnecting periodically throughout the day.

https://t.me/adguard_en/230540 https://t.me/adguard_en/230435

ameshkov commented 1 year ago

@jslawler that's different, VPN reconnection is a normal thing to happen. For instance, whenever settings change AdGuard will reconnect.

In your case the VPN was actually crashing without any visible reason for that. Unfortunately, crash report is not helpful at all so there's a chance that the crashes are due to iOS internal bugs.

ghost commented 1 year ago

@ameshkov I have rolled back to stable iOS within the last 6 hours, and in the last 20 minutes I've had 3 reconnections. I'm not sure about the time prior.

The first reconnection killed the network entirely, the second brought it back, and the third didn't have any noticeable impact on the network.

There has been 6 generated ProTunnel logs on iOS, no Tunnel logs, and no AdGuardPro logs. It seems with every restart, a new ProTunnel log is generated.

I'm not sure if this is helpful to you at all, or whether this was worth looking into further.

ameshkov commented 1 year ago

Note that reconnection also occurs on a network change and by itself the reconnection is not a problem.

The first reconnection killed the network entirely

The question is was the network okay at that moment or could it be that the signal was bad at the time?

ghost commented 1 year ago

The signal wouldn't have been bad being 5m from the router, and the router/ISP logs haven't recorded any packet loss.

That's not to say there was none, just there is none recorded.

For the meantime, due to the continued loss of network, I've switched back to a configuration file.

I'll raise it again if I end up going back to the in-app DNS implementation.