-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
None
-
None
-
False
-
sat-endeavour
-
None
-
None
-
None
-
None
rubygem-smart_proxy_remote_execution_ssh-0.11.4-1.el9sat.noarch.rpm
Description of problem:
during the installation of the rubygem-smart_proxy_remote_execution_ssh.noarch package the pre scriptlet is able to fail. This can happen during yum installations/updates but also during leapp upgrades.
Example:
[ 323.893019] localhost upgrade[2268]: Running scriptlet: rubygem-smart_proxy_remote_execution_ssh-0.11. 1369/4045 [ 323.899747] localhost upgrade[2268]: mv: inter-device move failed: '/usr/share/foreman-proxy/.ssh' to '/var/lib/foreman-proxy/ssh/.ssh'; unable to remove target: Directory not empty [ 323.914374] localhost upgrade[2268]: error: %prein(rubygem-smart_proxy_remote_execution_ssh-0.11.4-1.el9sat.noarch) scriptlet failed, exit status 1 [ 323.929210] localhost upgrade[2268]: Upgrading : python3.11-redis-4.3.4-4.el9pc.noarch 1370/4045 [ 323.936988] localhost upgrade[2268]: error: rubygem-smart_proxy_remote_execution_ssh-0.11.4-1.el9sat.noarch: install failed
This happens when there is an already-existing /var/lib/foreman-proxy/ssh/.ssh
I think it would be best if the scriptlet checked for this prior to the mv.
How reproducible:
Every time
Is this issue a regression from an earlier version:
No
Steps to Reproduce:
1. Create /usr/share/foreman-proxy/.ssh and /var/lib/foreman-proxy/ssh/.ssh and add test files under these
# mkdir -p /var/lib/foreman-proxy/ssh/.ssh # mkdir -p /usr/share/foreman-proxy/.ssh/ # touch /usr/share/foreman-proxy/.ssh/testusrfile # touch /var/lib/foreman-proxy/ssh/.ssh/testvarfile
2. Install rubygem-smart_proxy_remote_execution_ssh.noarch and watch the failure
Running scriptlet: rubygem-smart_proxy_remote_execution_ssh-0.11.4-1.el9sat.noarch 62/62 mv: inter-device move failed: '/usr/share/foreman-proxy/.ssh' to '/var/lib/foreman-proxy/ssh/.ssh'; unable to remove target: Directory not empty error: %prein(rubygem-smart_proxy_remote_execution_ssh-0.11.4-1.el9sat.noarch) scriptlet failed, exit status 1 Error in PREIN scriptlet in rpm package rubygem-smart_proxy_remote_execution_ssh error: rubygem-smart_proxy_remote_execution_ssh-0.11.4-1.el9sat.noarch: install failed
Actual behavior:
The rpms pre-install scriptlet is failing because it's attempting to mv to a directory that already exists and has data in it.
# rpm -qp rubygem-smart_proxy_remote_execution_ssh-0.11.4-1.el9sat.noarch.rpm --scripts preinstall scriptlet (using /bin/sh): if [ -d /usr/share/foreman-proxy/.ssh ] && [ ! -L /usr/share/foreman-proxy/.ssh ] ; then mv /usr/share/foreman-proxy/.ssh /var/lib/foreman-proxy/ssh fi
Expected behavior:
I think the scriptlet should check if the target directory already exists and has data prior to the move so that it doesn't cause the script to fail. Alternative - run the command in such a way that the scriptlet doesn't fail like with a || added (from my understanding, rpm scriptlets should exit with a 0 – see paragraph 4 of the syntax section here https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax )
Business Impact / Additional info:
Beyond the package installation failing, leads to leapp upgrade failures and yum/dnf failures.