Patching doesn't work for systems with IPv6

Bug #1800195 reported by Anujeyan Manokeran
20
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
High
Austin Sun

Bug Description

Bug Description : Distributed cloud lab patches in software management page in horizon doesn’t have correct patch state. It says patch state n/a and progress bar is moving when there is no action in background. Attached image have more info.

[wrsroot@controller-0 ~(keystone_admin)]$ sw-patch query
      Patch ID RR Release Repo State Patch State
===================== == ======= ========== ===========
2018-10-23_01-52-00_A Y 18.10 Applied n/a
2018-10-23_01-52-00_B Y 18.10 Applied n/a
2018-10-23_01-52-00_C Y 18.10 Applied n/a

Severity
--------
Major

Steps to Reproduce
------------------
1. upload patches using horizon
2. Apply patches and check the state on horizon
Expected Behavior
------------------

Patch state

Actual Behavior
----------------
As per description

Reproducibility
---------------
100% Reproduce-able

System Configuration
--------------------
Distributed cloud

Branch/Pull Time/Commit
-----------------------
StarlingX_Upstream_build release branch build as of 2018-10-24_20-18-00

Timestamp/Logs
--------------
2018-10-26T15:01:03.000

Revision history for this message
Ghada Khalil (gkhalil) wrote :

From Don Penney:
the patching daemons are not properly configuring multicast on IPv6 systems, and cannot talk to each other as a result.

For IPv6 systems, patching is using the following function to determine the interface index, against which the multicast address is configured:
    import ctypes
    import ctypes.util

    libc = ctypes.CDLL(ctypes.util.find_library('c'))

    def if_nametoindex(name):
        return libc.if_nametoindex(name)

The following commit made changes to how tsconfig parses the platform.conf file:
https://github.com/openstack/stx-update/commit/a539b771cf6ba5e1e08ea388342265f839c53b3e#diff-6ba9d2507cc0d05ce908b2e52c08dee0

This results in strings now being returned as Unicode (u'eno4.160'). And the libc function used by patching doesn't handle unicode, it seems, returning 0 instead of the correct ifindex:
>>> import tsconfig.tsconfig as tsc
>>> tsc.management_interface
u'eno4.160'
>>> str(tsc.management_interface)
'eno4.160'
>>> import ctypes
>>> import ctypes.util
>>>
>>> libc = ctypes.CDLL(ctypes.util.find_library('c'))
>>> libc.if_nametoindex(tsc.management_interface)
0
>>> libc.if_nametoindex(str(tsc.management_interface))
6
>>>

In summary: patching is broken on IPv6 systems.

Changed in starlingx:
importance: Undecided → High
status: New → Triaged
summary: - Distributed cloud: Patches in software management page on horizon
- doesn’t have correct patch state
+ Patching doesn't work for systems with IPv6
tags: added: stx.2019.03 stx.update
Revision history for this message
Ghada Khalil (gkhalil) wrote :

stx.2019.03 - issue was introduced by changes related to python2->python3 conversion.

Cindy Xie (xxie1)
Changed in starlingx:
assignee: nobody → Cindy Xie (xxie1)
Austin Sun (sunausti)
Changed in starlingx:
assignee: Cindy Xie (xxie1) → Austin Sun (sunausti)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to stx-update (master)

Fix proposed to branch: master
Review: https://review.openstack.org/614504

Changed in starlingx:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to stx-update (master)

Reviewed: https://review.openstack.org/614504
Committed: https://git.openstack.org/cgit/openstack/stx-update/commit/?id=53f6f3bcb6bf0cb90481ab5ed77b715401464900
Submitter: Zuul
Branch: master

commit 53f6f3bcb6bf0cb90481ab5ed77b715401464900
Author: Sun Austin <email address hidden>
Date: Tue Oct 30 14:08:00 2018 +0800

    Update config to set values as string, rather than unicode

    A prior update config for python2/3 compatibility resulted
    in config values being set as unicode rather than strings. This
    ended up breaking patching on IPv6 systems, as the lib,
    if_nametoindex function used by patching in configuration of its
    multicast addresses does not properly handle unicode.
    As a result, the patching daemons were unable to communicate with
    each other.

    This update to tsconfig/config casts the values as str() to
    restore it to the previous behaviour.

    Closes-Bug:1800195

    Change-Id: Ie7ac29728e81d2e5fcb80cde34d723c1480566d0
    Signed-off-by: Sun Austin <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Ken Young (kenyis)
tags: added: stx.2019.05
removed: stx.2019.03
Ken Young (kenyis)
tags: added: stx.2.0
removed: stx.2019.05
tags: added: stx.retestneeded
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to config (master)

Fix proposed to branch: master
Review: https://review.opendev.org/680189

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to config (master)

Reviewed: https://review.opendev.org/680189
Committed: https://git.openstack.org/cgit/starlingx/config/commit/?id=2a80bd3a31635e77d9b90859d7fdfa95b592f2af
Submitter: Zuul
Branch: master

commit 2a80bd3a31635e77d9b90859d7fdfa95b592f2af
Author: Sun Austin <email address hidden>
Date: Tue Oct 30 14:08:00 2018 +0800

    Update config to set values as string, rather than unicode

    A prior update config for python2/3 compatibility resulted
    in config values being set as unicode rather than strings. This
    ended up breaking patching on IPv6 systems, as the lib,
    if_nametoindex function used by patching in configuration of its
    multicast addresses does not properly handle unicode.
    As a result, the patching daemons were unable to communicate with
    each other.

    This update to tsconfig/config casts the values as str() to
    restore it to the previous behaviour.

    Closes-Bug:1800195

    Depends-On: Ibdae0a338a1af493ac522757b61bbd6df1da941e
    Change-Id: Ie7ac29728e81d2e5fcb80cde34d723c1480566d0
    Signed-off-by: Sun Austin <email address hidden>

Revision history for this message
Anujeyan Manokeran (anujeyan) wrote :

Verified in load 2019-09-05_00-10-00.

tags: removed: stx.retestneeded
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.