UDP send exception: send: Operation not permitted

Official client software for OpenVPN Access Server and OpenVPN Cloud.
Post Reply
tschoening
OpenVpn Newbie
Posts: 17
Joined: Tue Jan 28, 2020 7:47 pm

UDP send exception: send: Operation not permitted

Post by tschoening » Mon Mar 30, 2020 8:17 am

Hi all,

I'm using the OVPN-client from the Play Store on some older Galaxy Note 4 with Android 6.0.1. Whenever I'm regularly using the phone myself, the established tunnel seems to be stable and I can use it as expected. Problems occur when I'm putting the phone aside for more then ~10 minutes, at some point the tunnel gets disconnected and the OVPN-client is not able to re-establish it automatically anymore. Whenever I take this phone in that situation and am using it manually again, logging in seems to be enough already in most cases, the tunnel gets successfully recreated instantly (mostly).

The logs look like the following when that problems occur, like the last night:

Code: Select all

04:30:30.578 -- UDP send exception: send: Operation not permitted
04:30:30.581 -- Session invalidated: KEV_NEGOTIATE_ERROR
04:30:30.582 -- Client terminated, restarting in 2000 ms...
04:30:30.582 -- Server poll timeout, trying next remote entry...
04:30:30.603 -- EVENT: RECONNECTING
04:30:30.619 -- EVENT: RESOLVE
04:30:30.636 -- Contacting [...]:1195 via UDP
04:30:30.637 -- EVENT: WAIT
04:30:30.656 -- Connecting to [...]:1195 (...) via UDPv4
04:30:30.657 -- UDP send exception: send: Operation not permitted
04:30:48.543 -- UDP send exception: send: Operation not permitted
04:30:48.544 -- Server poll timeout, trying next remote entry...
04:30:48.590 -- EVENT: RECONNECTING
04:30:48.619 -- EVENT: RESOLVE
04:30:48.640 -- Contacting [...]:1195 via UDP
04:30:48.641 -- EVENT: WAIT
04:30:48.695 -- Connecting to [...]:1195 (...) via UDPv4
04:30:48.696 -- UDP send exception: send: Operation not permitted
04:30:54.134 -- EVENT: CONNECTING
04:30:54.154 -- Tunnel Options:[...]
04:30:54.155 -- Creds: UsernameEmpty/PasswordEmpty
04:30:54.156 -- Peer Info:
IV_GUI_VER=OC30Android
IV_VER=3.git::728733ae:Release
IV_PLAT=android
IV_NCP=2
IV_TCPNL=1
IV_PROTO=2
IV_LZO_STUB=1
IV_COMP_STUB=1
IV_COMP_STUBv2=1
IV_AUTO_SESS=1
IV_BS64DL=1
04:30:54.675 -- VERIFY OK : depth=1[...]
04:30:54.678 -- VERIFY OK : depth=0[...]
04:30:56.201 -- SSL Handshake:[...]
04:30:56.204 -- Session is ACTIVE
04:30:56.206 -- EVENT: GET_CONFIG
04:30:56.230 -- Sending PUSH_REQUEST to server...
04:30:56.264 -- OPTIONS:[...]
04:30:56.266 -- PROTOCOL OPTIONS:[...]
04:30:56.267 -- EVENT: ASSIGN_IP
04:30:56.403 -- Connected via tun
04:30:56.404 -- Per-Key Data Limit: 48000000/48000000
04:30:56.405 -- LZO-ASYM init swap=0 asym=1
04:30:56.406 -- Comp-stub init swap=0
04:30:56.432 -- EVENT: CONNECTED info='...:1195 (...) via /UDPv4 on tun/[...]/ gw=[.../]'
04:42:21.988 -- UDP send exception: send: Operation not permitted
04:42:23.973 -- UDP send exception: send: Operation not permitted
04:42:23.976 -- UDP send exception: send: Operation not permitted
04:42:24.004 -- UDP send exception: send: Operation not permitted
04:42:28.781 -- UDP send exception: send: Operation not permitted
04:42:28.784 -- UDP send exception: send: Operation not permitted
04:42:28.786 -- UDP send exception: send: Operation not permitted
04:42:31.697 -- UDP send exception: send: Operation not permitted
04:42:35.592 -- UDP send exception: send: Operation not permitted
04:42:36.257 -- UDP send exception: send: Operation not permitted
04:42:48.006 -- UDP send exception: send: Operation not permitted
04:42:48.009 -- UDP send exception: send: Operation not permitted
04:42:58.318 -- UDP send exception: send: Operation not permitted
04:43:08.461 -- UDP send exception: send: Operation not permitted
04:43:08.464 -- UDP send exception: send: Operation not permitted
04:43:18.837 -- UDP send exception: send: Operation not permitted
04:43:29.365 -- UDP send exception: send: Operation not permitted
04:43:49.127 -- UDP send exception: send: Operation not permitted
04:43:59.461 -- UDP send exception: send: Operation not permitted
04:44:09.985 -- UDP send exception: send: Operation not permitted
04:44:20.401 -- UDP send exception: send: Operation not permitted
04:44:20.411 -- Session invalidated: KEEPALIVE_TIMEOUT
04:44:20.413 -- Client terminated, restarting in 2000 ms...
04:44:30.831 -- EVENT: RECONNECTING
04:44:30.853 -- EVENT: RESOLVE
04:44:30.885 -- Contacting [...]:1195 via UDP
04:44:30.886 -- EVENT: WAIT
04:44:30.904 -- Connecting to [...]:1195 (...) via UDPv4
04:44:30.905 -- UDP send exception: send: Operation not permitted
04:44:40.111 -- UDP send exception: send: Operation not permitted
04:44:50.692 -- Server poll timeout, trying next remote entry...
04:44:50.733 -- EVENT: RECONNECTING
04:44:50.779 -- EVENT: RESOLVE
04:44:50.795 -- Contacting [...]:1195 via UDP
04:44:50.797 -- EVENT: WAIT
04:44:50.823 -- Connecting to [...]:1195 (...) via UDPv4
04:44:50.824 -- UDP send exception: send: Operation not permitted
04:45:00.987 -- UDP send exception: send: Operation not permitted
04:45:00.987 -- Server poll timeout, trying next remote entry...
The key problem seems to be the message UDP send exception: send: Operation not permitted and I think it might have to do with some energy saving technology or stuff like that. The problem is that I think I already disabled everything related to this, but it keeps happening. Searching for the concrete error message reveals only one result reading pretty much like what I'm seeing, but without any solution.

