Bug 479179 - KDE Network Manager creates unusable name for wireguard and fails to save
Summary: KDE Network Manager creates unusable name for wireguard and fails to save
Status: RESOLVED FIXED
Alias: None
Product: plasma-nm
Classification: Plasma
Component: applet (show other bugs)
Version: 5.91.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
: 412795 414464 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-12-30 03:42 UTC by Matt Keith
Modified: 2024-04-14 05:04 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Keith 2023-12-30 03:42:40 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Open Network Connections
2. Click Add New Connection
3. Pick Wireguard
4. Click Create
Note default Connection Name ‘New wireguard connection’
Populate the following fields

Wireguard Interface
	Private key: WD3tC88Km+Kuh8aXgzT8aDF4tj4ULD1pRbqZYkiiyVA=
	Click Peers
		Public key: udgr1rvvd/hk6kX2f8LCewlFB/OknvXYPeOH4IKiSXk=
		Allowed Ips: 192.168.3.1/32,192.168.3.2/32,0.0.0.0/0
		Endpoint address: 70.1.123.123
		Endpoint port: 51820
		This password is not required
		Persistent keepalive: 25
		Press Ok
IPv4
	Method: Manual
	DNS Servers: 192.168.3.1
	Click +Add for Address
		Address: 192.168.3.2
		Netmask: 255.255.255.255
		Gateway: 192.168.3.1
	Check IPv4 is required for this connection
Click Save

OBSERVED RESULT
The window closes and an error notification pops up briefly with an error

EXPECTED RESULT
Either detect the error in the name and flag it, preventing you from saving
OR
The VPN connection should save. I'm not sure why the default name is not allowed or what can be done to allow it. I think the name should work with spaces if at all possible. If not - set a sensible default that replaces spaces with hyphens

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 39
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.11
Kernel Version: 6.6.8-200.fc39.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 20 × 12th Gen Intel® Core™ i7-1280P
Memory: 62.5 GiB of RAM
Graphics Processor: AMD Radeon RX 5700
Manufacturer: Framework
Product Name: Laptop (12th Gen Intel Core)
System Version: A8

ADDITIONAL INFORMATION
The error is a bad experience because 1) it's too quick to make a note of. and 2) you lose your work of entering all of your details as it fails to save at all.
Comment 1 Matt Keith 2023-12-30 03:59:41 UTC
I was able to reproduce this on kde plasma 6 beta 2
KDE Plasma Version: 5.91.90
KDE Freameworks Version: 5.248.0
QT Version: 6.6.1
Kernel Version: 6.2.0-39-generic (64-bit)
Graphics Platform: Wayland

Using the live demo installer. The issue is the same - the name is invalid - and the problem is the same - you lose everything trying to save.
Comment 2 Matt Keith 2023-12-30 04:02:34 UTC
Also - the reproduction steps key and ip info are all false. But it will let you save the info.

I of course found https://bugs.kde.org/show_bug.cgi?id=412795 which is for the same issue after creating this one. I feel mine is more useful so I will not mark it as duplicate myself
Comment 3 Bug Janitor Service 2023-12-30 21:38:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-nm/-/merge_requests/322
Comment 4 Antti Savolainen 2024-03-27 02:06:44 UTC
*** Bug 412795 has been marked as a duplicate of this bug. ***
Comment 5 Antti Savolainen 2024-03-27 02:07:02 UTC
*** Bug 414464 has been marked as a duplicate of this bug. ***
Comment 6 Stephen Robinson 2024-03-27 03:34:40 UTC
I created a merge request to solve this by adding an interface name field to the wireguard configuration widget: https://invent.kde.org/plasma/plasma-nm/-/merge_requests/339
Comment 7 Nicolas Fella 2024-04-09 21:46:44 UTC
Git commit 3240d991fb635976dcbf8a40b9fa166210bc6881 by Nicolas Fella, on behalf of Stephen Robinson.
Committed on 09/04/2024 at 21:46.
Pushed by nicolasfella into branch 'master'.

Add WireGuard config field for interface name

Fixes ~~BUG: 412795~~ BUG: 479179

Previously the WireGuard configuration took the connection name as the
interface name. This had a host of problems, especially that the default
connection name was not valid for an interface name, and that an invalid interface
name would result in losing all of your changes.

This commit adds a required "Interface name" field (with proper validation). This behavior mirrors `nm-connection-editor`.

![New connection screenshot](/uploads/f4dbd88a73d207664ff1e096b30374e3/image.png)

M  +2    -0    libs/editor/CMakeLists.txt
M  +8    -3    libs/editor/connectioneditorbase.cpp
A  +38   -0    libs/editor/interfacenamevalidator.cpp     [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)]
A  +22   -0    libs/editor/interfacenamevalidator.h     [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)]
M  +24   -9    libs/editor/settings/ui/wireguardinterfacewidget.ui
M  +64   -4    libs/editor/settings/wireguardinterfacewidget.cpp
M  +6    -1    libs/editor/settings/wireguardinterfacewidget.h

https://invent.kde.org/plasma/plasma-nm/-/commit/3240d991fb635976dcbf8a40b9fa166210bc6881
Comment 8 Yury Zhuravlev 2024-04-14 05:04:34 UTC
Is this bug https://bugs.kde.org/show_bug.cgi?id=484860 related?