Bug 2164380 - "dnf5 history" rejects to operate on a read-only file system
Summary: "dnf5 history" rejects to operate on a read-only file system
Keywords:
Status: MODIFIED
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf5
Version: 42
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-01-25 12:09 UTC by Petr Pisar
Modified: 2026-03-10 12:19 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Feature Request
Embargoed:


Attachments (Terms of Use)

Description Petr Pisar 2023-01-25 12:09:59 UTC
I'm debugging a boot failure (probably a bug in systemd or selinux) and I need to inspect transaction history to identify packages for an upgrade. Surprisingly "dnf5 history" refuse to operate on read-only file system:

# dnf5 history info 210 
Cannot open log file: //var/log/dnf5.log: Read-only file system

Could you please change DNF5 to be able to perform read operations without writing to a file system?

Comment 1 Petr Pisar 2023-01-25 12:10:50 UTC
I forgot to mention DNF5 version:

dnf5-5.0.4-3.fc38.x86_64
libdnf5-5.0.4-3.fc38.x86_64

Comment 2 Ben Cotton 2023-02-07 15:06:24 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.

Comment 3 Aoife Moloney 2024-05-07 15:56:00 UTC
This message is a reminder that Fedora Linux 38 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 38 on 2024-05-21.
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
'version' of '38'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 38 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 Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 4 Petr Pisar 2024-05-09 08:45:52 UTC
Still in issue in dnf5-5.2.1.0-20240507005045.0.ge4502c21.fc41.x86_64.

Comment 5 Aoife Moloney 2025-02-26 12:53:07 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.

Comment 6 Ruslan Bekenev 2026-01-27 09:38:54 UTC
I can't to reproduce it on f43. The way I try to reproduce it is:
- sudo btrfs property set / ro true
- dnf history info

Seems to be working fine. The log file mentioned initially cannot be written to:
user@fedora:~$ echo "hi" >> /var/log/dnf5.log
bash: /var/log/dnf5.log: Read-only file system

dnf5 version 5.2.17.0
dnf5 plugin API version 2.0
libdnf5 version 5.2.17.0
libdnf5 plugin API version 2.2

Comment 7 Petr Pisar 2026-01-27 10:13:42 UTC
It still does not work for me (dnf5-5.4.0.0-1.20260126013012622778.main.82.g2639ebd6.fc44.x86_64). And a code pertaining this execution path has not changed. Tested with booting a system with "ro init=/bin/bash" kernel parameters.

Comment 8 Ruslan Bekenev 2026-01-27 10:33:37 UTC
Thank you for letting me know about "ro init=/bin/bash", Petr, I can reproduce it as well now. 
Even with a simpler command like "dnf --version"

Comment 9 Ruslan Bekenev 2026-02-06 11:43:54 UTC
This should be fixed now in the latest main branch

https://github.com/rpm-software-management/dnf5/pull/2590

Comment 10 Fedora Update System 2026-03-10 12:19:28 UTC
FEDORA-2026-f38b1b44f9 (dnf5-5.4.0.0-1.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-f38b1b44f9


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