Searching for similar messages reveals problems with nf_conntrack and that seems to be used on Android? But I have no idea if this is related or how I could disable that on a not rooted device.

Do you have any idea why UDP-sending might be disabled at some point and how to fix this? Thanks!

User avatar
Pippin
Forum Team
Posts: 1201
Joined: Wed Jul 01, 2015 8:03 am
Location: irc://irc.libera.chat:6697/openvpn

Re: UDP send exception: send: Operation not permitted

Post by Pippin » Mon Mar 30, 2020 8:55 am

Did you also try to exempt the VPN app from energy saving?
I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
Halton Arp

tschoening
OpenVpn Newbie
Posts: 17
Joined: Tue Jan 28, 2020 7:47 pm

Re: UDP send exception: send: Operation not permitted

Post by tschoening » Mon Mar 30, 2020 9:12 am

I think so, I disabled global and app-specific energy savings at all. Meaning I found a setting where the OVPN-client has been mentioned individually with other apps and disabled that setting at all instead of only for the client. Additionally, in that setting, the OVPN-client was not yet mentioned to be affected by app-specific energy saving, in contrast to some other mentioned apps. That setting seems to take effect after at least 3 days as well only, the OVPN-client was not even installed that long yet. So it's somewhat likely that this setting shouldn't be the root cause of the problem.

User avatar
Pippin
Forum Team
Posts: 1201
Joined: Wed Jul 01, 2015 8:03 am
Location: irc://irc.libera.chat:6697/openvpn

Re: UDP send exception: send: Operation not permitted

Post by Pippin » Mon Mar 30, 2020 11:23 am

I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
Halton Arp

tschoening
OpenVpn Newbie
Posts: 17
Joined: Tue Jan 28, 2020 7:47 pm

Re: UDP send exception: send: Operation not permitted

Post by tschoening » Mon Mar 30, 2020 1:17 pm

Good to read its a known issue, but the described settings are exactly those I had in mind already as well and disabled. :-/ Will simply try again from time to time, maybe I did something wrong before.

tschoening
OpenVpn Newbie
Posts: 17
Joined: Tue Jan 28, 2020 7:47 pm

Re: UDP send exception: send: Operation not permitted

Post by tschoening » Mon Mar 30, 2020 5:00 pm

Gave things an additional try with the settings mentioned in your links (and used before), but same problem like before. Maybe things depend on devices/patch level as well or some stuff.

Post Reply