Bug 1550491 - Stacktrace (KeyError) for `dnf updateinfo list security`
Summary: Stacktrace (KeyError) for `dnf updateinfo list security`
Status: CLOSED DUPLICATE of bug 1545075
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 27
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2018-03-01 10:06 UTC by Stefan Schwarzer
Modified: 2018-03-07 10:24 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-03-07 10:24:45 UTC

Attachments (Terms of Use)

Description Stefan Schwarzer 2018-03-01 10:06:45 UTC
Description of problem:

When running `dnf updateinfo` and if security updates are available, running `dnf updateinfo list security`, I get a stacktrace.

# dnf updateinfo
Last metadata expiration check: 0:35:51 ago on 2018-03-01T08:24:02 CET.
Updates Information Summary: available
    3 Security notice(s)
    1 Bugfix notice(s)
    6 Enhancement notice(s)

and immediately following:

# dnf updateinfo list security
Last metadata expiration check: 0:37:26 ago on 2018-03-01T08:24:02 CET.
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.6/site-packages/dnf/cli/main.py", line 179, in user_main
    errcode = main(args)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 64, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 99, in _main
    return cli_run(cli, base)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 115, in cli_run
  File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 1014, in run
    return self.command.run()
  File "/usr/lib/python3.6/site-packages/dnf/cli/commands/updateinfo.py", line 417, in run
    display(apkg_adv_insts, mixed, description)
  File "/usr/lib/python3.6/site-packages/dnf/cli/commands/updateinfo.py", line 292, in display_list
    for (nevra, inst), id2type in cls._list(apkg_adv_insts))
  File "/usr/lib/python3.6/site-packages/dnf/cli/commands/updateinfo.py", line 292, in <genexpr>
    for (nevra, inst), id2type in cls._list(apkg_adv_insts))
  File "/usr/lib/python3.6/site-packages/dnf/cli/commands/updateinfo.py", line 290, in <genexpr>
    for id_, (typ, sev) in id2type.items()),
  File "/usr/lib/python3.6/site-packages/dnf/cli/commands/updateinfo.py", line 283, in type2label
    return (cls.SECURITY2LABEL[sev] if typ == hawkey.ADVISORY_SECURITY
KeyError: 'None'

Version-Release number of selected component (if applicable):

# cat /etc/fedora-release
Fedora release 26 (Twenty Six)

# dnf --version
  Installed: dnf-0:2.7.5-2.fc26.noarch at 2017-12-12T22:20:45 GMT
  Built    : Fedora Project at 2017-11-29T09:55:03 GMT

  Installed: rpm-0: at 2017-11-11T19:13:11 GMT
  Built    : Fedora Project at 2017-10-26T08:32:51 GMT

dnf 2.7.5 seems to be the default version in Fedora 26.

How reproducible:

On every run - if security updates are available. I don't know if this happens if updates are available, but no security updates.

Steps to Reproduce:
1. Run `dnf updateinfo`
2. If security updates are available, run `dnf updateinfo list security`

Actual results:

See stacktrace above.

Expected results:

`dnf updateinfo list security` should list information about security updates.

Additional info:

I also tried running `dnf clean all` before repeating `dnf updateinfo list security`, but this didn't change anything.

I tried different alternative command line invocations that I found on the web, but I get the same stacktrace for each of the possibilities.

A search in the Red Hat bugtracker didn't give me any results on the problem.

I had to select a component and a subcomponent to submit the bug. I don't know if the selections make sense in the context of this bug.

Comment 1 Marek Blaha 2018-03-07 10:24:45 UTC

*** This bug has been marked as a duplicate of bug 1545075 ***

Note You need to log in before you can comment on or make changes to this bug.