This issue is similar with another issue (#1410), but the symptom seems to be different. So I decided to open a new issue.
_Put an x inside the [ ] that applies._
Methods I tried but still no send/recv traffic:
Other attempts:
It seems that the only method to solve this problem temporarily is reboot.
I thought it's a bug related to VPN services in the Samsung OS, but I can hardly find similar issues on google (https://github.com/shadowsocks/shadowsocks-android/issues/1712#issuecomment-377424988) , so I wonder if some specific usage in ss triggered this bug in Samsung OS.
Thanks for the very helpful logcat. Unfortunately Netd and ConnectivityService are both system components. So I think this might be a bug of your ROM.
Does this issue also occur for 4.5.1? Does other VPN app works with your device?
my s8 has a problem, when you touch the circle button which start to connect, it doesn't work, you can't get any responses
but last version works well
I meant do you observe the similar behavior for other VPN apps before everything breaks down?
@Mygod I think maybe no one can keep a VPN connected for days? 😃
@madeye Maybe but unlike real VPNs, Shadowsocks is stateless.
@Coxxs Try switching between Wi-Fi and cellular networks frequently and see if that makes it happen more often. I'm suspecting some race condition somewhere.
It would probably be most helpful if you could get a logcat just after when connectivity is lost.
If possible, please also run adb shell ip addr.
Thanks. That's very helpful. I also tried your way on my Lineage OS for ~20 seconds and nothing happened.
Looking at your logcat, the most relevant lines are:
03-30 15:19:19.185 948 1229 E Netd : Error deleting IPv4 rule: No such file or directory
03-30 15:19:19.185 948 1229 E Netd : failed to remove interface tun0 from VPN netId 506
03-30 15:19:19.185 948 1229 E Netd : deleting network with netId 506 without clearing its interfaces
03-30 15:19:19.186 1523 1778 E ConnectivityService: Exception removing network: java.lang.IllegalStateException: command '120 network destroy 506' failed with '400 120 destroyNetwork() failed (No such file or directory)'
This is almost certainly a race condition. Unfortunately it's impossible to debug it because we don't have access to Samsung's source code.
Also good job finding that related issue. Now I'm certain there's nothing to do here since you can reproduce it also with airplane mode. Please wait for Samsung to release a fix. (you could also contact their support staff)
Tip on switching slowly: Shut down VPN, switch profile then start again.
It's a race condition. It doesn't happen every time. If you try it for an hour it will probably happen.
Shadowsocks does change the route. It tells netd which route to add to VPN tunnel otherwise no traffic will go through VPN.
Seems 9.0 Beta fixed this issue.
Most helpful comment
Tip on switching slowly: Shut down VPN, switch profile then start again.
It's a race condition. It doesn't happen every time. If you try it for an hour it will probably happen.
Shadowsocks does change the route. It tells
netdwhich route to add to VPN tunnel otherwise no traffic will go through VPN.