systemctl commands time out during installation, deployment, or upgrade with the installation toolkit

In some environments, systemctl commands such as systemctl daemon-reexec and systemctl list-unit-files might time out during installation, deployment, or upgrade using the installation toolkit. This causes the installation, deployment, or upgrade operation to fail.
When this issue occurs, a message similar to the following might be present in the installation toolkit log:
no implicit conversion of false into Array

Workaround:

  1. List all the scope files without a directory.
    for j in $(ls /run/systemd/system/session*.scope); 
    do if [[ ! -d /run/systemd/system/$j.d ]]; 
    then echo $j; 
    fi; 
    done
  2. Remove all the scope files without a directory.
    for j in $(ls /run/systemd/system/session*.scope); 
    do if [[ ! -d /run/systemd/system/$j.d ]]; 
    then rm -f $j; 
    fi; 
    done
  3. Rerun installation, deployment, or upgrade using the installation toolkit.