Bug 466336 - Unable to load VPN configuration
Summary: Unable to load VPN configuration
Status: RESOLVED UPSTREAM
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_networkmanagement (show other bugs)
Version: 5.27.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Jan Grulich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-24 08:23 UTC by elman
Modified: 2023-03-13 22:15 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description elman 2023-02-24 08:23:28 UTC
SUMMARY
***
When I try to create new VPN connection via "Import VPN connection..." nothing happens.
***


STEPS TO REPRODUCE
1. Open System Settings
2. Click on Connections
3. Click + to add new connection
4. Select Other/Import VPN Connection...
5. Select any *.ovpn file

OBSERVED RESULT
File picker closes and nothing happens.

EXPECTED RESULT
Configuration screen to create VPN connection should be shown.

SOFTWARE/OS VERSIONS
Operating System: EndeavourOS 
KDE Plasma Version: 5.27.1
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 6.1.12-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Comment 1 Nicolas Fella 2023-02-24 12:49:11 UTC
Please run systemsettings from the command line, try to import, and attach the command line output here
Comment 2 Nate Graham 2023-02-24 20:59:18 UTC
.
Comment 3 elman 2023-02-25 09:58:57 UTC
This is complete output I see:

file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:200:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:200:9: QML MouseArea: Binding loop detected for property "width"
QQmlEngine::setContextForObject(): Object already has a QQmlContext
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
QQmlEngine::setContextForObject(): Object already has a QQmlContext
file:///usr/share/kcm_networkmanagement/qml/ListItem.qml:25: Error: Cannot assign to non-existent property "prefix"
file:///usr/share/kcm_networkmanagement/qml/ListItem.qml:26: Error: Cannot assign to non-existent property "prefix"
org.kde.kf5.kwindowsystem.kwayland: Failed to recreate shadow for QWidgetWindow(0x5592243909b0, name="completion boxWindow")
org.kde.kf5.kwindowsystem.kwayland: Failed to recreate shadow for QWidgetWindow(0x5592243909b0, name="completion boxWindow")
org.kde.plasma.nm.kcm: Failed to import "/home/elman/Temp/syd-006.ovpn" "configuration error: unsupported 3th argument vpn_gateway to “route” (line 18)"

I tried different ovpn files from different paths and all failed. Also import with Plasma 5.26 worked fine.
Comment 4 Nicolas Fella 2023-02-25 15:04:29 UTC
Relevant error: org.kde.plasma.nm.kcm: Failed to import "/home/elman/Temp/syd-006.ovpn" "configuration error: unsupported 3th argument vpn_gateway to “route” (line 18)"

Does "nmcli connection import type vpnc file /home/elman/Temp/syd-006.ovpn" work?

> Also import with Plasma 5.26 worked fine.

In 5.27 we changed the code away from a custom parser for ovpn files to use the same code as nmcli. This makes me suspect that either it's a bug in networkmanager-openvpn or your file is genuinely broken and our old code didn't complain.

In either case we should show the error message in the UI instead of just dumping it to the terminal
Comment 5 Bug Janitor Service 2023-02-25 20:07:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-nm/-/merge_requests/224
Comment 6 elman 2023-02-26 07:37:01 UTC
> Does "nmcli connection import type vpnc file /home/elman/Temp/syd-006.ovpn" work?

Same error:

> nmcli connection import type openvpn file /home/elman/Temp/syd-006.ovpn
Error: failed to import '/home/elman/Temp/syd-006.ovpn': configuration error: unsupported 3th argument vpn_gateway to “route” (line 18).
Comment 7 Nicolas Fella 2023-02-26 13:45:38 UTC
That's what I expected. Please report this to https://gitlab.gnome.org/GNOME/NetworkManager-openvpn/-/issues/, that's where the relevant functionality is implemented. It would probably help them a lot if you attach the .ovpn file (with any sensitive information like IP addresses, passwords, certificates etc removed)
Comment 8 Nicolas Fella 2023-03-13 22:12:18 UTC
Git commit e75c1f528402d7dc5ad2c958f4eba5a88d1966b4 by Nicolas Fella.
Committed on 13/03/2023 at 22:09.
Pushed by nicolasfella into branch 'master'.

[kcm] Show VPN import error in the UI

Importing a VPN file can fail for a number of reasons

When it happens give feedback to the user and show any error message we get from NetworkManager

M  +33   -6    kcm/kcm.cpp
M  +11   -1    kcm/kcm.h

https://invent.kde.org/plasma/plasma-nm/commit/e75c1f528402d7dc5ad2c958f4eba5a88d1966b4
Comment 9 Bug Janitor Service 2023-03-13 22:13:09 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-nm/-/merge_requests/233
Comment 10 Nicolas Fella 2023-03-13 22:15:04 UTC
Git commit 9fa48340837a03ad7cb08d4eb23fcc9ca84ab7a2 by Nicolas Fella.
Committed on 13/03/2023 at 22:12.
Pushed by nicolasfella into branch 'Plasma/5.27'.

[kcm] Show VPN import error in the UI

Importing a VPN file can fail for a number of reasons

When it happens give feedback to the user and show any error message we get from NetworkManager
(cherry picked from commit e75c1f528402d7dc5ad2c958f4eba5a88d1966b4)

M  +33   -6    kcm/kcm.cpp
M  +11   -1    kcm/kcm.h

https://invent.kde.org/plasma/plasma-nm/commit/9fa48340837a03ad7cb08d4eb23fcc9ca84ab7a2