Page MenuHomeVyOS Platform

OpenVPN: UnboundLocalError after merging server_network PullRequest
Closed, ResolvedPublicBUG

Description

With the following test configuration the error can be reproduced:

set interfaces openvpn vtun1 description 'fooo bar'
set interfaces openvpn vtun1 local-address 10.255.1.2
set interfaces openvpn vtun1 local-host '172.18.201.10'
set interfaces openvpn vtun1 local-port '1195'
set interfaces openvpn vtun1 mode 'site-to-site'
set interfaces openvpn vtun1 persistent-tunnel
set interfaces openvpn vtun1 protocol 'udp'
set interfaces openvpn vtun1 remote-address '10.255.1.1'
set interfaces openvpn vtun1 remote-host '172.18.202.10'
set interfaces openvpn vtun1 remote-port '1195'
set interfaces openvpn vtun1 shared-secret-key-file '/config/auth/openvpn-1.key'
Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/interfaces-openvpn.py", line 886, in <module>
    c = get_config()
  File "/usr/libexec/vyos/conf_mode/interfaces-openvpn.py", line 482, in get_config
    default_server = getDefaultServer(server_network, openvpn['server_topology'], openvpn['type'])
UnboundLocalError: local variable 'server_network' referenced before assignment

Details

Difficulty level
Normal (likely a few hours)
Version
1.3-rolling-202004140117
Why the issue appeared?
Implementation mistake
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

c-po triaged this task as Unbreak Now! priority.
c-po created this task.
c-po changed Difficulty level from Unknown (require assessment) to Normal (likely a few hours).
c-po changed Why the issue appeared? from Will be filled on close to Implementation mistake.
c-po changed Is it a breaking change? from Unspecified (possibly destroys the router) to Perfectly compatible.

The previous commit didn't fix it, this one does: https://github.com/vyos/vyos-1x/pull/348

I verified it with the supplied config.

jjakob moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus board.
erkin set Issue type to Bug (incorrect behavior).Mon, Aug 30, 7:04 AM
erkin removed a subscriber: Active contributors.