-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
[BUG] - Auto tunnelling does not switch on the tunnel #127
Comments
Hello! Do you have tunnel on mobile data enabled? |
Thank you for the screenshot! A few more follow up questions.. Does this happen every time you close the app or just sometimes? Is the auto tunnel service in paused state on the main screen? Could you try starting auto tunneling, closing the app, turning off your wifi on your phone, and then see if it auto tunnels? Basically, I am trying to determine if this failure only happens after the auto tunnel service has been running for a while (maybe the system killed it) or if it happens consistently every time you test. |
Just sometimes.
State is active
In the moment it works. But sometimes not. I can not reproduce it.
I think it is a "run for a while" problem |
I have the same issue using the Play store version, with a Pixel 8. The auto-tunnel will not connect the tunnel when I disconnecte from wifi or when I leave wifi coverage. Is there a way to enable some logging to understand what is going on ? |
Hello! Thank you for the additional info. I'm sorry for the delay. I should have a fix out for this soon. Additionally, the next version of the app I am adding a logs screen to view the logs. |
I have seen that 3.3.9 is now available. |
Hey! It usually takes about a week, but there are currently some issues with Fdroid pipeline because I have a lib that is still in process of getting published to maven central. It is currently hosted on my own package repository, but fdroid doesn't support this. Current issues for this is #47 |
F-Droid is currently upgrading to Debian Bookworm which has Java 17 installed by default. It will take a cycle or two, so breakage is expected until done. |
Added tunnel settings feature where users can configure a tunnel to be used on certain SSID or with mobile data. Closes #50 Added feature where if a tunnel was active when phone restarted, the app will start that tunnel on boot. Removed automatic auto-tunnel toggling/override from the tunnel tile and app shortcuts as it can cause undesirable behavior. Added second tile to control auto-tunneling pause/resume state from a tile. Added two additional static shortcuts to be able to control auto-tunneling pause/resume state from shortcuts. Fixed bug where crashes can happen from serializing and deserializing tunnel configs by removing the need for serialization of tunnel configs. Refactored logic of watcher and tunnel service to make state more predictable. #127 Fixed bug where rapidly toggling tunnels can cause crashes. Closes #145 Improved how tunnels are manually toggled from one to another. Improved logic/storage around primary tunnel behavior. Fixes issue where info level logs were not populating on release builds. Increase allowed name length displayed in UI. Closes #143 Fixes bug where androidTV could crash in certain situations. Bump versions. Updated screenshots.
I'm seeing the same issue. The tunnel is not always automatically enabled on entering untrusted wifi or mobile data. For me too it seems like a "run for a while" problem. When I start the WG tunnel app, it immediately enables the tunnel. |
I'll keep investigating. This is a very hard one to troubleshoot. Do you know if the auto tunneling notification was still visible when you noticed this issue or was it closed? Also, do you have any rough estimate on how often this occurs so I can try to replicate on a few different devices? |
I probably swiped that icon away manually. I'll keep it present and see what happens. |
So it just happened once more. The icon reporting "monitoring network state changes: active" was still present. When I clicked it, the WG tunnel UI was opened and it resumed auto tunneling. |
I got exactely the same, auto-tunnel did not activate, when opening the application immediatly re-established the connection, the log only start from when I opened the application, despite the notification being shown. |
I'm seeing the same thing. It happened to me once yesterday and once today. The toggle indicated I was connected, but I clearly wasn't. Once I opened the app, I was immediately connected. Both times the auto tunneling notifications were visible. Thanks for the great app! |
I have the same issue. After a time, even though the notifications are active, the tunnel doesn't start when it should. A point of reference is that I changed the notifications to "silent" in the Android notification settings. |
I'm still working on getting to the bottom of this one. This is a top priority. |
I made some changes to the latest release 3.4.3 that could potentially help with this issue. Please let me know if anyone notices any differences or if this issue is still persisting. |
Unfortunately, only version 3.4.2 is available on F-Droid. The app has now been updated to 3.4.4... |
Yeah, Fdroid build/deployment pipelines takes up to one week. If you want updates immediately, feel free to add my custom Fdroid repo to the Fdroid app. |
In your custom Repo only version 3.4.2 is available, too via F-Droid app. |
Hmm. Are you sure you have the repo added properly? I'm able to install 3.4.4 with my repo via F-droid. |
I had to uninstall the F-Droid version to be able to install the one from the WGTunnel repository. |
I have the same issue that the Auto connect / disconnect is not doing anything for me. I installed the Store version on LineageOS, enabled "Tunnel on mobile data", enabled "Tunnel on untrusted wifi" and added my WiFi SSID. I also tried with setting a default tunnel and not (I only have one tunnel anyway). My tests was always done by turning the wifi off and on and waiting a minute. Maybe I am testing wrong and wifi should be enabled, but you have to leave the wifi zone? |
This specific use case has a bug that I'm currently working on where it does not turn on the tunnel when switching from wifi to mobile data. I should have a fix out for this soon! |
Not sure if this belongs here or in a new issue but I'm having similar problems with auto-tunneling. In my case I want to connect to a specific tunnel when I connect to a specific WiFi network. I've added the SSID to the 'Use tunnel on wifi name' field on the settings page for the tunnel and enabled auto-tunneling but when I connect to that WiFi network nothing happens. |
I've just released a new version 3.4.5. Could you try this on that version and see if you are getting the same behavior? Also, could you please share your phone model and version? Please make sure you also have "tunnel on untrusted wifi" enabled on the settings screen and auto tunneling started and not in the paused state. |
Turning on 'tunnel on untrusted wifi' makes it work. The tunnel activates when connect to the WiFi network. However, I don't want to tunnel on all untrusted networks, currently this is the only network I want to tunnel on. Is that possible? |
Not currently possible, but I have had a request for a similar feature so I'll work on adding this. |
Thank you. |
Hi, I'm seeing this same issue. Running 3.4.5 In general tab, When I start auto-tunnel it connects to the tunnel it should. But if network changes, it just disconnects until I open the app again and only then it autoselects the right tunnel. And other issues: In my use case that I want a persistent vpn, why can't I check always on vpn? Thanks |
I am able to reproduce this issue. I working on releasing a fix right now. As for the other issue: One notification is to persist the vpn service the other is for the service watching network/state changes for auto tunneling. On Android 14, these persistent notifications can be dismissed. You can still enable AOVPN in Android setting still, that setting just doesn't allow AOVPN to control bringing up the tunnel so it does not conflict with auto tunneling. |
Please give this version and shot and see if it fixes the issues you are seeing. https://github.com/zaneschepke/wgtunnel/releases/tag/3.4.6 |
@zaneschepke 3.4.6 is working for me!! Regarding the notifications, using the official wireguard client I am able to hide it if setting AOVPN. Why is it different here? |
I'll take a look. There would still need to be at least one for the auto tunnel service. |
I am having the same issue, my phone will sometimes auto-tunnel correctly but after a while it stops. If I open the app, it resumes tunneling correctly immediately. Permissions for battery/location are set correctly and notifications for monitoring are active. As an additional note, there has been a few times where the auto-tunnel will be active even when I am connected to a trusted Wi-Fi network. Opening the app usually turns the tunnel off immediately but there have been a few times I have needed to manually stop the tunnel. I am guessing this might be the same issue, tunnel was started when I was out and then the app entered this "long running" state and didn't disconnect when I got home because it was killed in the background or something. Phone: Pixel 8 Edit: I also want to add I think this is something with the newer phones/android versions handling background processes. Ever since I upgraded from my Pixel 3 to a Pixel 8 I have been seeing issues like this with a few apps which need to stay alive in the background. For example, I have a 3rd party photo syncing app: even with all permissions given, notifications on, and battery optimizations etc. turned off in the settings it eventually stops working (gets put to sleep/killed I assume). For that photo app I resorted to using Tasker to automatically open and then close the app every day at 3 AM which is a really ugly solution but seems to work okay. When I was reading around about this before, it sounded like the battery optimization settings only do so much and eventually the OS will kill/sleep old processes regardless. Also had issues with the official Gmail app not sending real time notifications. Apparently the Gmail app used to have some internal flag at the system level to always keep it alive and then they changed it. I very rarely open my email app instead just using the notifications to skim the mail then swipe it away, so probably the same thing was happening there where it put the process to sleep because I was not actually opening the app. |
Just came by to mention that in the last few weeks I didn’t see the issue occuring. Difficult to prove absence of something, but it's looking good from where I'm sitting. |
I'm still having the issue. Sitting at the dentist office right now on 5G and the VPN has not connected but is monitoring. Just opened the app right now though and it immediately switched on. |
I can confirm this behavior when I'm at work. I will try to create some logs tomorrow. |
Strangely enough, I had the opposite problem today. I connected to a non trusted wifi, and the tunnel came up. When I reconnected to my trusted wifi, the tunnel stayed up. As soon as I opened the app, it correctly disconnected the tunnel. |
Today I was able to reproduce the issue and created logs. I'm using the latest version 3.4.7 in Kernel Mode on P8 Pro on A14 with the latest firmware AP2A.240705.005. |
Please try this prerelease build that I'm hoping fixes this issye: https://github.com/zaneschepke/wgtunnel/releases/tag/auto-tunnel-reliability-testing |
Describe the bug
When I leave my house and the trusted WiFi, Auto Tunnelling does not switch the tunnel on. Only when I open the app.
I have set everything correctly, allowed permanent location access and switched off battery optimisation.
Smartphone (please complete the following information):
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Auto tunnelling should switch on the tunnel when you leave the trusted WiFi even without having to open the app.
Screenshots (Only if necessary)
Additional context
The text was updated successfully, but these errors were encountered: