Bug 2029906 - RHOSP 16.2 /usr/share/openstack-tripleo-common/healthcheck/common.sh: line 160: $1: unbound variable
Summary: RHOSP 16.2 /usr/share/openstack-tripleo-common/healthcheck/common.sh: line 16...
Keywords:
Status: CLOSED DUPLICATE of bug 1961321
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-common
Version: 16.2 (Train)
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
: ---
Assignee: Adriano Petrich
QA Contact: David Rosenfeld
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-07 14:31 UTC by XinhuaLi
Modified: 2021-12-08 07:12 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-12-08 07:12:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OSP-11205 0 None None None 2021-12-07 14:37:43 UTC

Description XinhuaLi 2021-12-07 14:31:01 UTC
Description of problem:
We can see error against  "healthcheck_memcahced " as below.

-------------------------------------------------------------------------
#/usr/bin/podman exec --user root memcached /openstack/healthcheck
/usr/share/openstack-tripleo-common/healthcheck/common.sh: line 160: $1: unbound variable
-------------------------------------------------------------------------
-------------------------------------------------------------------------
tripleo_memcached_healthcheck.service - memcached healthcheck
   Loaded: loaded (/etc/systemd/system/tripleo_memcached_healthcheck.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2021-12-07 06:49:26 +03; 5s ago
  Process: 898636 ExecStart=/usr/bin/podman exec --user root memcached /openstack/healthcheck (code=exited, status=1/FAILURE)
 Main PID: 898636 (code=exited, status=1/FAILURE)
-------------------------------------------------------------------------

-------------------------------------------------------------------------
(undercloud) [stack@director tmp]$ sudo systemctl status tripleo_memcached_healthcheck.service
● tripleo_memcached_healthcheck.service - memcached healthcheck
   Loaded: loaded (/etc/systemd/system/tripleo_memcached_healthcheck.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2021-12-07 10:39:40 +03; 4s ago
  Process: 371469 ExecStart=/usr/bin/podman exec --user root memcached /openstack/healthcheck (code=exited, status=1/FAILURE)
 Main PID: 371469 (code=exited, status=1/FAILURE)

Dec 07 10:39:39 xxxxxx systemd[1]: Starting memcached healthcheck...
Dec 07 10:39:40 xxxxxx podman[371469]: 2021-12-07 10:39:40.262533931 +0300 +03 m=+0.346147368 container exec 6bcb4fc48ebe12fd9bc1b5a27296dfc92ac527b8ebafcfe4b497cfffadedb984 >
Dec 07 10:39:40 xxxxxx healthcheck_memcached[371469]: 2021/12/07 10:39:40 socat[293] E getaddrinfo("", "NULL", {1,0,1,6}, {}): Name or service not known
Dec 07 10:39:40 xxxxxx systemd[1]: tripleo_memcached_healthcheck.service: Main process exited, code=exited, status=1/FAILURE
Dec 07 10:39:40 xxxxxx systemd[1]: tripleo_memcached_healthcheck.service: Failed with result 'exit-code'.
Dec 07 10:39:40 xxxxxx systemd[1]: Failed to start memcached healthcheck.

(undercloud) [stack@director tmp]$ sudo /usr/bin/podman exec --user root memcached /openstack/healthcheck
2021/12/07 10:40:09 socat[305] E getaddrinfo("", "NULL", {1,0,1,6}, {}): Name or service not known
-------------------------------------------------------------------------

Version-Release number of selected component (if applicable):
-------------------------------------------------------------------------
openstack-memcached    16.2    e4541c8a52e2  3 months ago  476 MB
Red Hat OpenStack Platform release 16.2.0 GA (Train)
-------------------------------------------------------------------------

How reproducible:
-------------------------------------------------------------------------
Install openstack  and check the healthcheck_memcached status
-------------------------------------------------------------------------

Steps to Reproduce:
1.
2.
3.

Actual results:
-------------------------------------------------------------------------
healthcheck_memcached code=exited, status=1/FAILURE 
-------------------------------------------------------------------------

Expected results:
-------------------------------------------------------------------------
works well and exit as 0 
-------------------------------------------------------------------------

Additional info:

Possible BUG (enhanced) 1 ,

We should update "/usr/share/openstack-tripleo-common/healthcheck/common.sh" line 160 in openstack-memcached container
---------------------------------------------------------------------------------
wrap_ipv6 () {
     if [ $# -ge 1 ] && [ -n "$1" ] ; then   ## <<= We should add this check and make sure we have correct parameter input 
    ip=$1

    if [[ $ip =~ ":" ]] && [[ $ip != *\] ]]; then
        echo [$ip]
    else
        echo $ip
    fi
fi  ## <<== against the previous line 2
}
---------------------------------------------------------------------------------

Possible BUG (enhanced) 2,
We should update "/usr/share/openstack-tripleo-common/healthcheck/memcached" to make sure if memcached listen on localhost (127.0.0.1) and ctrl-plane (example 172.31.100.3 ); in this situation,  memcached can still be able to get the correct IP.  Because in current implementation, memcached cannot get the correct IP address as original codes listed below.
---------------------------------------------------------------------------------
$(awk 'match($0, /-l +([0-9a-fA-F\.\:]+) /, a) {print a[1]}' /etc/sysconfig/memcached)
---------------------------------------------------------------------------------
We should make sure the match can ignore the locahost IP like 127.0.0.1 or ::1 and just keep the ctrl-plane ip

Regards
Sam

Comment 2 Luca Miccini 2021-12-08 07:12:38 UTC

*** This bug has been marked as a duplicate of bug 1961321 ***


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