Description of problem: man dnf(8) says: dnf [options] install <spec>... DNF makes sure that the given packages and their dependencies are installed on the system. Each <spec> can be either a <package-spec>, or a @<group-spec>. See Install Examples. If a given package or provide cannot be (and is not already) installed, the exit code will be non-zero. That does not seem to be the case when the package installation fails due to cpio error, for example. Version-Release number of selected component (if applicable): dnf-1.1.6-2.fc23.noarch How reproducible: Deterministic. Steps to Reproduce: 1. docker run --rm -ti fedora:23 dnf install -y opencryptoki ; echo $? Actual results: $ docker run --rm -ti fedora:23 dnf install -y opencryptoki Fedora 23 - x86_64 58 MB/s | 43 MB 00:00 Fedora 23 - x86_64 - Updates 51 MB/s | 22 MB 00:00 Last metadata expiration check performed 0:00:11 ago on Tue May 31 08:53:10 2016. Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: opencryptoki x86_64 3.4.1-1.fc23 updates 101 k opencryptoki-icsftok x86_64 3.4.1-1.fc23 updates 228 k opencryptoki-libs x86_64 3.4.1-1.fc23 updates 45 k Transaction Summary ================================================================================ Install 3 Packages Total download size: 373 k Installed size: 1.0 M Downloading Packages: (1/3): opencryptoki-libs-3.4.1-1.fc23.x86_64.rp 351 kB/s | 45 kB 00:00 (2/3): opencryptoki-3.4.1-1.fc23.x86_64.rpm 780 kB/s | 101 kB 00:00 (3/3): opencryptoki-icsftok-3.4.1-1.fc23.x86_64 1.4 MB/s | 228 kB 00:00 -------------------------------------------------------------------------------- Total 167 kB/s | 373 kB 00:02 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Installing : opencryptoki-libs-3.4.1-1.fc23.x86_64 1/3 Installing : opencryptoki-icsftok-3.4.1-1.fc23.x86_64 2/3 Installing : opencryptoki-3.4.1-1.fc23.x86_64 3/3 Error unpacking rpm package opencryptoki-3.4.1-1.fc23.x86_64 Error unpacking rpm package opencryptoki-3.4.1-1.fc23.x86_64 error: unpacking of archive failed on file /var/lock/opencryptoki: cpio: mkdir opencryptoki-3.4.1-1.fc23.x86_64 was supposed to be installed but is not! Verifying : opencryptoki-3.4.1-1.fc23.x86_64 1/3 Verifying : opencryptoki-libs-3.4.1-1.fc23.x86_64 2/3 Verifying : opencryptoki-icsftok-3.4.1-1.fc23.x86_64 3/3 Installed: opencryptoki-icsftok.x86_64 3.4.1-1.fc23 opencryptoki-libs.x86_64 3.4.1-1.fc23 Failed: opencryptoki.x86_64 3.4.1-1.fc23 Complete! $ echo $? 0 Expected results: The exit status should be 1. Additional info: Due to bug 1341079, package is not installed, dnf even reports is in the "Failed" section, but still exists with 0. This breaks container image builds because in build time, RUN commands exit with success and then the image does not contain what it is supposed to and what the author expects.
yes, looks like a bug...
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
I created a PR: https://github.com/rpm-software-management/dnf/pull/552
The PR description - It returns 1 if one or more packages were not installed or removed (was supposed to be installed but is not!), but there is not roll-back of transaction, therefore correctly installed packages are still present on system.
Probably we can still improve the verification of packages on RPM level. Please Florian can you share with us your opinion for the bugzila and proposed patch? Any information provided will be very helpful.
Well, the error handling on the rpm level is not that great. It skips subsequent related transaction members like the removals of failed updates but that's basically all it does. So returning 1 and reporting the error is probably the best thing dnf can do unless rpm grows some better recovery mechanisms.
*** Bug 1392061 has been marked as a duplicate of this bug. ***
This message is a reminder that Fedora 23 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 23. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '23'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 23 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Issue still present with dnf-1.1.10-3.fc25.noarch.