Bug 2103015

Summary: yum install URL fails do download RPM due to urlencoding provided URL
Product: Red Hat Enterprise Linux 9 Reporter: Karel Srot <ksrot>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED ERRATA QA Contact: Eva Mrakova <emrakova>
Severity: medium Docs Contact:
Priority: low    
Version: 9.0CC: james.antill, mbanas, nsella
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-4.14.0-3.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 08:18:18 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 Karel Srot 2022-07-01 07:39:06 UTC
Description of problem:

I wanted to install a scratchbuild from kojihub

keylime-agent-rust-0.1.0~20220603gitaed51c7-2.el9.x86_64.rpm

available at URL

https://kojihub.stream.rdu2.redhat.com/kojifiles/work/tasks/9846/1249846/keylime-agent-rust-0.1.0%7E20220603gitaed51c7-2.el9.x86_64.rpm

Notice that '~' has been encoded as '%7E'

However 

# yum install 'https://kojihub.stream.rdu2.redhat.com/kojifiles/work/tasks/9846/1249846/keylime-agent-rust-0.1.0%7E20220603gitaed51c7-2.el9.x86_64.rpm'
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Last metadata expiration check: 0:46:41 ago on Fri 01 Jul 2022 08:39:45 AM CEST.
[MIRROR] keylime-agent-rust-0.1.0%7E20220603gitaed51c7-2.el9.x86_64.rpm: Status code: 404 for https://kojihub.stream.rdu2.redhat.com/kojifiles/work/tasks/9846/1249846/keylime-agent-rust-0.1.0%257E20220603gitaed51c7-2.el9.x86_64.rpm (IP: 10.10.209.55)
[MIRROR] keylime-agent-rust-0.1.0%7E20220603gitaed51c7-2.el9.x86_64.rpm: Status code: 404 for https://kojihub.stream.rdu2.redhat.com/kojifiles/work/tasks/9846/1249846/keylime-agent-rust-0.1.0%257E20220603gitaed51c7-2.el9.x86_64.rpm (IP: 10.10.209.55)
[MIRROR] keylime-agent-rust-0.1.0%7E20220603gitaed51c7-2.el9.x86_64.rpm: Status code: 404 for https://kojihub.stream.rdu2.redhat.com/kojifiles/work/tasks/9846/1249846/keylime-agent-rust-0.1.0%257E20220603gitaed51c7-2.el9.x86_64.rpm (IP: 10.10.209.55)
[MIRROR] keylime-agent-rust-0.1.0%7E20220603gitaed51c7-2.el9.x86_64.rpm: Status code: 404 for https://kojihub.stream.rdu2.redhat.com/kojifiles/work/tasks/9846/1249846/keylime-agent-rust-0.1.0%257E20220603gitaed51c7-2.el9.x86_64.rpm (IP: 10.10.209.55)
[FAILED] keylime-agent-rust-0.1.0%7E20220603gitaed51c7-2.el9.x86_64.rpm: Status code: 404 for https://kojihub.stream.rdu2.redhat.com/kojifiles/work/tasks/9846/1249846/keylime-agent-rust-0.1.0%257E20220603gitaed51c7-2.el9.x86_64.rpm (IP: 10.10.209.55)
Status code: 404 for https://kojihub.stream.rdu2.redhat.com/kojifiles/work/tasks/9846/1249846/keylime-agent-rust-0.1.0%257E20220603gitaed51c7-2.el9.x86_64.rpm (IP: 10.10.209.55)

As you can see, URL fragment is 
  ...rust-0.1.0%257E2...
instead of
  ...rust-0.1.0%7E2...
due to extra encoding of '%' character.

Version-Release number of selected component (if applicable):
# rpm -q yum
yum-4.10.0-5.el9_0.noarch

How reproducible:
always


Steps to Reproduce:
1. see above

Actual results:
Cannot download RPM

Expected results:
Can download RPM

Additional info:

# wget https://kojihub.stream.rdu2.redhat.com/kojifiles/work/tasks/9846/1249846/keylime-agent-rust-0.1.0%7E20220603gitaed51c7-2.el9.x86_64.rpm
--2022-07-01 09:37:55--  https://kojihub.stream.rdu2.redhat.com/kojifiles/work/tasks/9846/1249846/keylime-agent-rust-0.1.0%7E20220603gitaed51c7-2.el9.x86_64.rpm
Resolving kojihub.stream.rdu2.redhat.com (kojihub.stream.rdu2.redhat.com)... 10.10.209.55
Connecting to kojihub.stream.rdu2.redhat.com (kojihub.stream.rdu2.redhat.com)|10.10.209.55|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3469559 (3.3M) [application/x-rpm]
Saving to: ‘keylime-agent-rust-0.1.0~20220603gitaed51c7-2.el9.x86_64.rpm’

keylime-agent-rust-0.1.0~20220603git 100%[=====================================================================>]   3.31M  3.58MB/s    in 0.9s    

2022-07-01 09:37:56 (3.58 MB/s) - ‘keylime-agent-rust-0.1.0~20220603gitaed51c7-2.el9.x86_64.rpm’ saved [3469559/3469559]


The bug is present also on RHEL-8.

Comment 12 errata-xmlrpc 2023-05-09 08:18:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (dnf bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2490