+++ This bug was initially created as a clone of Bug #2175665 +++
This bug was cloned to fix this issue in NM as the fix in Bug 2175665 is a workaround.
Description of problem:
When using the nmstate.service the state configured at /etc/nmstate is not applied with the following error
Mar 6 07:50:05.269335 systemd[1]: Starting nmstate.service - Apply nmstate on-disk state...
Mar 6 07:50:05.277998 systemd[1]: Finished systemd-homed-activate.service - Home Area Activation.
Mar 6 07:50:05.278000 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-homed-activate comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Mar 6 07:50:05.280000 audit: BPF prog-id=67 op=LOAD
Mar 6 07:50:05.281000 audit: BPF prog-id=68 op=LOAD
Mar 6 07:50:05.281000 audit: BPF prog-id=69 op=LOAD
Mar 6 07:50:05.290390 systemd[1]: Starting systemd-hostnamed.service - Hostname Service...
Mar 6 07:50:05.294788 systemd[1]: Started chronyd.service - NTP client/server.
Mar 6 07:50:05.298000 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=chronyd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Mar 6 07:50:05.308385 nmstatectl[1263]: [2023-03-06T07:50:05Z WARN nmstate::nm::nm_dbus::error] Unknown DBUS error MethodError("org.freedesktop.DBus.Error.UnknownMethod", Some("Object does not exist at path “/org/freedesktop/NetworkManager”"), Msg { type: Error, sender: ":1.3", reply-serial: 2, body: Signature: [
Mar 6 07:50:05.308385 nmstatectl[1263]: s (115),
Mar 6 07:50:05.308385 nmstatectl[1263]: ] })
Mar 6 07:50:05.310309 nmstatectl[1263]: [2023-03-06T07:50:05Z ERROR nmstatectl::service] Failed to apply state file /etc/nmstate/br-ex.yml: NmstateError: Bug: DbusConnectionError: org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path “/org/freedesktop/NetworkManager”
Mar 6 07:50:05.310867 systemd[1]: nmstate.service: Deactivated successfully.
Version-Release number of selected component (if applicable): 2.2.5-1.fc37
How reproducible: Always
Steps to Reproduce:
1. Add a configuration to /etc/nmstate/*.yml
2. Check configuration after startup
3.
Actual results:
State is not applied with the following error
Mar 6 07:50:05.269335 systemd[1]: Starting nmstate.service - Apply nmstate on-disk state...
Mar 6 07:50:05.277998 systemd[1]: Finished systemd-homed-activate.service - Home Area Activation.
Mar 6 07:50:05.278000 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-homed-activate comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Mar 6 07:50:05.280000 audit: BPF prog-id=67 op=LOAD
Mar 6 07:50:05.281000 audit: BPF prog-id=68 op=LOAD
Mar 6 07:50:05.281000 audit: BPF prog-id=69 op=LOAD
Mar 6 07:50:05.290390 systemd[1]: Starting systemd-hostnamed.service - Hostname Service...
Mar 6 07:50:05.294788 systemd[1]: Started chronyd.service - NTP client/server.
Mar 6 07:50:05.298000 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=chronyd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Mar 6 07:50:05.308385 nmstatectl[1263]: [2023-03-06T07:50:05Z WARN nmstate::nm::nm_dbus::error] Unknown DBUS error MethodError("org.freedesktop.DBus.Error.UnknownMethod", Some("Object does not exist at path “/org/freedesktop/NetworkManager”"), Msg { type: Error, sender: ":1.3", reply-serial: 2, body: Signature: [
Mar 6 07:50:05.308385 nmstatectl[1263]: s (115),
Mar 6 07:50:05.308385 nmstatectl[1263]: ] })
Mar 6 07:50:05.310309 nmstatectl[1263]: [2023-03-06T07:50:05Z ERROR nmstatectl::service] Failed to apply state file /etc/nmstate/br-ex.yml: NmstateError: Bug: DbusConnectionError: org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path “/org/freedesktop/NetworkManager”
Mar 6 07:50:05.310867 systemd[1]: nmstate.service: Deactivated successfully.
Expected results:
State should be applied
Additional info:
There is already a fix https://github.com/nmstate/nmstate/pull/2265
--- Additional comment from Gris Ge on 2023-03-06 09:35:04 UTC ---
Patch posted to upstream https://github.com/nmstate/nmstate/pull/2265
To test the bug:
* Store a desire state YAML file as /etc/nmstate/foo.yml
* `sudo systemctl enable nmstate`
* `reboot`
* check whether desire state been applied. or `journalctl -u nmstate`
this is a duplicate of bug 2175919. Closing.
(Also, this bug doesn't depend on bug 2175665. At most, the other way around. Clearing that option).
*** This bug has been marked as a duplicate of bug 2175919 ***