Bug 2312906 - Unable to update the filesystem package
Summary: Unable to update the filesystem package
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 40
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-09-17 19:20 UTC by William Ruppel
Modified: 2025-01-28 08:33 UTC (History)
10 users (show)

Fixed In Version: dnf-4.22.0-1.fc40
Clone Of:
Environment:
Last Closed: 2025-01-28 08:33:19 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description William Ruppel 2024-09-17 19:20:12 UTC
Just performed a routine update, but the filesystem package refuses to cooperate.


# sudo dnf update -y
[...]
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Running scriptlet: filesystem-3.18-8.fc40.x86_64                          1/1 
  Preparing        :                                                        1/1 
  Upgrading        : filesystem-3.18-8.fc40.x86_64                          1/2 
Error unpacking rpm package filesystem-3.18-8.fc40.x86_64

Failed:
  filesystem-3.18-6.fc39.x86_64          filesystem-3.18-8.fc40.x86_64         

Error: Transaction failed



Reproducible: Always

Steps to Reproduce:
1. sudo dnf update -y

Actual Results:  
filesystem package update fails with "Error unpacking rpm package filesystem-3.18-8.fc40.x86_64"

Expected Results:  
The filesystem package updates successfully.

1. "sudo dnf clean all" did not help.
2. No extra details regarding the failure with "sudo dnf update -y -v -d10"
3. No extra details regarding the failure in /var/log/dnf.log

Comment 1 Jan Kolarik 2024-09-18 07:24:58 UTC
Hi, this sounds familiar to me. Could you check please this one: https://access.redhat.com/solutions/3639751? Anyway, it's very likely not related to dnf itself.

Comment 2 William Ruppel 2024-09-18 15:10:39 UTC
Thank you Jan for the insight. Indeed, the failure has nothing to do with DNF; I had a mount on one of the base directories provided by the filesystems package.

However, DNF does not seem to report the ROOT CAUSE of the failure, even at high logging levels. i.e. just reporting "Error unpacking rpm package" is not helpful. YUM does report the root cause: "unpacking of archive failed on file /media: cpio: lsetfilecon"

If I had seen that, I probably would have figured this out myself.

Hence, maybe we can use this bug to improve DNF error reporting?

Comment 3 Panu Matilainen 2024-09-19 06:51:29 UTC
Indeed, there have been numerous bug reports on various issues where the biggest problem is that dnf eats up the error message from rpm. Rpm's error messages can be ugly and cryptic as anything, but often vital for actually diagnosing an issue.

Comment 4 Jan Kolarik 2024-09-19 07:30:42 UTC
Right, we'll look into how this can be improved in dnf4, though it may be challenging to make changes without affecting existing dnf4 clients. However, we'll ensure the situation is improved in dnf5, which will be the default in Fedora 41+. I've already created an upstream dnf5 ticket for that: https://github.com/rpm-software-management/dnf5/issues/1709.

Comment 5 Marek Blaha 2024-09-19 09:24:51 UTC
He, I did the same and file dnf5 ticket - https://github.com/rpm-software-management/dnf5/issues/1710

Anyway, dnf4 should show you the rpm error (at least according to my tests it does):


❌1 ❯ sudo dnf upgrade -y
Last metadata expiration check: 0:13:31 ago on Thu 19 Sep 2024 11:09:47 AM CEST.
Dependencies resolved.
=========================================================================================
 Package               Architecture      Version                 Repository         Size
=========================================================================================
Upgrading:
 filesystem            x86_64            3.18-8.fc40             fedora            1.1 M

Transaction Summary
=========================================================================================
Upgrade  1 Package

Total download size: 1.1 M
Downloading Packages:
filesystem-3.18-8.fc40.x86_64.rpm                        3.5 MB/s | 1.1 MB     00:00    
-----------------------------------------------------------------------------------------
Total                                                    2.3 MB/s | 1.1 MB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Running scriptlet: filesystem-3.18-8.fc40.x86_64                                   1/1 
  Preparing        :                                                                 1/1 
  Upgrading        : filesystem-3.18-8.fc40.x86_64                                   1/2 
error: lsetfilecon: (26 /mnt, system_u:object_r:mnt_t:s0) Read-only file system
error: Plugin selinux: hook fsm_file_prepare failed

Error unpacking rpm package filesystem-3.18-8.fc40.x86_64

Failed:
  filesystem-3.18-6.fc39.x86_64               filesystem-3.18-8.fc40.x86_64              

Error: Transaction failed

Comment 6 Jan Kolarik 2024-09-19 09:32:11 UTC
When I was reproducing it with default dnf4 settings on F40 container, I got the same output as the reporter though...

Comment 7 Marek Blaha 2024-09-19 10:30:01 UTC
Interesting. Can you share a reproducer?

Comment 8 Jan Kolarik 2024-09-19 10:36:40 UTC
Sure. I've basically downloaded some iso file and mount it under /mnt. Then I've tried to update the filesystem package like "dnf upgrade filesystem --releasever 41". And I got just this message "Error unpacking rpm package filesystem-3.18-8.fc40.x86_64".

Comment 9 Marek Blaha 2024-09-20 06:49:26 UTC
OK, turned out that the rpm transaction behavior depends on the content of the mounted ISO image.
Images that I used for testing caused that the transaction failed during a scriptlet execution, which is already covered in dnf and the error messages were printed to the user. But with a different ISO (e.g. the one Jan used for testing) the transaction failed during unpacking the rpm and in this case the dnf squirrels the rpm error messages away and the user is not informed.
Will prepare a fix.

Comment 10 Marek Blaha 2024-09-20 07:04:46 UTC
PR with the fix: https://github.com/rpm-software-management/dnf/pull/2132

Comment 11 Petr Pisar 2025-01-28 08:33:19 UTC
The RPM unpacking error now provides a detailed message.


Note You need to log in before you can comment on or make changes to this bug.