Description of problem: package.remote_location() tracebacks if package is from @commandline The problem is kind of contrived but traceback is ugly. It also breaks one dnf API test in https://github.com/rpm-software-management/dnf/pull/1654 How reproducible: dnf repoquery ./some-local.rpm --location Actual results: 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 122, in cli_run cli.run() File "/usr/lib/python3.9/site-packages/dnf/cli/cli.py", line 1162, in run return self.command.run() File "/usr/lib/python3.9/site-packages/dnf/cli/commands/repoquery.py", line 596, in run location = pkg.remote_location() File "/usr/lib/python3.9/site-packages/dnf/package.py", line 260, in remote_location return self.repo.remote_location(self.location, schemes) File "/usr/lib/python3.9/site-packages/dnf/package.py", line 184, in repo return self.base.repos[self.reponame] KeyError: '@commandline'
Good catch! I believe it's because the @commandline repo is treated differently than others and is not part of the RepoDict. That's why we're considering adding the repo there in dnf5 so all repos are treated equally.
I create a patch that resolves the crash https://github.com/rpm-software-management/dnf/pull/1706. It also resolves the issue with installed packages (`dnf repoquery --installed --location vim-minimal`).
Here are some tests: https://github.com/rpm-software-management/ci-dnf-stack/pull/928
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle. Changing version to 34.
FEDORA-2021-4935120076 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-4935120076
FEDORA-2021-4935120076 has been pushed to the Fedora 33 stable repository. If problem still persists, please make note of it in this bug report.