dnf fails with "- Curl error (3): URL using bad/illegal format or missing URL" for custom repository with basic access authentication
Issue
dnf commands fail on downloading custom repository metadata protected with basic access authentication with one of the following errors:
Errors during downloading metadata for repository 'custom-repository'
- Curl error (3): URL using bad/illegal format or missing URL for http://user:123abc#@example.com/pub/repos/rhel-X/repodata/repomd.xml []
Errors during downloading metadata for repository 'custom-repository'
- Curl error (3): URL using bad/illegal format or missing URL for http://user:123abc/ [Port number ended with 'a']
Environment
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- custom repository is protected with basic access authentication
- custom repository login and/or password contains special characters (such as
? # @ % & :etc) which are supplied inbaseurlwithin yum repository configuration
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.