Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1642126

Summary: libdnf crashes when displaying errors preventing a package from being updated
Product: [Fedora] Fedora Reporter: Stephen Gallagher <sgallagh>
Component: libdnfAssignee: rpm-software-management
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: dmach, igor.raits, jmracek, mluscon, rpm-software-management, wendellcraigbaker
Target Milestone: ---Keywords: Regression, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libdnf-0.22.3-1.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1649306 (view as bug list) Environment:
Last Closed: 2018-12-05 02:33:38 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:
Bug Depends On:    
Bug Blocks: 1649306    
Attachments:
Description Flags
Full backtrace
none
SRPM of broken fedora-release none

Description Stephen Gallagher 2018-10-23 16:38:30 UTC
Created attachment 1496750 [details]
Full backtrace

Description of problem:
I am working on an update to the fedora-release package (COPR https://copr.fedorainfracloud.org/coprs/sgallagh/fedora-editions-rework/, version 30-0.9.sgallagh.3) that produces some Conflicts and Provides issues. Instead of diplaying the errors to the user, DNF crashes and produces a traceback inside libdnf

Version-Release number of selected component (if applicable):
libdnf-0.20.0-1.fc29.x86_64
dnf-3.6.1-2.fc29.noarch
libsolv-0.6.35-3.fc29.x86_64
python3-3.7.0-9.fc29.x86_64

also happens on
libdnf-0.22.0-5.fc29.x86_64
dnf-4.0.4-1.fc29.noarch


How reproducible:
Every time

Steps to Reproduce:
1. `dnf copr enable sgallagh/fedora-editions-rework`
2. `dnf update fedora-release`


Actual results:
[root@fedoraeditions ~]# dnf update fedora-release
Last metadata expiration check: 0:11:16 ago on Tue 23 Oct 2018 12:25:05 PM EDT.
Dependencies resolved.
python3: /builddir/build/BUILD/libdnf-0.22.0/libdnf/transaction/private/../../utils/tinyformat/tinyformat.hpp:629: const char* tinyformat::detail::streamStateFromFormat(std::ostream&, bool&, bool&, int&, const char*, const tinyformat::detail::FormatArg*, int&, int): Assertion `0 && "tinyformat: Not enough conversion specifiers in format string"' failed.
Aborted (core dumped)


Expected results:
A proper error message indicating the reasons the update could not occur.

Additional info:
I am pretty sure that I have created an unsolvable dependency chain in this package that I will need to work out. However, I should be informed of the error rather than having it crash on me.

Comment 1 Stephen Gallagher 2018-10-23 16:43:28 UTC
Created attachment 1496751 [details]
SRPM of broken fedora-release

Attaching the SRPM of the fedora-release package that would generate this failure on upgrade, so if I fix my COPR you can still reproduce the issue using it.

Comment 2 Stephen Gallagher 2018-10-24 01:07:16 UTC
I have also verified that the RPMs I'm working with work just fine from Fedora 28's DNF:

dnf-2.7.5-12.fc28.noarch
libdnf-0.11.1-3.fc28.x86_64
libsolv-0.6.35-3.fc28.x86_64

So it would appear that not only is DNF crashing hard here, it's also doing so in a place where it should be processing successfully. I've updated the COPR I mentioned above to support F28, F29 and Rawhide so the difference can be easily verified.

To reproduce the successful case on F28:

sudo podman pull registry.fedoraproject.org/fedora:28
sudo podman run  --privileged -i --tty --name f28_release_rework registry.fedoraproject.org/fedora:28

Inside the container:
dnf install 'dnf-command(copr)'
dnf copr enable sgallagh/fedora-editions-rework
dnf update fedora-release

It will successfully update to the fedora-release-30-0.9.sgallagh.10 package.

Do exactly the same steps with fedora:29 instead and you will see the reported failure.

Comment 4 Fedora Update System 2018-11-22 18:56:58 UTC
libdnf-0.22.3-1.fc29 dnf-4.0.9-1.fc29 dnf-plugins-core-4.0.2-1.fc29 dnf-plugins-extras-4.0.0-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-17cbc3c616

Comment 5 Fedora Update System 2018-11-23 02:56:32 UTC
dnf-4.0.9-1.fc29, dnf-plugins-core-4.0.2-1.fc29, dnf-plugins-extras-4.0.0-1.fc29, libdnf-0.22.3-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-17cbc3c616

Comment 6 Fedora Update System 2018-12-05 02:33:38 UTC
dnf-4.0.9-1.fc29, dnf-plugins-core-4.0.2-1.fc29, dnf-plugins-extras-4.0.0-1.fc29, libdnf-0.22.3-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.