Bug 1852365 - dnf fails with no error message when fs is read-only
Summary: dnf fails with no error message when fs is read-only
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 33
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Pavla Kratochvilova
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-30 09:24 UTC by Zbigniew Jędrzejewski-Szmek
Modified: 2020-12-10 14:36 UTC (History)
10 users (show)

Fixed In Version: dnf-4.4.0-1.fc33
Clone Of:
Environment:
Last Closed: 2020-12-10 14:36:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Zbigniew Jędrzejewski-Szmek 2020-06-30 09:24:16 UTC
Description of problem:
When /var/log is read-only, 'dnf upgrade' immediately exits with no message.
[root@workstation ~]# dnf upgrade
[root@workstation ~]# echo $?
1
[root@workstation ~]# strace dnf upgrade
...
stat("/var/log/dnf.log", {st_mode=S_IFREG|0644, st_size=342937, ...}) = 0
openat(AT_FDCWD, "/var/log/dnf.log", O_WRONLY|O_CREAT|O_APPEND|O_CLOEXEC, 0666) = -1 EROFS (Read-only file system)
mmap(NULL, 262144, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7facf41da000
getpid()                                = 1690
getpid()                                = 1690
rt_sigaction(SIGINT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7facf8c92b90}, {sa_handler=0x7facf89b4dcb, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7facf8c92b90}, 8) = 0
munmap(0x7facf8462000, 135168)          = 0
munmap(0x7facf614d000, 593920)          = 0
exit_group(1)                           = ?
+++ exited with 1 +++


Version-Release number of selected component (if applicable):
dnf-4.2.23-1.fc33.noarch

How reproducible:
deterministic

Steps to Reproduce:
1. Have /var/log read-only (e.g. by using udev.blockdev-read-only or by not remounting root rw).
2. Run 'sudo dnf upgrade'

Expected results:
A clear error message on the console.

Comment 1 Pavla Kratochvilova 2020-06-30 09:52:09 UTC
This should be fixed by PR https://github.com/rpm-software-management/dnf/pull/1635

Comment 2 Ben Cotton 2020-08-11 13:44:52 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle.
Changing version to 33.


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