Skip to content

Conversation

@krydos
Copy link

@krydos krydos commented Jan 31, 2026

When filesystem is read-only or the logger file not writable for some reason, we can switch to StdCStreamLogger to keep DNF5 working.

I was trying to fix this bug: https://bugzilla.redhat.com/show_bug.cgi?id=2164380
but then I also noticed this one - https://bugzilla.redhat.com/show_bug.cgi?id=1708166 which sounds very similar.

I'm not sure if StdCStreamLogger is a good choice. I saw there is NullLogger as well which can be an option but I wanted to keep logs even if file system is read-only.

To reproduce this issue you can follow either recommendation from Petr in this bugzilla bug.
I was able to reproduce it with Podman like this:

  • get rawhide (f44) container image (I got it originally with toolbox create -r f44 for other experiments)
  • create a container off of that image
  • run dnf builddep dnf5.spec in this new container to install all needed dependencies
  • then run podman commit container_id dnf5:latest

Then use these commands (copy pasting from my notes). 487 is container id I have, yours will be different of course.

#(run from dnf5 project root)
#compile/recompile
podman run --privileged --rm -it -v $(pwd):/work 487 /bin/bash -c 'cd /work/build && make -j4'
#run the history command
podman run --privileged --rm -it --read-only -v $(pwd):/work 487 /bin/bash -c 'export DNF5_PLUGINS_DIR=/work/build/dnf5-plugins; export LIBDNF_PLUGINS_CONFIG_DIR=/work/build/libdnf5-plugins; /work/build/dnf5/dnf5 history list'

dnf5 history list - won't run on read only filesystem in the main branch but runs well with this change.

Do you guys think it's good enough change? Should we log something like "Log file is not writable. Log information will be printed on screen" when we switch to StdCStreamLogger?

When filesystem is read-only or the logger file not writable for
some reason, we can switch to StdCStreamLogger to keep DNF5 working.

see: https://bugzilla.redhat.com/show_bug.cgi?id=2164380
@krydos krydos requested a review from a team as a code owner January 31, 2026 08:07
@krydos krydos requested review from kontura and removed request for a team January 31, 2026 08:07
@kontura kontura self-assigned this Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants