Red Hat Capsule upgrade failed with `change from 'absent' to 'directory' failed: Cannot create /home/u19518/.ssh/id_rsa.pub; parent directory /home/u19518/.ssh does not exist` error

Solution Verified - Updated

Environment

  • Red Hat Capsule 6.11

Issue

  • Red Hat Capsule upgrade failed with the following error:

    Procedures::Installer::Upgrade: 2024-10-08 11:59:49 [NOTICE] [root] Loading installer configuration. This will take some time.
    2024-10-08 11:59:53 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
    2024-10-08 11:59:53 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
    2024-10-08 11:59:59 [WARN  ] [pre] Skipping system checks.
    2024-10-08 11:59:59 [WARN  ] [pre] Skipping system checks.
    2024-10-08 12:00:02 [NOTICE] [configure] Starting system configuration.
    2024-10-08 12:00:12 [NOTICE] [configure] 250 configuration steps out of 1747 steps complete.
    2024-10-08 12:00:18 [NOTICE] [configure] 500 configuration steps out of 1751 steps complete.
    2024-10-08 12:00:19 [NOTICE] [configure] 750 configuration steps out of 1752 steps complete.
    2024-10-08 12:00:21 [NOTICE] [configure] 1000 configuration steps out of 1756 steps complete.
    2024-10-08 12:00:21 [NOTICE] [configure] 1250 configuration steps out of 1757 steps complete.
    2024-10-08 12:00:21 [ERROR ] [configure] Cannot create /home/u19518/.ssh/id_rsa.pub; parent directory /home/u19518/.ssh does not exist
    2024-10-08 12:00:21 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Plugin::Remote_execution::Ssh/File[/home/u19518/.ssh/id_rsa.pub]/ensure: change from 'absent' to 'directory' failed: Cannot create /home/u19518/.ssh/id_rsa.pub; parent directory /home/u19518/.ssh does not exist
    2024-10-08 12:00:21 [NOTICE] [configure] 1500 configuration steps out of 1757 steps complete.
    2024-10-08 12:00:32 [NOTICE] [configure] 1750 configuration steps out of 1758 steps complete.
    2024-10-08 12:00:35 [NOTICE] [configure] System configuration has finished.
    
      There were errors detected during install.
      Please address the errors and re-run the installer to ensure the system is properly configured.
      Failing to do so is likely to result in broken functionality.
    
      The full log is at /var/log/foreman-installer/capsule.log
                                          [FAIL]
    Failed executing LANG=en_US.utf-8 foreman-installer  --disable-system-checks, exit status 6
    

Resolution

Workaround:

  1. Recreate the u19518 account and regenerated the SSH key with :
# ssh-keygen -t rsa -b 4096 -f /home/u19518/.ssh/id_rsa.pub/id_rsa_foreman_proxy -N ''
  1. Re-try the upgrade.

For more KB articles/solutions related to Red Hat Satellite 6.x Installation/Upgrade/Update Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Installation/Upgrade/Update Issues.

Root Cause

The u19518 has been deleted on the Red Hat Capsule server after the owner of the account left the organization. The Capsule upgrade failed while trying to using this user because the username is hardcoded as the SSH identity directory in the remote execution configuration in /etc/foreman-installer/scenarios.d/capsule-answers.yaml on the Capsule:

# cat /etc/foreman-installer/scenarios.d/capsule-answers.yaml | grep -i u19518 -A5 -B5
foreman_proxy::plugin::remote_execution::ssh:
  enabled: true
  listen_on: https
  generate_keys: "********"
  install_key: "********"
  ssh_identity_dir: "/home/u19518/.ssh/id_rsa.pub"                  <<==============
  ssh_identity_file: id_rsa_foreman_proxy
  ssh_keygen: "********"
  local_working_dir: "/var/tmp"
  remote_working_dir: "/var/tmp"
  ssh_kerberos_auth: false
SBR
Product(s)
Components
Category

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.