Conversation
Two conditions on Android leave the home screen saying Connected while nothing works, and neither shows up in a logcat dump today. The Android core writes no log file, so a debug bundle only holds whatever is still in the logcat ring buffer; the lines that would explain a stuck tunnel are usually gone by the time anyone looks. Routes reach the OS only by rebuilding the VPN interface. When establish() fails during that rebuild, configureInterface swallows the error, recreateTUN returns silently, and the engine keeps believing the new route set is live. Log every exit of recreateTUN, the wanted versus applied route list on failure, and a one-line summary of each established tunnel. A null establish() is called out separately, since it means the app is no longer the prepared VPN. The NetBird resolver is left out of the tunnel whenever Android reports Private DNS in use on the active network. That check runs on every rebuild against whatever network is active at that moment, so the outcome depends on where the phone happened to be. Log the decision together with the network it was taken on, and log the Private DNS transitions and host resolver updates DNSWatch already tracks. Add a diagnostic snapshot, written before every debug bundle and every ten minutes while the engine runs: engine status, connected peers, the tunnel parameters we asked for, the routes the engine wants, whether the two agree, and what the OS actually holds on the VPN interface, plus always-on, lockdown and battery exemption state. It lands in the bundle's logcat.txt and reveals a route or DNS mismatch even after the events that caused it have rolled out of the buffer. Trim the two full NetworkCapabilities dumps in NetworkChangeDetector to a compact form and demote the per-change one to verbose; they were the noisiest lines in the buffer, which is the very resource these diagnostics compete for. currentTUNParameters becomes volatile: the snapshot reads it from the main thread while the tunnel builder writes it from the Go or TUN looper thread.
The snapshot stays as a one-shot before every debug bundle, where the user asked for help and the logcat picture is worth the line. Repeating it every ten minutes for the lifetime of the engine only fills the buffer, and the unchanged-routes renewal message fires on every network change, so it moves to debug level.
Contributor
|
Warning Review limit reachedNext included review available in 4 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the Android-side logging needed to diagnose route and DNS problems
from a logcat dump, which the Go status alone cannot explain.
routes) and the Private DNS decision together with the network it was
taken on; explain a null from establish().
one-line diagnostic snapshot (OS tunnel state vs. engine wants, active
network, always-on/lockdown, battery exemption) before every debug
bundle. currentTUNParameters becomes volatile as it is read across
threads.
per-capability dump to verbose.
No behaviour change beyond logging.