Bug 1963732

Summary: [abrt] dnf: checkSig(): miscutils.py:90:checkSig:ValueError: Unexpected return value 'RSA/SHA256, mer. 19 mai 2021 23:27:32, Key ID 49fd77499570ff31' from hdr.sprintf when checking signature.
Product: [Fedora] Fedora Reporter: Yann Droneaud <yann>
Component: dnfAssignee: amatej
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 33CC: amatej, dmach, jmracek, jrohel, mblaha, mhatina, packaging-team-maint, pkratoch, reavertm, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/70cb08e2c760b8d6f6c78a38e3b2708b2f0e2f31
Whiteboard: abrt_hash:f69739e97ef9268e5a057e4afed12670155dac6b;VARIANT_ID=workstation;
Fixed In Version: dnf-4.8.0-1.fc35 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-06-15 07:21:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: cpuinfo
none
File: dnf-makecache.log
none
File: environ
none
File: mountinfo
none
File: namespaces
none
File: open_fds
none
File: _var_log_dnf.log none

Description Yann Droneaud 2021-05-23 19:46:41 UTC
Description of problem:
After downloading broken packages:

    # dnf distro-sync
    [...]
      package firefox-88.0.1-1.fc33.x86_64 does not verify: Payload SHA256 ALT digest: BAD (Expected 9047f23bef8d4d76d2fa672403e178e0ba2aede33df1d110609b9f21fb673977 != c068a24b1ad9c98f60e4fe4172784dec2147154f0f8e6008067d923257d6575f)
      package kernel-debug-debuginfo-5.12.5-200.fc33.x86_64 does not verify: Payload SHA256 ALT digest: BAD (Expected a1eed29ad88ceb61baf5a1daeacabb3c9e86b55efcf5b81b0b5d547eb57f0bcd != fcc2f78645c573200cf5bf171255bab5f854fdbab588ee4b4f3a870d0289039e)

Version-Release number of selected component:
dnf-4.7.0-1.fc33

Additional info:
reporter:       libreport-2.14.0
cgroup:         0::/user.slice/user-1000.slice/user/app.slice/app-org.gnome.Terminal.slice/vte-spawn-233d1e9b-3c3d-4258-8594-50018b0bb267.scope
cmdline:        /usr/bin/python3 /usr/bin/dnf distro-sync --best
crash_function: checkSig
exception_type: ValueError
executable:     /usr/bin/dnf
interpreter:    python3-3.9.5-1.fc33.x86_64
kernel:         5.11.19-200.fc33.x86_64
runlevel:       N 5
type:           Python3
uid:            0

Truncated backtrace:
miscutils.py:90:checkSig:ValueError: Unexpected return value 'RSA/SHA256, mer. 19 mai 2021 23:27:32, Key ID 49fd77499570ff31' from hdr.sprintf when checking signature.

Traceback (most recent call last):
  File "/usr/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.9/site-packages/dnf/cli/main.py", line 201, in user_main
    errcode = main(args)
  File "/usr/lib/python3.9/site-packages/dnf/cli/main.py", line 67, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.9/site-packages/dnf/cli/main.py", line 106, in _main
    return cli_run(cli, base)
  File "/usr/lib/python3.9/site-packages/dnf/cli/main.py", line 130, in cli_run
    ret = resolving(cli, base)
  File "/usr/lib/python3.9/site-packages/dnf/cli/main.py", line 176, in resolving
    base.do_transaction(display=displays)
  File "/usr/lib/python3.9/site-packages/dnf/cli/cli.py", line 238, in do_transaction
    self.gpgsigcheck(install_pkgs)
  File "/usr/lib/python3.9/site-packages/dnf/cli/cli.py", line 278, in gpgsigcheck
    result, errmsg = self._sig_check_pkg(po)
  File "/usr/lib/python3.9/site-packages/dnf/base.py", line 1297, in _sig_check_pkg
    sigresult = dnf.rpm.miscutils.checkSig(ts, po.localPkg())
  File "/usr/lib/python3.9/site-packages/dnf/rpm/miscutils.py", line 90, in checkSig
    raise ValueError('Unexpected return value %r from hdr.sprintf when checking signature.' % siginfo)
ValueError: Unexpected return value 'RSA/SHA256, mer. 19 mai 2021 23:27:32, Key ID 49fd77499570ff31' from hdr.sprintf when checking signature.

Local variables in innermost frame:
ts: <dnf.rpm.transaction.TransactionWrapper object at 0x7f550f0f3220>
package: '/var/cache/dnf/updates-testing-debuginfo-a0500649f598dc92/packages/kernel-debug-debuginfo-5.12.5-200.fc33.x86_64.rpm'
value: 4
currentflags: 986880
fdno: 70
hdr: <rpm.hdr object at 0x7f550f12c6d0>
string: '%|DSAHEADER?{%{DSAHEADER:pgpsig}}:{%|RSAHEADER?{%{RSAHEADER:pgpsig}}:{%|SIGGPG?{%{SIGGPG:pgpsig}}:{%|SIGPGP?{%{SIGPGP:pgpsig}}:{(none)}|}|}|}|'
siginfo: 'RSA/SHA256, mer. 19 mai 2021 23:27:32, Key ID 49fd77499570ff31'

