Strange "Options error: Unrecognized option or missing or extra parameter(s) in [...]" with OpenVPN

Hi all,

I successfully set up VPN client with the help of : https://lede-project.org/docs/user-guide/openvpn.client

VPN connection is OK but I have errors in log I don't understand...

Thu Feb  1 23:26:33 2018 daemon.err openvpn(pia_auth)[1877]: Options error: Unrecognized option or missing or extra parameter(s) in /etc/openvpn/pia_auth.conf:1: USERNAME (2.4.4)
Thu Feb  1 23:26:33 2018 daemon.warn openvpn(pia_auth)[1877]: Use --help for more information.
Thu Feb  1 23:26:38 2018 daemon.err openvpn(pia_auth)[1878]: Options error: Unrecognized option or missing or extra parameter(s) in /etc/openvpn/pia_auth.conf:1: USERNAME (2.4.4)
Thu Feb  1 23:26:38 2018 daemon.warn openvpn(pia_auth)[1878]: Use --help for more information.
Thu Feb  1 23:26:43 2018 daemon.err openvpn(pia_auth)[1879]: Options error: Unrecognized option or missing or extra parameter(s) in /etc/openvpn/pia_auth.conf:1: USERNAME (2.4.4)
Thu Feb  1 23:26:43 2018 daemon.warn openvpn(pia_auth)[1879]: Use --help for more information.
Thu Feb  1 23:26:48 2018 daemon.err openvpn(pia_auth)[1880]: Options error: Unrecognized option or missing or extra parameter(s) in /etc/openvpn/pia_auth.conf:1: USERNAME (2.4.4)
Thu Feb  1 23:26:48 2018 daemon.warn openvpn(pia_auth)[1880]: Use --help for more information.
Thu Feb  1 23:26:53 2018 daemon.err openvpn(pia_auth)[1881]: Options error: Unrecognized option or missing or extra parameter(s) in /etc/openvpn/pia_auth.conf:1: USERNAME (2.4.4)
Thu Feb  1 23:26:53 2018 daemon.warn openvpn(pia_auth)[1881]: Use --help for more information.
Thu Feb  1 23:26:58 2018 daemon.err openvpn(pia_auth)[1882]: Options error: Unrecognized option or missing or extra parameter(s) in /etc/openvpn/pia_auth.conf:1: USERNAME (2.4.4)
Thu Feb  1 23:26:58 2018 daemon.warn openvpn(pia_auth)[1882]: Use --help for more information.
Thu Feb  1 23:27:03 2018 daemon.err openvpn(pia_auth)[1883]: Options error: Unrecognized option or missing or extra parameter(s) in /etc/openvpn/pia_auth.conf:1: USERNAME (2.4.4)
Thu Feb  1 23:27:03 2018 daemon.warn openvpn(pia_auth)[1883]: Use --help for more information.
Thu Feb  1 23:27:08 2018 daemon.err openvpn(pia_auth)[1884]: Options error: Unrecognized option or missing or extra parameter(s) in /etc/openvpn/pia_auth.conf:1: USERNAME (2.4.4)
Thu Feb  1 23:27:08 2018 daemon.warn openvpn(pia_auth)[1884]: Use --help for more information.
Thu Feb  1 23:27:13 2018 daemon.err openvpn(pia_auth)[1885]: Options error: Unrecognized option or missing or extra parameter(s) in /etc/openvpn/pia_auth.conf:1: USERNAME (2.4.4)
Thu Feb  1 23:27:13 2018 daemon.warn openvpn(pia_auth)[1885]: Use --help for more information.
[...]

These errors are in loop.

/etc/openvpn/pia_auth.conf contains username in the first line and password in the second line.

These warn and err are very strange... Everything works fine but these errors argue me... Do you have an idea?

Thanks! :slight_smile:

My /etc/config/openvpn:

config openvpn 'pia'
        option enabled '1'
        option config '/etc/openvpn/pia_sweden.ovpn'

