Hide Forgot
Description of problem: dnf exits with 0 exit code even when there are failure in the scriptlets. This lets the user think think their transaction is successful however the of the packages on the system may not be sucessful if there are important failure in the scriptlets. For example During "dnf update" because /boot was full and when updating/installing a newer kernel-core-4.18.0-305.3.1.el8_4.x86_64 "dracut" exited with return code 1, but "dnf" didn't exit also with return code 1. Due to the initramfs file not generated sucessfully the system will not be able to boot sucessfully and enter panic state. This causes problems where automation is used to update several systems and since dnf exits with 0 exit status , which thinks the dnf execution is successful but some of the scriptlet failure like the initramfs generation can be quite important on the package state of the system and can also cause problems to functioning. Version-Release number of selected component (if applicable): # dnf --version 4.4.2 Installed: dnf-0:4.4.2-11.el8.noarch at Mon 12 Jul 2021 07:14:26 AM GMT Built : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> at Mon 08 Mar 2021 03:43:15 PM GMT Installed: rpm-0:4.14.3-14.el8_4.x86_64 at Tue 13 Jul 2021 07:58:50 PM GMT Built : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> at Mon 31 May 2021 04:43:19 PM GMT How reproducible: 100% on scriptlet failure Steps to Reproduce: 1. We can reproduce this when updating with dnf to a newer kernel and when the rpm transaction test succeeds and kernel packages is being updated, before the initramfs generation begins , by filling the space of /boot with a dummy file which leaves little space from initramfs creation. 2. 3. Actual results: dnf exits with 0 exit status even when there is rpm scriptlet failures Expected results: dnf should not return with 0 exit status when there are scriptlet failure signifying there may have been scriptlet failure during transaction. Additional info: ~~~ ------------------------ While scriplet fails ** ------------------------ [root@localhost Packages]# dnf reinstall kernel-core-4.18.0-305.el8.x86_64.rpm Updating Subscription Management repositories. Unable to read consumer identity This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Dependencies resolved. ====================================================================================================================== Package Architecture Version Repository Size ====================================================================================================================== Reinstalling: kernel-core x86_64 4.18.0-305.el8 @commandline 36 M Transaction Summary ====================================================================================================================== Total size: 36 M Installed size: 67 M Is this ok [y/N]: y Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Reinstalling : kernel-core-4.18.0-305.el8.x86_64 1/2 Running scriptlet: kernel-core-4.18.0-305.el8.x86_64 1/2 Running scriptlet: kernel-core-4.18.0-305.el8.x86_64 2/2 Cleanup : kernel-core-4.18.0-305.el8.x86_64 2/2 Running scriptlet: kernel-core-4.18.0-305.el8.x86_64 2/2 cp: error writing '/boot/initramfs-4.18.0-305.el8.x86_64.img': No space left on device dracut: dracut: creation of /boot/initramfs-4.18.0-305.el8.x86_64.img failed warning: %posttrans(kernel-core-4.18.0-305.el8.x86_64) scriptlet failed, exit status 1 Error in POSTTRANS scriptlet in rpm package kernel-core Verifying : kernel-core-4.18.0-305.el8.x86_64 1/2 Verifying : kernel-core-4.18.0-305.el8.x86_64 2/2 Installed products updated. Reinstalled: kernel-core-4.18.0-305.el8.x86_64 Complete! [root@localhost Packages]# echo $? 0 [root@localhost Packages]# ------------------------- While executable fails ** ------------------------- [root@localhost Packages]# dnf reinstall kernel-core-4.18.0-305.el8.x86_64.rpm Updating Subscription Management repositories. Unable to read consumer identity This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Dependencies resolved. ====================================================================================================================== Package Architecture Version Repository Size ====================================================================================================================== Reinstalling: kernel-core x86_64 4.18.0-305.el8 @commandline 36 M Transaction Summary ====================================================================================================================== Total size: 36 M Installed size: 67 M Is this ok [y/N]: y Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Error: Transaction test error: installing package kernel-core-4.18.0-305.el8.x86_64 needs 36MB on the /boot filesystem Error Summary ------------- Disk Requirements: At least 36MB more space needed on the /boot filesystem. [root@localhost Packages]# echo $? 1 [root@localhost Packages]# ~~~