Bug 1545255

Summary: [RFE] improve failure message when importing VPN connection in NetworkManager
Product: [Fedora] Fedora Reporter: Vedran Miletić <vedran>
Component: NetworkManager-openvpnAssignee: Lubomir Rintel <lkundrak>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 27CC: choeger, code, dcbw, lkundrak, steve, thaller, vedran
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-30 19:56:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Dummy ovpn file
none
Non-dummy ovpn none

Description Vedran Miletić 2018-02-14 13:32:23 UTC
Make a test .ovpn file containing the line

client

everything else is optional (the result is the same whether you have a legit VPN config or just this dummy one). Import it using NM, it will result in

Cannot import VPN Connection
The file "connection.ovpn" could not be read or does not contain recognized VPN connection information.
Error: Key file contains line "client" which is not a key-value pair, group, or comment.

Legitimate files can be imported using

nmcli connection import type openvpn file connection.ovpn

just fine.

Comment 1 Vedran Miletić 2018-02-14 13:41:39 UTC
My software versions:

$ rpm -qa | grep NetworkManager | sort
NetworkManager-1.8.6-1.fc27.x86_64
NetworkManager-adsl-1.8.6-1.fc27.x86_64
NetworkManager-bluetooth-1.8.6-1.fc27.x86_64
NetworkManager-config-connectivity-fedora-1.8.6-1.fc27.noarch
NetworkManager-glib-1.8.6-1.fc27.x86_64
NetworkManager-iodine-1.2.0-4.fc27.x86_64
NetworkManager-iodine-gnome-1.2.0-4.fc27.x86_64
NetworkManager-l2tp-1.2.8-3.fc27.x86_64
NetworkManager-l2tp-gnome-1.2.8-3.fc27.x86_64
NetworkManager-libnm-1.8.6-1.fc27.x86_64
NetworkManager-libreswan-1.2.4-4.fc27.x86_64
NetworkManager-libreswan-gnome-1.2.4-4.fc27.x86_64
NetworkManager-openconnect-1.2.4-6.fc27.x86_64
NetworkManager-openvpn-1.8.0-3.fc27.x86_64
NetworkManager-openvpn-gnome-1.8.0-3.fc27.x86_64
NetworkManager-pptp-1.2.4-4.fc27.x86_64
NetworkManager-pptp-gnome-1.2.4-4.fc27.x86_64
NetworkManager-ssh-1.2.7-1.fc27.x86_64
NetworkManager-ssh-gnome-1.2.7-1.fc27.x86_64
NetworkManager-team-1.8.6-1.fc27.x86_64
NetworkManager-vpnc-1.2.4-4.fc27.x86_64
NetworkManager-vpnc-gnome-1.2.4-4.fc27.x86_64
NetworkManager-wifi-1.8.6-1.fc27.x86_64
NetworkManager-wwan-1.8.6-1.fc27.x86_64

Comment 2 Thomas Haller 2018-02-14 13:43:02 UTC
Please attach a ovpn file that shows the issue (taking care to first remove private data). Thank you

Comment 3 Vedran Miletić 2018-02-14 14:41:25 UTC
Created attachment 1395952 [details]
Dummy ovpn file

Any file does.

Comment 4 Thomas Haller 2018-02-14 16:05:32 UTC
This is not a valid ovpn file. Obviously, import fails.

Is your bug about the misleading error message?

Comment 5 Vedran Miletić 2018-02-14 16:31:27 UTC
Created attachment 1396018 [details]
Non-dummy ovpn

Here's a real ovpn. It fails with exactly the same error message.

Comment 6 Thomas Haller 2018-02-14 16:45:56 UTC
(In reply to Vedran Miletić from comment #5)
> Created attachment 1396018 [details]
> Non-dummy ovpn
> 
> Here's a real ovpn. It fails with exactly the same error message.

this isn't a valid ovpn file either, because verify-x509-name is empty.

Is your only issue the misleading error message?

Comment 7 Vedran Miletić 2018-02-14 16:55:10 UTC
(In reply to Thomas Haller from comment #6)
> (In reply to Vedran Miletić from comment #5)
> > Created attachment 1396018 [details]
> > Non-dummy ovpn
> > 
> > Here's a real ovpn. It fails with exactly the same error message.
> 
> this isn't a valid ovpn file either, because verify-x509-name is empty.
> 
> Is your only issue the misleading error message?

It wasn't empty, I obviously removed its contents, ditto for certificates. You can try to fill it in and you'll notice that the error message doesn't change, while

nmcli connection import type openvpn file connection.ovpn

works just fine.

Comment 8 Thomas Haller 2018-02-14 17:32:35 UTC
You attached two ovpn files which are invalid. Consequently, import fails, as expected.

Are you talking about an ovpn file that is not invalid? Can you attach a valid ovpn file that shows the issue?

Or are you fine with the failure to import the invalid ovpn file, but just find the error message misleading/unhelpful?

Comment 9 Vedran Miletić 2018-02-15 13:22:46 UTC
I tested a couple of files see what you mean now. Apologies for not understanding that earlier.

Yes, error messaging should absolutely be improved, it's very misleading.

Comment 10 Thomas Haller 2018-02-15 13:43:53 UTC
The problem is, that nm-connection-editor/nmcli doesn't know which VPN type it is (well, nmcli might know in case you call `nmcli connection import type ovpn`).


So, what they do, they just ask all VPN plugins in turn to import the file. When all plugins fail with an error message, nm-connection-editor doesn't really know which VPN plugin showed the best failure message and shows an arbitray failure message from one of the plugins. 


This need to be fixed upstream first.

Comment 11 Ben Cotton 2018-11-27 16:59:31 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 12 Ben Cotton 2018-11-30 19:56:03 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.