Fedora Account System
Red Hat Associate
Red Hat Customer
Executing dnf in any way returns the error message "Loading system state TOML file /usr/lib/sysimage/libdnf5/nevras.toml failed (see dnf5-system-state(7)): basic_string::_M_create". The file "nevras.toml" is an empty file in my system. I haven't messed in any way with this file. I keep my system updated and the last time I used dnf successfully was on the 5th of February. I tried simple troubleshooting steps like rebooting the PC, checking for any new network policy and checking for a faulty Wifi Adapter but i still haven't solved the problem. Reproducible: Always Steps to Reproduce: 1.sudo dnf install firefox Actual Results: Loading system state TOML file /usr/lib/sysimage/libdnf5/nevras.toml failed (see dnf5-system-state(7)): basic_string::_M_create Expected Results: It is already installed
This can happen when DNF crashes leaving that file half-updated, possible empty. E.g. when a disk space runs out, or a user kills the DNF process. Subsequent DNF invocation that resort to this error about inability of not loading the invalid TOML file. Is that your case? Unless you have a backup of that file, simply remove it. It's quite possible that DNF will complain about other files. Once you remove all of them, DNF should work again. The downside is that you will loose data that were stored in those files, like DNF history, package installation reason, etc. Upstream has a tickets <https://github.com/rpm-software-management/dnf5/issues/1609>, <https://github.com/rpm-software-management/dnf5/issues/1610> to make handling the TOML files more resilient.
(In reply to Petr Pisar from comment #1) > This can happen when DNF crashes leaving that file half-updated, possible > empty. E.g. when a disk space runs out, or a user kills the DNF process. > Subsequent DNF invocation that resort to this error about inability of not > loading the invalid TOML file. Is that your case? > > Unless you have a backup of that file, simply remove it. It's quite possible > that DNF will complain about other files. Once you remove all of them, DNF > should work again. The downside is that you will loose data that were stored > in those files, like DNF history, package installation reason, etc. > > Upstream has a tickets > <https://github.com/rpm-software-management/dnf5/issues/1609>, > <https://github.com/rpm-software-management/dnf5/issues/1610> to make > handling the TOML files more resilient. Thanks a lot. Only had to remove nevras.toml to make it work. The data is lost as you said but it's not affecting functionality so it's no big deal. The problem might have been a crash of the Fedora's "Software" application while restarting. Probable Cause Note: I used "Software" to update the system the other day before using dnf and receiving the error. After I rebooted the machine I didn't even check if it really updated. Maybe that was what caused the problem because I checked this morning to try to find the issue and Software still says that it needs to update. I received no error message so I assumed it had worked but it may have crashed. Leaving this here in case anyone else finds this issue. Thank you for your time Petr.
*** This bug has been marked as a duplicate of bug 2330306 ***