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.

Bug 1500651

Summary: [NMCI] nmtui: nondeterministic states after incorrect route profile activated
Product: Red Hat Enterprise Linux 7 Reporter: Vladimir Benes <vbenes>
Component: NetworkManagerAssignee: Beniamino Galvani <bgalvani>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: atragler, bgalvani, fgiudici, lrintel, rkhan, sukulkar, thaller
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 13:31:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
journal record with passed and failed scenarios none

Description Vladimir Benes 2017-10-11 09:37:02 UTC
Description of problem:
in nmtui when incorrect routes are entered sometimes I get different state than usual.

  Scenario: nmtui - ipv4 - routes - set unreachable route
    * Prepare virtual terminal environment ... passed in 0.000s
    * Prepare new connection of type "Ethernet" named "ethernet" ... passed in 8.903s
    * Set "Device" field to "eth1" ... passed in 0.686s
    * Set "IPv4 CONFIGURATION" category to "Manual" ... passed in 2.448s
    * Come in "IPv4 CONFIGURATION" category ... passed in 0.867s
    * In "Addresses" property add "192.168.122.2/24" ... passed in 0.694s
    * Set "Gateway" field to "192.168.122.1" ... passed in 1.439s
    * Add ip route "192.168.1.0/24 192.168.3.11 1" ... passed in 2.980s
    * Set "IPv6 CONFIGURATION" category to "Ignore" ... passed in 2.251s
    * Ensure "Automatically connect" is not checked ... passed in 1.048s
    * Confirm the connection settings ... passed in 0.335s
    * Come back to main screen ... passed in 0.058s
    * Choose to "Activate a connection" from main screen ... passed in 0.680s
    * Select connection "ethernet" in the list ... passed in 1.038s
    * Choose to "<Activate>" a connection ... passed in 1.201s
    When "eth1\s+ethernet\s+disconnected" is visible with command "nmcli device" in "5" seconds ... passed in 0.133s
    Then ".*Could not activate connection.*" is visible on screen ... failed in 0.005s
Assertion Failed: Could see pattern '.*Could not activate connection.*' on screen!


I see 'Connecting...' in some cases instead of Error. 

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

How reproducible:
sometimes

Steps to Reproduce:
https://github.com/NetworkManager/NetworkManager-ci/blob/master/nmtui/features/ipv4.feature#L342


Additional info:
some sleep in between disconnected state is seen and error check does not make any difference

Comment 1 Vladimir Benes 2017-10-11 09:56:10 UTC
Created attachment 1337082 [details]
journal record with passed and failed scenarios

Comment 2 Beniamino Galvani 2017-10-13 16:31:49 UTC
Please review branch bg/tui-activation-rh1500651.

Comment 3 Thomas Haller 2017-10-16 13:37:29 UTC
(In reply to Beniamino Galvani from comment #2)
> Please review branch bg/tui-activation-rh1500651.

> cli: split evaluation of activation state

in get_effective_activation_state(), could you either
 (1) assert that (reason && !*reason)
 (2) ensure to always set the reason, possibly to NULL.

Since @reason is a mandatory argument that doesn't transfer ownership, (2) seems better API wise (as it's more forgiving in what it accepts).


> tui: improve tracking of activation state

     if (ac_state != NM_ACTIVE_CONNECTION_STATE_ACTIVATED) {
          error = g_error_new_literal (NM_CLIENT_ERROR, NM_CLIENT_ERROR_FAILED,
                                       _("Activation failed"));
     }
 
     nmt_sync_op_complete_boolean (info->op, error == NULL, error);

Do we print the "Activation failed" message? Could we make use of the reason to show a better message?

Comment 4 Beniamino Galvani 2017-10-16 15:51:04 UTC
(In reply to Thomas Haller from comment #3)

> Since @reason is a mandatory argument that doesn't transfer ownership, (2)
> seems better API wise (as it's more forgiving in what it accepts).

Okay.

> Do we print the "Activation failed" message? Could we make use of the reason
> to show a better message?

Sure. Now the error message for the test in comment 0 is:

                    ┌─────────────────────────────────────┐
                    │                                     │
                    │ Could not activate connection:      │
                    │ Activation failed: IP configuration │
                    │ could not be reserved (no available │
                    │ address, timeout, etc.)             │
                    │                                     │
                    │               ┌────┐                │
                    │               │ OK │                │
                    │               └────┘                │
                    │                                     │
                    │                                     │
                    └─────────────────────────────────────┘

Updated branch bg/tui-activation-rh1500651.

Comment 5 Thomas Haller 2017-10-16 17:07:40 UTC
lgtm

Comment 10 errata-xmlrpc 2018-04-10 13:31:31 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