Bash completion error on director after update to 16.2.2 or 16.2.3 - Could not chdir to home directory /home/user: No such file or directory

Solution Verified - Updated -

Environment

  • Red Hat OpenStack Platform 16.2.2 (RHOSP).
  • Red Hat OpenStack Platform 16.2.3 (RHOSP).

Issue

When login into the director node, after update RHOSP to version 16.2.2 or 16.2.3 appears the following error:

Could not chdir to home directory /home/user: No such file or directory
-bash: <year-month-day>: command not found

Resolution

Run the following command on director node to delete the extra line. 'year-month-day' needs to be replaced with corresponding one.

sudo sed -i '/<year-month-day>/d' /etc/bash_completion.d/osc.bash_completion

Note:

This bugzilla was opened in order to solve this issue. Should be resolved in RHOSP 16.2.4 release.

Root Cause

When install python3-openstackclient4.0.2-2.20220111042153.54bf2c0.el8ost.noarch

Generates (Example Output):

/etc/bash_completion.d/osc.bash_completion

  if [ -z "${completed}" ] ; then
    COMPREPLY=( $( compgen -f -- "$cur" ) $( compgen -d -- "$cur" ) )
  else
    COMPREPLY=( $(compgen -W "${completed}" -- ${cur}) )
  fi
  return 0
}
complete -F _openstack openstack
2022-04-04 20:08:04.813 645220 INFO osc_lib.shell [-] END return value: 0

but it contains an additional line (2022-04-25 08:32:19.293 61326 INFO osc_lib.shell [-] END return value: 0) that should not be.

Steps to Reproduce (from engineering's perspective):

  1. sudo dnf reinstall python3-openstackclient4.0.2-2.20220111042153.54bf2c0.el8ost.noarch
  2. tail /etc/bash_completion.d/osc.bash_completion
  3. see garbage (Extra line).

Diagnostic Steps

Run the following command to delete the extra line. 'year-month-day' needs to be replaced with corresponding one.

grep "<year-month-day>" /etc/bash_completion.d/*

Example Output:

/etc/bash_completion.d/osc.bash_completion:2022-04-25 08:32:19.293 61326 INFO osc_lib.shell [-] END return value: 0

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.