Closed jakobahlin closed 4 years ago
Code for this part is already changed on master, so you may want to check if that is working better for you. If problem persists, can you provide tcpdump of that management connection?
Thanks! I'm not able to reproduce the problem with the code from master, so probably the issue is gone after those changes 👍
Now I'm getting this sometimes:
Exception: invalid literal for int() with base 10: ">NEED-OK:Need 'token-insertion-request' confirmation MSG:Please insert eToken token", Type: <class 'ValueError'>
Traceback (most recent call last):
File "checkOpenvpnTunnelstate.py", line 19, in main
state = v.get_state().state_name
File "/usr/local/lib/python3.7/dist-packages/openvpn_api-1.0.0-py3.7.egg/openvpn_api/vpn.py", line 154, in get_state
return State.parse_raw(raw)
File "/usr/local/lib/python3.7/dist-packages/openvpn_api-1.0.0-py3.7.egg/openvpn_api/models/state.py", line 87, in parse_raw
up_since = datetime.datetime.utcfromtimestamp(int(parts[0])) if parts[0] != "" else None
ValueError: invalid literal for int() with base 10: ">NEED-OK:Need 'token-insertion-request' confirmation MSG:Please insert eToken token"
I have a feeling the two issues you've had are related, I think the first one was hiding the second one.
Valid bug, we're only handling notifications starting >INFO
, >CLIENT
or >STATE
at the moment, is this using code from master or 0.3.0?
...is this using code from master or 0.3.0?
From master
~Give that a go, it shouldn't blow up there now.~
Oh hang on I forgot to commit a file :man_facepalming:
Try that instead
Sometimes when I'm trying to get the state for a tunnel I get the exception below: .
It happens perhaps once in 20 attempts. I don't see a pattern when it happens, e.g if it happens with a particular state of the tunnel (however in the example below the tunnel was in state AUTH). What more information do you need?
I'm using version 0.3.0
From the openvpn logs:
My code: