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.
Bug 1797986 - Calling 'commit_changes_async' libnm method of with a valid 'profile' object returns error 'Object is no longer in the client cache'
Summary: Calling 'commit_changes_async' libnm method of with a valid 'profile' object...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: nmstate
Version: 8.3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 8.3
Assignee: Gris Ge
QA Contact: Mingyu Shi
URL:
Whiteboard:
Depends On:
Blocks: nmstate-nm
TreeView+ depends on / blocked
 
Reported: 2020-02-04 10:58 UTC by Fernando F. Mancera
Modified: 2021-09-27 12:27 UTC (History)
13 users (show)

Fixed In Version: nmstate-0.3.2-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-04 03:08:25 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Nmstate test log (8.08 KB, text/plain)
2020-02-04 11:07 UTC, Fernando F. Mancera
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:4696 0 None None None 2020-11-04 03:08:48 UTC

Description Fernando 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 1 Fernando 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 2 Beniamino 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 3 Gris Ge 2020-03-13 04:42:25 UTC
Changed to nmstate

Comment 4 Fernando 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.

Comment 5 Gris Ge 2020-06-18 03:53:46 UTC
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.

Comment 6 Mingyu Shi 2020-07-21 02:54:14 UTC
Verified with versions:
nmstate-0.3.3-2.el8.noarch
NetworkManager-1.26.0-1.el8.x86_64
DISTRO=RHEL-8.3.0-20200716.n.0
Linux hp-dl388g8-04.rhts.eng.pek2.redhat.com 4.18.0-226.el8.x86_64 #1 SMP Wed Jul 15 07:40:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux


[10:52:09@hp-dl388g8-04 ~/nmstate/tests/integration/nm]0# pytest wired_test.py -vv
============================================================================================================ test session starts =============================================================================================================
platform linux -- Python 3.6.8, pytest-5.4.3, py-1.9.0, pluggy-0.13.1 -- /usr/bin/python3.6
cachedir: .pytest_cache
RPMs: NetworkManager-1.26.0-1.el8.x86_64
OS: Red Hat Enterprise Linux 8.3 Beta (Ootpa)
nmstate: nmstate-0.3.3-2.el8.noarch

rootdir: /root/nmstate, inifile: tox.ini
collected 2 items                                                                                                                                                                                                                            

wired_test.py::test_interface_mtu_change PASSED                                                                                                                                                                                        [ 50%]
wired_test.py::test_interface_mac_change_with_modify PASSED                                                                                                                                                                            [100%]

Comment 10 errata-xmlrpc 2020-11-04 03:08:25 UTC
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


Note You need to log in before you can comment on or make changes to this bug.