Bug 1852365

Summary: dnf fails with no error message when fs is read-only
Product: [Fedora] Fedora Reporter: Zbigniew JÄ™drzejewski-Szmek <zbyszek>
Component: dnfAssignee: Pavla Kratochvilova <pkratoch>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 33CC: davide, dmach, jmracek, jrohel, mblaha, mhatina, packaging-team-maint, pkratoch, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-4.4.0-1.fc33 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-12-10 14:36:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.