Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15
-
None
Description
Linux NetworkManager Bearer plugin fails to update ActiveConnections from NetworkManager via dbus. Once the active connection list was loaded, it is used regardless of the actual data exposed via dbus.
When network reconfiguration happens, bearer plugin removes NM_ACTIVE_CONNECTION_STATE_ACTIVATED state from the connection and fails to reload the connection list and set this state on any other connections, making the application to act like the network is not available.
How to reproduce:
- Using NetworkManager, configure the network connection and OpenVPN VPN connection
- Configure network interface (ethernet/wifi) with "Automatically connect to VPN" via OpenVPN connection
- Connect to the network interface, the VPN should be connected automatically
- Start Qt5 application, tested on crow-translate
- Select any word, press CTRL+ALT+E to translate it with crow-translate. You should see the translation.
- Disconnect from the network interface. VPN should be disconnected automatically.
- Wait 5-7 seconds (this is important), connect to the network interface + VPN again.
- Press CTRL+ALT+E again. No translation is shown, QNetworkReply::NetworkSessionFailedError "The specified configuration cannot be used." is received.
Is is important to start the application only after you have been connected to the network. If you started the application offline, and only then connected to the network, there's no issue (bearer plugin won't be able to enumerate any active connection upon starting the app, and would not interfere with the connections).
Simpliest workaround: start the affected applications without the network, connect to the network later.
Simple code workaround:
--- qnetworkmanagerengine.cpp 2023-06-18 22:21:54.226936853 +0300 +++ qnetworkmanagerengine.cpp 2023-06-18 22:22:09.410622118 +0300 @@ -126,25 +126,25 @@ void QNetworkManagerEngine::setupConfigurations() { QMutexLocker locker(&mutex); // Get active connections. const auto acPaths = managerInterface->activeConnections(); for (const QDBusObjectPath &acPath : acPaths) { if (activeConnectionsList.contains(acPath.path())) continue; QNetworkManagerConnectionActive *activeConnection = new QNetworkManagerConnectionActive(acPath.path(),this); - activeConnectionsList.insert(acPath.path(), activeConnection); + //activeConnectionsList.insert(acPath.path(), activeConnection); connect(activeConnection, SIGNAL(propertiesChanged(QMap<QString,QVariant>)), this, SLOT(activeConnectionPropertiesChanged(QMap<QString,QVariant>))); QStringList devices = activeConnection->devices(); if (!devices.isEmpty()) { QNetworkManagerInterfaceDevice device(devices.at(0),this); connectionInterfaces.insert(activeConnection->connection().path(),device.networkInterface()); } } // Get connections. const auto settingsPaths = systemSettings->listConnections();
Affected applications:
https://github.com/crow-translate/crow-translate/issues/383
https://github.com/QuiteRSS/quiterss/issues/1517
https://github.com/nextcloud/desktop/issues/4331