Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: connection[0]: the routing rule selector 'uid' is not supported in NetworkManger until NM 1.34 #767

Open
flybyray opened this issue Mar 10, 2025 · 4 comments

Comments

@flybyray
Copy link

even when running on nmcli tool, version 1.40.16-18.el8_10 output from # nmcli -v

I need to remove/comment out this block:

https://github.com/linux-system-roles/network/blame/53be949a5bfa445bcd72c90b5314a52d85904861/module_utils/network_lsr/argument_validator.py#L2685-L2694

not sure why the Support is not correct detected.

The role was run directly on the host itself

NAME="AlmaLinux"
VERSION="8.10 (Cerulean Leopard)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.10"
PLATFORM_ID="platform:el8"
PRETTY_NAME="AlmaLinux 8.10 (Cerulean Leopard)"
@liangwen12year
Copy link
Collaborator

What really matters are the versions of:

  • the currently running NetworkManager version (journalctl -b0 -u NetworkManager | grep 'is starting').
  • the installed libnm version

Can you run rpm -qa | grep NetworkManager and rpm -qR NetworkManager | grep libnm to check the version of NetworkManager-libnm?

Probably in the managed host, the old NM daemon is still running after the upgrading of the package.
What version of NetworkManager is currently running (journalctl -b -u NetworkManager | grep 'is starting')? Usually, when upgrading NetworkManager, you need to restart the daemon (systemctl daemon-reload && systemctl restart NetworkManager).

@flybyray
Copy link
Author

What really matters are the versions of:

* the currently running NetworkManager version (journalctl -b0 -u NetworkManager | grep 'is starting').
# journalctl -b0 -u NetworkManager | grep 'is starting'
Feb 16 04:57:31 somehost-name.example.com NetworkManager[7224]: <info>  [1739678251.2457] NetworkManager (version 1.40.16-18.el8_10) is starting... (boot:50a69d08-1f47-40e1-862a-34789f850a61)
* the installed libnm version

Can you run rpm -qa | grep NetworkManager and rpm -qR NetworkManager | grep libnm to check the version of NetworkManager-libnm?

# rpm -qa | grep NetworkManager
NetworkManager-1.40.16-18.el8_10.x86_64
NetworkManager-team-1.40.16-18.el8_10.x86_64
NetworkManager-tui-1.40.16-18.el8_10.x86_64
NetworkManager-libnm-1.40.16-18.el8_10.x86_64
# rpm -qR NetworkManager | grep libnm
NetworkManager-libnm(x86-64) = 1:1.40.16-18.el8_10
libnm.so.0()(64bit)
libnm.so.0(libnm_1_0_0)(64bit)
libnm.so.0(libnm_1_10_0)(64bit)
libnm.so.0(libnm_1_10_2)(64bit)
libnm.so.0(libnm_1_12_0)(64bit)
libnm.so.0(libnm_1_14_0)(64bit)
libnm.so.0(libnm_1_16_0)(64bit)
libnm.so.0(libnm_1_18_0)(64bit)
libnm.so.0(libnm_1_20_0)(64bit)
libnm.so.0(libnm_1_22_0)(64bit)
libnm.so.0(libnm_1_24_0)(64bit)
libnm.so.0(libnm_1_26_0)(64bit)
libnm.so.0(libnm_1_28_0)(64bit)
libnm.so.0(libnm_1_2_0)(64bit)
libnm.so.0(libnm_1_30_0)(64bit)
libnm.so.0(libnm_1_34_0)(64bit)
libnm.so.0(libnm_1_38_0)(64bit)
libnm.so.0(libnm_1_40_0)(64bit)
libnm.so.0(libnm_1_4_0)(64bit)
libnm.so.0(libnm_1_6_0)(64bit)
libnm.so.0(libnm_1_8_0)(64bit)

Probably in the managed host, the old NM daemon is still running after the upgrading of the package. What version of NetworkManager is currently running (journalctl -b -u NetworkManager | grep 'is starting')? Usually, when upgrading NetworkManager, you need to restart the daemon (systemctl daemon-reload && systemctl restart NetworkManager).

@flybyray
Copy link
Author

flybyray commented Mar 17, 2025

I have this issue even on a EL9 ( rockylinux) based fresh installed host. Removing this code block allows me to use this role without noticeable issues.

@liangwen12year
Copy link
Collaborator

liangwen12year commented Mar 20, 2025

libnm’s API provides two core aspects. One is NMConnection and NMSetting types, which help handling NetworkManager’s connection profiles. The other is NMClient, which is a cache of the D-Bus objects from D-Bus API. The code fails because the attribute is not directly part of the top-level NM module. Instead, it belongs to a related class, "NM.IPRoutingRule". The correct way to check the attribute is by using the following approach:

            for routing_rule in connection["ip"]["routing_rule"]:
                if routing_rule["uid"] is not None:
                    if not hasattr(
                        Util.NM().IPRoutingRule, "set_uid_range"
                    ):
                        raise ValidationError.from_connection(
                            idx,
                            "the routing rule selector 'uid' is not supported in "
                            "NetworkManger until NM 1.34",
                        )

Let me create a PR to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants