Since this morning, I've noticed that all DNF output begins with "repo_comps: Document is empty" e.g. ``` $ dnf info sldkf Updating and loading repositories: repo_comps: Document is empty at line 1:1 Repositories loaded. No matching packages to list ``` I've tried a `dnf clean all` to no avail. I've attached an strace; it appears like it comes from reading the dnf cache. Reproducible: Always Steps to Reproduce: 1. Run any dnf command 2. Observe this output I'm sure this doesn't happen on every Fedora installation, and there is something specific about my system here, but I haven't been able to gather what.
Created attachment 2108687 [details] strace of `dnf info sdfljk`
The error messages comes from libsolv when parsing *-comps-*.xml* file of a repository. The error usually means that the XML file is empty, but it is also reported when there is no root element or an entity is not terminated. Determine which repository is affected with --enablerepo, --disablerepo, or --repo options. That check the corresponding comps file under /var/cache/libdn5.
I disabled all repos, but the error persists. Here is an example using check-update, which should validate that I've disabled the repos properly ``` $ sudo dnf --disable-repo=$(dnf repolist --json | jq .[].id -r |tr '\n' ',') check-update Updating and loading repositories: repo_comps: Document is empty at line 1:1 Repositories loaded. ``` @ppisar
You can write --disable-repo='*' instead. The argument is a glob and expands to all repository identifiers. Frankly, I cannot reproduce your problem. The only other place with comps XML files is /usr/lib/sysimage/libdnf5/comps_groups directory. It retains definitions of installed groups. Do you have something interesting there? If you uninstall are groups (dnf group remove --no-packages '*'), does the problem persist?
Nice spot! $ ls /usr/lib/sysimage/libdnf5/comps_groups -l <snip> -rw-r--r--. 1 root root 0 Oct 5 13:39 cosmic-desktop.xml Deleting this file did it for me. This aligns with when I started seeing the problem; I don't recall the exact sequence of things that I did, but I believe I used `dnf history undo` to undo a groupinstall of cosmic-desktop.
Thanks for the details. Indeed when a group is installed and its XML file in /usr/lib/sysimage/libdnf5/comps_groups is empty, then this message is printed. It e.g. prevents from listing the installed groups: root@fedora-42:~ # dnf --disablerepo '*' group list --installed Updating and loading repositories: Repositories loaded. ID Name Installed rpm-development-tools RPM Development Tools yes root@fedora-42:~ # truncate -s 0 /usr/lib/sysimage/libdnf5/comps_groups/rpm-development-tools.xml root@fedora-42:~ # dnf --disablerepo '*' group list --installed Updating and loading repositories: repo_comps: Document is empty at line 1:1 Repositories loaded. root@fedora-42:~ # echo $? 0 Workaround is, as you wrote, removing that empty file: # rm /usr/lib/sysimage/libdnf5/comps_groups/rpm-development-tools.xml # dnf --disablerepo '*' group list --installed Updating and loading repositories: Repositories loaded. ID Name Installed rpm-development-tools yes I'm not aware of any DNF5 bug that would truncate the files. I only know that DNF5 was not good at atomically updating the files and if some external error occurred, like a power outage, or killing the DNF5 process, then the file could have left corrupted. That issue was supposedly fixed in https://github.com/rpm-software-management/dnf5/pull/2289 after 5.2.13.1.
Correct approach is identify and fix the cause instead of papering over the warning message by automatically removing empty files. Since the file becomes empty as a result of an unknown error, I will close this bug report for now. If somebody meets this warning again, please share us with the reproducer.