My /etc/openvpn/pia_sweden.ovpn:

client
dev tun
proto udp
remote sweden.privateinternetaccess.com 1198
resolv-retry infinite
nobind
persist-key
persist-tun
cipher aes-128-cbc
auth sha1
tls-client
remote-cert-tls server
auth-user-pass /etc/openvpn/pia_auth.conf
comp-lzo
verb 1
reneg-sec 0
disable-occ
<ca>...</ca>
<crl-verify>...</crl-verify>

My /etc/openvpn/pia_auth.conf:

USERNAME
PASSWORD

Very strange...

Even if I stop OpenVPN with /etc/init.d/openvpn stop, errors keep going:

Thu Feb  1 23:48:12 2018 daemon.notice netifd: Interface 'pia' is now down
Thu Feb  1 23:48:12 2018 daemon.notice openvpn(pia)[1709]: SIGTERM[hard,] received, process exiting
Thu Feb  1 23:48:12 2018 daemon.notice netifd: Interface 'pia' is disabled
Thu Feb  1 23:48:14 2018 daemon.err openvpn(pia_auth)[2244]: Options error: Unrecognized option or missing or extra parameter(s) in /etc/openvpn/pia_auth.conf:1: USERNAME (2.4.4)
Thu Feb  1 23:48:14 2018 daemon.warn openvpn(pia_auth)[2244]: Use --help for more information.
Thu Feb  1 23:48:15 2018 daemon.info dnsmasq[1513]: read /etc/hosts - 4 addresses
Thu Feb  1 23:48:15 2018 daemon.info dnsmasq[1513]: read /tmp/hosts/dhcp.cfg01411c - 2 addresses
Thu Feb  1 23:48:15 2018 daemon.info dnsmasq-dhcp[1513]: read /etc/ethers - 0 addresses
Thu Feb  1 23:48:19 2018 daemon.err openvpn(pia_auth)[2296]: Options error: Unrecognized option or missing or extra parameter(s) in /etc/openvpn/pia_auth.conf:1: USERNAME (2.4.4)
Thu Feb  1 23:48:19 2018 daemon.warn openvpn(pia_auth)[2296]: Use --help for more information.
Thu Feb  1 23:48:24 2018 daemon.err openvpn(pia_auth)[2297]: Options error: Unrecognized option or missing or extra parameter(s) in /etc/openvpn/pia_auth.conf:1: USERNAME (2.4.4)
Thu Feb  1 23:48:24 2018 daemon.warn openvpn(pia_auth)[2297]: Use --help for more information.
Thu Feb  1 23:48:29 2018 daemon.err openvpn(pia_auth)[2298]: Options error: Unrecognized option or missing or extra parameter(s) in /etc/openvpn/pia_auth.conf:1: USERNAME (2.4.4)
Thu Feb  1 23:48:30 2018 daemon.warn openvpn(pia_auth)[2298]: Use --help for more information.
...

Hi,
I have a feeling it is linked to the name of your auth file.
By default, openvpn will take all files with a ".conf" extension in /etc/openvpn and consider that they are a full configuration file for an openvpn instance.
In your case, you can see from the first log that openvpn is trying to run a second process using pia_auth.conf as the config file (see "openvpn(pia_auth)" - you probably have other lines with "openvpn(pia_sweden)" from your normal config file).

The solution is to rename your auth file to something else not ending in ".conf" and change you auth-user-pass option accordingly. For example you can rename it to "pia_auth" which should do the trick.

1 Like

Options error: Unrecognized option or missing or extra parameter(s) in /etc/openvpn/pia_auth.conf:1: USERNAME

I think it's looking for the actual username and password.

1 Like

As @VincentR already suspected, the init script will spawn one openvpn process for each *.conf file it finds in /etc/openvpn/.

Either rename your pia_auth.conf to something not ending in .conf, e.g. pia.auth or move it into a subdirectory, e.g. /etc/openvpn/pia/auth.conf

1 Like

Great! Thank you :smiley: