Bug 2076667 - "-bash: 2022-04-08: command not found" on director after upgrade to 16.2.2
Summary: "-bash: 2022-04-08: command not found" on director after upgrade to 16.2.2
Keywords:
Status: CLOSED DUPLICATE of bug 2071765
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo
Version: 16.2 (Train)
Hardware: x86_64
OS: Linux
low
low
Target Milestone: ---
: ---
Assignee: Sergii Golovatiuk
QA Contact: Jason Grosso
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-04-19 15:32 UTC by Riccardo Bruzzone
Modified: 2022-04-25 13:21 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-04-25 13:21:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OSP-14759 0 None None None 2022-04-19 15:46:04 UTC

Description Riccardo Bruzzone 2022-04-19 15:32:26 UTC
Description of problem:
- After upgrading to Red Hat OpenStack 16.2.2, the following message is observed every time an SSH login is opened to the undercloud (Director node):
    - bash: 2022-04-08: command not found

Version-Release number of selected component (if applicable):
- Red Hat OpenStack 16.2.2

How reproducible:
- The problem was observed / confirmed in all Customer environments (production and pro-production).

Steps to Reproduce:
- The problem was observed after performing a Red Hat OpenStack upgrade from 16.1.8 to 16.2.2.

-It can be also reproduced invoking the following sequence of commands [1]:
1.# ssh to the undercloud-0
2.# sudo bash
3.# cd /home/stack
4.# source stackrc
5.# openstack complete | tee /etc/bash_completion.d/osc.bash_completion > /dev/null
6.# the "command not found" can be observed every time a new ssh session or "sudo bash" command is invoked as below highlighted.

   [root@dell-r620-03 ~]# ssh stack@undercloud-0
   Last login: Tue Apr 19 10:48:55 2022 from 172.16.0.1
   -bash: 2022-04-19: command not found
   -bash: 2022-04-19: command not found

   [stack@undercloud-0 ~]$ sudo bash
   bash: 2022-04-19: command not found
   bash: 2022-04-19: command not found
   [root@undercloud-0 stack]#

Actual results:
- A comment has been added to the last row of the osc.bash_completion file as simple workaround:
  from:
   2022-04-08 16:15:22.155 752801 INFO osc_lib.shell [-] END return value: 0
  To:
   #2022-04-08 16:15:22.155 752801 INFO osc_lib.shell [-] END return value: 0

Expected results:
Fix in Red Hat OpenStack 16.2 Z stream

Additional info:

- The error of "-bash: 2022-04-08: command not found" seems to be a side effect of the command: 
# openstack complete | tee /etc/bash_completion.d/osc.bash_completion > /dev/null" 
This command is invoked via TripleO (tripleoclient.yaml) as below highlighted [1]

- As result of the openstack complete command, 
an info event was the last line added to the "osc.bash_completion" file generated via TripleO [2]:
      2022-04-08 16:15:22.155 752801 INFO osc_lib.shell [-] END return value: 0

- The error of "-bash: 2022-04-08: command not found" is detected as result of this last row added incorrectly to the osc.bash_completion file [3].
In the error message, the 2022-04-08 is the date when the tripleoclient.yaml (the openstack complete command) was invoked during the Red Hat OpenStack upgrade.

[1] File: tripleo-common/container-images/tcib/base/tripleoclient/tripleoclient.yaml

with content:

      tcib_actions:
      .....
      - run: openstack complete | tee /etc/bash_completion.d/osc.bash_completion > /dev/null
      .....
          

[2] Last 5 lines generated in /etc/bash_completion.d/osc.bash_completion

    [root@undercloud-0 ~]# tail -n 5  /etc/bash_completion.d/osc.bash_completion
      fi
      return 0
    }
    complete -F _openstack openstack
    2022-04-08 16:15:22.155 752801 INFO osc_lib.shell [-] END return value: 0
    [root@undercloud-0 ~]# 


[3] Last INFO line ("2022-04-08 16:15:22.155 752801 INFO osc_lib.shell [-] END return value: 0") is interpreted as a command when a new SSH session is opened as any user. The error of "-bash: 2022-04-08: command not found" is detected as result of this fact.

    [root@dell-r620-03 ~]# ssh stack@undercloud-0
    .....
    Last login: Tue Apr 19 07:08:25 2022 from 172.16.0.1
    -bash: 2022-04-08: command not found

Comment 2 Rabi Mishra 2022-04-25 13:21:55 UTC

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


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