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 1438476 - [NMCI] nmcli agent race
Summary: [NMCI] nmcli agent race
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: NetworkManager
Version: 7.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Beniamino Galvani
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks: 1470965
TreeView+ depends on / blocked
 
Reported: 2017-04-03 13:30 UTC by Vladimir Benes
Modified: 2018-04-10 13:23 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 13:22:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
[PATCH 1/2] clients: implement CancelGetSecrets() secret-agent API (1.16 KB, patch)
2017-10-27 14:48 UTC, Beniamino Galvani
no flags Details | Diff
[PATCH 2/2] cli: enable secret-agent only after activation (2.59 KB, patch)
2017-10-27 14:49 UTC, Beniamino Galvani
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0778 0 None None None 2018-04-10 13:23:39 UTC

Description Vladimir Benes 2017-04-03 13:30:38 UTC
Description of problem:

    @8021x_without_password
    Scenario: nmcli - ethernet - connect to 8021x - md5 - ask for password
    * Add a new connection of type "ethernet" and options "ifname testX con-name ethie 802-1x.eap md5 802-1x.identity user"
    * Spawn "nmcli -a con up ethie" command
    * Expect "identity.*user"
    * Enter in editor
    * Send "password" in editor
    * Enter in editor
    Then "testX:connected:ethie" is visible with command "nmcli -t -f DEVICE,STATE,CONNECTION device" in "20" seconds


Version-Release number of selected component (if applicable):
1.8

How reproducible:
race

Steps to Reproduce:
see above

Actual results:
sometimes, nmcli agent seems to be racing for two requests and second connection fails even if everything is entered correctly

Expected results:
nmcli -a con up should lead to connection successfully connected

Additional info:

Comment 2 Thomas Haller 2017-09-06 17:36:58 UTC
This [NMCI] failure is old.

Either

 (1) the issue has been fixed in the meantime (and CI tests are now green)

 (2) or the issue is still present, in which case we still have failing tests.

Since our CI tests are currently in a good shape, I suspect this issue is long fixed, and I am not going to spend time verifying that it is.

If the test is still failing, we anyway will fix it because there is the strong aim to have all green for CI.


[NMCI] bugs are very useful to discuss/track an issue. But if they are stale for a while, they are obsolete.


Closing.

Comment 3 Vladimir Benes 2017-09-06 18:07:08 UTC
I don't think this is fixed, we have a workaround in place, autoconnect no. And a small delay to have everything settled. Reopening.

Comment 4 Thomas Haller 2017-09-07 09:48:20 UTC
(In reply to Vladimir Benes from comment #3)
> I don't think this is fixed, we have a workaround in place, autoconnect no.
> And a small delay to have everything settled. Reopening.

I think, if the CI shows a real bug (probably it does), disabling the test only to get it green is wrong. Let's not do such workarounds. If a test fails, it fails.

The failing test should be the reminder that this needs fixing. Not a 5 month old bug, where it takes me considerable effort to figure out how to remove the workaround and reproduce the issue.

Comment 8 Vladimir Benes 2017-09-08 22:29:13 UTC
I have one more use case showing this symptom.

Running this fails from time to time:
nmcli device wifi connect wpa2-eap password secret123

Should I file another bug?

Comment 9 Beniamino Galvani 2017-10-15 11:57:41 UTC
(In reply to Vladimir Benes from comment #8)
> I have one more use case showing this symptom.
> 
> Running this fails from time to time:
> nmcli device wifi connect wpa2-eap password secret123
> 
> Should I file another bug?

If I remember well, this new failure was caused by bug 1490885.

Comment 10 Beniamino Galvani 2017-10-15 12:02:26 UTC
In nmcli, since we first register a secret agent and then activate the
connection, the agent receives a GetSecrets() request for the
autoactivation first and for the user activation after, like in the
following sequence:

 NMCLI                                  NM DAEMON

 * connection add	      ------->
                                        * start autoactivating the
                                          connection
                                        * autoactivation fails due to
                                          missing secrets
 * connection up:
  - register the secret agent ------->
                                        * unblock all failed connection
                                          due to missing secrets
                                        * start again autoactivation
                                        * ask secrets to the agent
  - activate connection
    asynchronously            ------->
  - ask secrets for the
    autoactivation            ------->
                                        * user activation preempts
                                          autoactivation
                                        * ask secrets to the agent
  - show another prompt


The test only provides credentials once and thus the activation fails.

A possible solution to this would be to add a parameter to the
GetSecrets() call from NM to the agent specifying for which
ActiveConnection the secrets are needed. In this way nmcli could
filter out requests for the wrong ACs.

Since the D-Bus API doesn't allow that at the moment, we have either
to hijack the 'hints' parameter, or to change the API.

Comment 11 Thomas Haller 2017-10-23 08:43:31 UTC
The plan to extend the API sounds right to me.


How about adding a "GetSecrets2", that is like "GetSecrets" but has two additional arguments:

  "active_connection_path", "o"
  "extra_args", "a{sv}"

the last argument is for future additions, so we can avoid "GetSecrets3".


Also, let's check with Lubomir. I think for pkcs11-remoting, he was missing that GetSecrets cannot pass a file descriptor. If we extend the API now, maybe we need a UNIX_FD argument (which we cannot later put inside "extra_args" (I think??).


also, the agent should "RegisterWithCapabilities" with a new capability NM_SECRET_AGENT_CAPABILITY_GETSECRETS2, so that the server knows whether to call v1 or v2. That of course makes it more annoying to implement a new agent, because the agent now must explicitly announce that he supports the non-deprecated function.
The alternatives would be, to first try calling GetSecrets2, and on failure retry with GetSecret. Maybe that's better??
Or, the other alternative might be, to introspect D-Bus to check whether the agent support GetSecrets2. But probably that is more expensive then just try-fail-retry.

Comment 12 Thomas Haller 2017-10-23 08:45:22 UTC
while at it, maybe GetSecret2 should also have an 

  <arg name="extra_results" type="a{sv}}" direction="out"/>

argument.

Comment 13 Beniamino Galvani 2017-10-27 14:48:40 UTC
Created attachment 1344329 [details]
[PATCH 1/2] clients: implement CancelGetSecrets() secret-agent API

Comment 14 Beniamino Galvani 2017-10-27 14:49:05 UTC
Created attachment 1344330 [details]
[PATCH 2/2] cli: enable secret-agent only after activation

Comment 15 Beniamino Galvani 2017-10-27 14:50:28 UTC
Scratch what I said in previous comments, how about these 2 patches instead?

Comment 16 Thomas Haller 2017-11-02 13:00:10 UTC
(In reply to Beniamino Galvani from comment #15)
> Scratch what I said in previous comments, how about these 2 patches instead?

lgtm

Comment 21 errata-xmlrpc 2018-04-10 13:22:08 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, 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-2018:0778


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