#4009 RFE: Grab /var/log/dnf5.log from Mock buildroot
Closed: Fixed a year ago by tkopecek. Opened a year ago by egoode.

Mock uses DNF 5 inside the buildroot to install build dependencies. Currently, DNF 5 produces some error and debug output that only goes to /var/log/dnf5.log and is not printed to stderr or stdout. We would like this log file to be stored by Koji (alongside build.log, root.log, livemedia-out.log, etc), so we have more information when debugging builds that fail because of DNF 5, such as [1].

See also: https://github.com/rpm-software-management/dnf5/issues/522.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2262344


Yes, I agree that it can be configured on builder basis without need to alter koji code. Similarly, we're gathering "config.log" files.

Metadata Update from @tkopecek:
- Custom field Size adjusted to None

a year ago

So I can add that to site_defaults then?

config_opts['plugin_conf']['chroot_scan_opts'] = {
    'regexes': [ "dnf.*log$" ],
    'only_failed': False,
}

Metadata Update from @kevin:
- Custom field Size reset (from None)

a year ago

@kevin you'd also need the line to enable the plugin. It is not enabled by default.

Metadata Update from @mikem:
- Custom field Size adjusted to None

a year ago

I'm not sure it is that easy eventually; if enabled, the output looks e.g. like:

$ lftp https://download.copr.fedorainfracloud.org/results/packit/rpm-software-management-mock-1287/fedora-39-x86_64/06952146-mock-core-configs/
cd ok, cwd=/results/packit/rpm-software-management-mock-1287/fedora-39-x86_64/06952146-mock-core-configs                                                                 
lftp download.copr.fedorainfracloud.org:/results/packit/rpm-software-management-mock-1287/fedora-39-x86_64/06952146-mock-core-configs> find chroot_scan/
chroot_scan//
chroot_scan/var/                                                        
chroot_scan/var/lib/                                                       
chroot_scan/var/lib/mock/                                                      
chroot_scan/var/lib/mock/fedora-39-x86_64-1706201199.698861/                        
chroot_scan/var/lib/mock/fedora-39-x86_64-1706201199.698861/root/                                                      
chroot_scan/var/lib/mock/fedora-39-x86_64-1706201199.698861/root/var/                                                       
chroot_scan/var/lib/mock/fedora-39-x86_64-1706201199.698861/root/var/log/                                                       
chroot_scan/var/lib/mock/fedora-39-x86_64-1706201199.698861/root/var/log/dnf.librepo.log                                            
chroot_scan/var/lib/mock/fedora-39-x86_64-1706201199.698861/root/var/log/dnf.log
chroot_scan/var/lib/mock/fedora-39-x86_64-1706201199.698861/root/var/log/dnf.rpm.log

Copr has no problem to host the chroot_scan/ resultdir sub-directory, not sure if Koji is OK with this.

Ouch, you're right (I've disabled it in our instance and forgot about it). There is #3439 to fix this :-(

Is it easier to do some hacking on Mock's plugin, than fixing the issue? I mean, certainly possible to update mock if needed.

@praiskup Does it make sense to put chroot_scan into tarball instead?

Does it make sense to put chroot_scan into tarball instead?

AIUI, the plugin basically places additional files into the resultdir. Currently in the kojid buildArch handler, we only grab resultdir files ending in .log, .src.rpm, and .rpm. Anything else is ignored. So if this plugin drops a tarball there, it will require changes to koji for anything to be done with it from there.

Similarly, the log watching functionality in kojid only applies to .log files in resultdir.

We're in the process of adding a special case for the mock_config that kojid writes (see #3926).

it might be problematic to enable chroot_scan if runroot is in use. the plugin uses os.walk on the chroot dir and appears to cross filesystem boundaries.

So, are you more inclined to deal with dnf5.log separately? E.g. by creating sym/link from results dir to <crhoot>/var/log?

I think it is reasonable for koji itself to capture dnf5.log directly. I don't really like the idea of a symlink; the code should probably just be able to look at other locations. Unfortunately that bit of code has grown a bit unwieldy.

Metadata Update from @tkopecek:
- Issue set to the milestone: 1.35

a year ago

Metadata Update from @tkopecek:
- Issue tagged with: testing-ready

a year ago

Metadata Update from @mfilip:
- Issue tagged with: testing-done

a year ago

Log in to comment on this ticket.

Metadata
Related Pull Requests
  • #4023 Merged a year ago