Bug 1955309

Summary: Improperly formatted text string in dnf package_install
Product: [Fedora] Fedora Reporter: Mark Faine <mark.faine>
Component: dnfAssignee: Marek Blaha <mblaha>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dmach, jmracek, jrohel, mblaha, mhatina, packaging-team-maint, pkratoch, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
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:37 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:

Description Mark Faine 2021-04-29 20:18:10 UTC
Description of problem:

This is actually a bug in dnf. This is an improperly formatted text format string inside the dnf code.

raise dnf.exceptions.PackageNotFoundError(_('No match for argument: %s'), pkg.location)


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

See: https://github.com/ansible/ansible/issues/74504

Comment 1 Marek Blaha 2021-06-03 11:46:13 UTC
Although there indeed is an error in the exception description, this is not the root cause of your issue. It only causes that the error message contains redundant `%s` string:

No match for argument: %s: /tmp/bacula-client-5.2.13-23.1.el7.x86_64.rpm

instead of the correct

No match for argument: /tmp/bacula-client-5.2.13-23.1.el7.x86_64.rpm

This minor issue will be of course fixed.

I tried to reproduce problem from the ansible issue #74504 and eventually I succeeded when the bacula-client package was excluded on the target system. There are several places where you can setup the exclusions but most probable seems to me /etc/dnf/dnf.conf (the others places are repofiles in /etc/yum.repos.d/*.repo and the versionlock plugin).

Please can you check that /etc/dnf/dnf.conf on the target RHEL system (myserver.host.domain) does not contain lines like `excludepkgs=bacula-client`?

Comment 2 Mark Faine 2021-06-03 14:02:53 UTC
It's possible that was the cause.  I am using the yum versionlock plugin to exclude the package to ensure that a newer version is not installed.  If it is indeed caused by package exclusion, then perhaps a better error message would help.

Comment 3 Marek Blaha 2021-06-04 12:48:38 UTC
Right. I've filed bug to track better error messages: https://bugzilla.redhat.com/show_bug.cgi?id=1967927

Comment 4 Marek Blaha 2021-06-04 12:50:49 UTC
PR to fix improperly formatted string: https://github.com/rpm-software-management/dnf/pull/1776

Comment 5 Fedora Update System 2021-06-15 07:21:37 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.