Comment 1 Yann Droneaud 2021-05-23 19:46:45 UTC
Created attachment 1786114 [details]
File: backtrace

Comment 2 Yann Droneaud 2021-05-23 19:46:46 UTC
Created attachment 1786115 [details]
File: cpuinfo

Comment 3 Yann Droneaud 2021-05-23 19:46:58 UTC
Created attachment 1786117 [details]
File: dnf-makecache.log

Comment 4 Yann Droneaud 2021-05-23 19:47:00 UTC
Created attachment 1786118 [details]
File: environ

Comment 5 Yann Droneaud 2021-05-23 19:47:01 UTC
Created attachment 1786119 [details]
File: mountinfo

Comment 6 Yann Droneaud 2021-05-23 19:47:03 UTC
Created attachment 1786120 [details]
File: namespaces

Comment 7 Yann Droneaud 2021-05-23 19:47:04 UTC
Created attachment 1786121 [details]
File: open_fds

Comment 8 Yann Droneaud 2021-05-23 19:47:06 UTC
Created attachment 1786122 [details]
File: _var_log_dnf.log

Comment 9 Yann Droneaud 2021-05-23 19:48:17 UTC
*** Bug 1963321 has been marked as a duplicate of this bug. ***

Comment 10 amatej 2021-05-25 07:24:09 UTC
Thank you for the report!

This should be fixed by PR: https://github.com/rpm-software-management/dnf/pull/1753
Here are some tests: https://github.com/rpm-software-management/ci-dnf-stack/pull/1001

Comment 11 Maciej Mrozowski 2021-05-28 17:08:25 UTC
Some packages were not downloaded. Retrying.
(1/2): mpfr-4.1.0-7.fc34.x86_64.rpm                                                                                             283 kB/s | 326 kB     00:01
(2/2): librsvg2-2.50.6-1.fc34.x86_64.rpm                                                                                        698 kB/s | 3.4 MB     00:04
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                           1.2 MB/s |  20 MB     00:17
Failed Delta RPMs increased 19.0 MB of updates to 20.4 MB (-7.1% wasted)
error: sqlite failure: CREATE TABLE IF NOT EXISTS 'Packages' (hnum INTEGER PRIMARY KEY AUTOINCREMENT,blob BLOB NOT NULL): locking protocol
error: cannot open Packages index using sqlite - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Traceback (most recent call last):
  File "/usr/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.9/site-packages/dnf/cli/main.py", line 201, in user_main
    errcode = main(args)
  File "/usr/lib/python3.9/site-packages/dnf/cli/main.py", line 67, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.9/site-packages/dnf/cli/main.py", line 106, in _main
    return cli_run(cli, base)
  File "/usr/lib/python3.9/site-packages/dnf/cli/main.py", line 130, in cli_run
    ret = resolving(cli, base)
  File "/usr/lib/python3.9/site-packages/dnf/cli/main.py", line 176, in resolving
    base.do_transaction(display=displays)
  File "/usr/lib/python3.9/site-packages/dnf/cli/cli.py", line 238, in do_transaction
    self.gpgsigcheck(install_pkgs)
  File "/usr/lib/python3.9/site-packages/dnf/cli/cli.py", line 278, in gpgsigcheck
    result, errmsg = self._sig_check_pkg(po)
  File "/usr/lib/python3.9/site-packages/dnf/base.py", line 1297, in _sig_check_pkg
    sigresult = dnf.rpm.miscutils.checkSig(ts, po.localPkg())
  File "/usr/lib/python3.9/site-packages/dnf/rpm/miscutils.py", line 90, in checkSig
    raise ValueError('Unexpected return value %r from hdr.sprintf when checking signature.' % siginfo)
ValueError: Unexpected return value 'RSA/SHA256, Wed 26 May 2021 12:59:24 PM CEST, Key ID 1161ae6945719a39' from hdr.sprintf when checking signature.

[mrozowsk@N-20L6PF1EK4MF ~]$ sudo rpm -q rpm
rpm-4.16.1.3-1.fc34.x86_64

This is Fedora 32 Cloud Base image (two times dnf system-upgrade-ed to 34) running under WSL1 so all kind of asinine nonsense is expected.
In yum.repos, just updates enabled (no testing packages).

(passing --nogpgcheck to dnf works as W/A)

Comment 12 Fedora Update System 2021-06-15 07:21:44 UTC
FEDORA-2021-78c5f8c03d has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.