Bug 1631458

Summary: [abrt] dnf: build_format_fn(): repoquery.py:285:build_format_fn:KeyError: 'name'
Product: [Fedora] Fedora Reporter: Flo H. <emailtoflorian>
Component: dnfAssignee: Marek Blaha <mblaha>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: dmach, jmracek, mblaha, packaging-team-maint, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/c59dd01146c520c1511aa93d93c15375c59ee102
Whiteboard: abrt_hash:7240d444d0ba17156b5dac0133cd32707288196d;VARIANT_ID=workstation;
Fixed In Version: dnf-4.0.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-22 17:33:29 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: _var_log_dnf.log
none
File: backtrace
none
File: cgroup
none
File: cpuinfo
none
File: dnf-makecache.log
none
File: environ
none
File: mountinfo
none
File: namespaces
none
File: open_fds none

Description Flo H. 2018-09-20 15:44:15 UTC
Description of problem:
"dnf repoquery --installed --queryformat '{name}'" triggered this

Version-Release number of selected component:
dnf-2.7.5-12.fc28

Additional info:
reporter:       libreport-2.9.5
cmdline:        /usr/bin/python3 /usr/bin/dnf repoquery --installed --queryformat {name}
crash_function: build_format_fn
exception_type: KeyError
executable:     /usr/bin/dnf
interpreter:    python3-3.6.6-1.fc28.x86_64
kernel:         4.18.8-200.fc28.x86_64
runlevel:       N 5
type:           Python3
uid:            1000

Truncated backtrace:
repoquery.py:285:build_format_fn:KeyError: 'name'

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
    cli.run()
  File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 1016, in run
    return self.command.run()
  File "/usr/lib/python3.6/site-packages/dnf/cli/commands/repoquery.py", line 477, in run
    pkgs.add(self.build_format_fn(self.opts, pkg))
  File "/usr/lib/python3.6/site-packages/dnf/cli/commands/repoquery.py", line 285, in build_format_fn
    return rpm2py_format(opts.queryformat).format(po)
KeyError: 'name'

Local variables in innermost frame:
po: <dnf.cli.commands.repoquery.PackageWrapper object at 0x7f9b14bc6048>
pkg: <hawkey.Package object id 2, GConf2-3.2.6-20.fc28.x86_64, @System>
opts: Namespace(advisory=[], alldeps=False, allowerasing=None, arches=[], assumeno=None, assumeyes=None, available=False, best=None, bugfix=False, bugzilla=[], cacheonly=None, clean_requirements_on_remove=None, color=None, command=['repoquery'], comment=None, config_file_path=None, cves=[], debuglevel=None, debugsolver=None, deplist=False, destdir=None, disable_excludes=[], disableplugin=[], downloadonly=False, enableplugin=[], enhancement=False, errorlevel=None, exactdeps=False, excludepkgs=[], file=None, freshest_metadata=False, gpgcheck=None, groupmember=False, help=False, installroot=None, ip_resolve=None, key=[], latest_limit=None, legacy=False, list='installed', location=False, newpackage=False, obsoletes=None, packageatr=None, pkgfilter=None, plugins=None, queryall=False, queryfilelist=False, queryformat='{name}', queryinfo=False, querysourcerpm=False, querytags=False, quiet=None, recent=False, recursive=False, releasever=None, repo=[], repofrompath={}, repos_ed=[], resolve=False, rpmverbosity=None, security=False, setopts=[], severity=[], show_duplicates=False, showdupesfromrepos=None, skip_broken=None, sleeptime=None, srpm=False, tree=False, tsflags=None, verbose=None, version=None, whatconflicts=None, whatenhances=None, whatobsoletes=None, whatprovides=None, whatrecommends=None, whatrequires=None, whatsuggests=None, whatsupplements=None)
self: <dnf.cli.commands.repoquery.RepoQueryCommand object at 0x7f9b15d0b080>

Comment 1 Flo H. 2018-09-20 15:44:22 UTC
Created attachment 1485198 [details]
File: _var_log_dnf.log

Comment 2 Flo H. 2018-09-20 15:44:23 UTC
Created attachment 1485199 [details]
File: backtrace

Comment 3 Flo H. 2018-09-20 15:44:24 UTC
Created attachment 1485200 [details]
File: cgroup

Comment 4 Flo H. 2018-09-20 15:44:25 UTC
Created attachment 1485201 [details]
File: cpuinfo

Comment 5 Flo H. 2018-09-20 15:44:27 UTC
Created attachment 1485202 [details]
File: dnf-makecache.log

Comment 6 Flo H. 2018-09-20 15:44:28 UTC
Created attachment 1485203 [details]
File: environ

Comment 7 Flo H. 2018-09-20 15:44:32 UTC
Created attachment 1485204 [details]
File: mountinfo

Comment 8 Flo H. 2018-09-20 15:44:33 UTC
Created attachment 1485205 [details]
File: namespaces

Comment 9 Flo H. 2018-09-20 15:44:34 UTC
Created attachment 1485206 [details]
File: open_fds

Comment 10 Flo H. 2018-09-20 15:54:01 UTC
to clarify, the command should have been:

"dnf repoquery --installed --queryformat '%{name}'", I had simply forgotten the "%" and that made dnf crash