Red Hat Bugzilla – 1797986 – Calling 'commit_changes_async' libnm method of with a valid 'profile' object returns error 'Object is no longer in the client cache'
Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionFernando F. Mancera
2020-02-04 10:58:34 UTC
Description of problem:
This problem have been detected when running the nmstate wired integration tests against NM 1.22.6. The failure is at the callback function `commit_changes_finish`.
Version-Release number of selected component (if applicable):
NetworkManager 1.22.6
Comment 1Fernando F. Mancera
2020-02-04 11:07:09 UTC
Created attachment 1657529[details]
Nmstate test log
We cannot reproduce it manually. I've attached the tests logs.
Comment 2Beniamino Galvani
2020-02-06 09:00:15 UTC
I'm not very familiar with Python and nmstate code, but from what I
understand the problem seems to be in the test.
test_interface_mtu_change_with_modify() calls _modify_interface()
which does this:
conn = nm.connection.ConnectionProfile()
conn.import_by_id(ETH1)
settings = _create_iface_settings(wired_state, conn)
new_conn = nm.connection.ConnectionProfile()
new_conn.create(settings)
conn.update(new_conn)
conn.commit(save_to_disk=False)
nmdev = nm.device.get_device_by_name(ETH1)
apply_operation(nmdev, conn.profile)
so, it enqueues the commit/reapply operations in the main loop and
returns. Since the function is decorated with @nmclient_context, the
NMClient gets destroyed as soon as the function returns; therefore
when commit() later is dequeued and executed, it fails because the
RemoteConnection object doesn't have an associated client.
I haven't investigated how this worked with NM 1.20, but this seems to
me a bug in the nmstate test implementation. Fernando, what do you
think?
Comment 4Fernando F. Mancera
2020-04-26 22:04:27 UTC
(In reply to Beniamino Galvani from comment #2)
> I'm not very familiar with Python and nmstate code, but from what I
> understand the problem seems to be in the test.
>
> test_interface_mtu_change_with_modify() calls _modify_interface()
> which does this:
>
> conn = nm.connection.ConnectionProfile()
> conn.import_by_id(ETH1)
> settings = _create_iface_settings(wired_state, conn)
> new_conn = nm.connection.ConnectionProfile()
> new_conn.create(settings)
> conn.update(new_conn)
> conn.commit(save_to_disk=False)
>
> nmdev = nm.device.get_device_by_name(ETH1)
> apply_operation(nmdev, conn.profile)
>
> so, it enqueues the commit/reapply operations in the main loop and
> returns. Since the function is decorated with @nmclient_context, the
> NMClient gets destroyed as soon as the function returns; therefore
> when commit() later is dequeued and executed, it fails because the
> RemoteConnection object doesn't have an associated client.
>
> I haven't investigated how this worked with NM 1.20, but this seems to
> me a bug in the nmstate test implementation. Fernando, what do you
> think?
I think you are right. This test could be changed soon as nmstate-0.3 will contain big changes on the Mainloop topic. I will re-check it then.
Not a issue any more as nmstate has changed the use of MainContext.
The new test case name is `test_interface_mtu_change` in case QE want to try it out.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (nmstate bug fix and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2020:4696