https://cdn.redhat.com/content/dist/rhel/server/7/%24releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found

Latest response

Listing of yum repolist gives error:
https://cdn.redhat.com/content/dist/rhel/server/7/%24releasever/x86_64/source/SRPMS/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.

I was able to list all repo and update server few days back but now it gives error. Firewall disable, I can ping cdn.redhat.com

Tried

rm -rf /var/cache/yum/*

yum clean all

yum repolist still gives same error

yum repolist

Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager, versionlock
https://cdn.redhat.com/content/dist/rhel/server/7/%24releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article

https://access.redhat.com/articles/1320623

If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.

https://cdn.redhat.com/content/dist/rhel/server/7/%24releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
https://cdn.redhat.com/content/dist/rhel/server/7/%24releasever/x86_64/source/SRPMS/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
repo id repo name status
rhel-7-server-rpms/$releasever/x86_64 Red Hat Enterprise Linux 7 Server (RPMs) 0
rhel-7-server-source-rpms/$releasever/x86_64 Red Hat Enterprise Linux 7 Server (Source RPMs) 0
repolist: 0

ll /etc/yum.repos.d/

total 100
-rw-r--r--. 1 root root 101162 Jul 5 00:19 redhat.repo

Any help how to fix this issue

Responses

Syed,

There is an error in the URL it is attempting to retrieve

https://cdn.redhat.com/content/dist/rhel/server/7/%24releasever...

The %24 is a '$' symbol, so it looks like you have a variable in the URL name that isn't being substituted correctly. What does the repo line look like in the redhat.repo file you have listed?

Hi Guru, The repo looks ok to me. Please find the repo details as below:

Repo ID: rhel-7-server-rpms

Repo Name: Red Hat Enterprise Linux 7 Server (RPMs) Repo URL: https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/$basearch/os Enabled: 1

Thanks, Syed

Yum isn't resolving the $releasever variable correctly. From the documentation:

You can use this variable to reference the release version of Red Hat Enterprise Linux. Yum obtains the value of $releasever from the distroverpkg=value line in the /etc/yum.conf configuration file. If there is no such line in /etc/yum.conf, then yum infers the correct value by deriving the version number from the redhat-release-server package. The value of $releasever typically consists of the major release number and the variant of Red Hat Enterprise Linux, for example 6Client, or 6Server.

Do you have this defined in the /etc/yum.conf file? Do you have the redhat-release-server package currently installed so yum can fall back to it to determine the correct releasever if it's not in yum.conf?

If you have repo_gpgcheck set to 1 in /etc/yum.conf, try commenting it out and try yum update again.

Also, you can display yum variables by running the following command:

python -c 'import yum, pprint; yb = yum.YumBase(); pprint.pprint(yb.conf.yumvar, width=1)'

PHNS Unix Admin PHNS Unix Admin ,

commenting gpgcheck doesn't fix the issue.

Akemi Yagi ,

[root@rhevm ~]# python -c 'import yum, pprint; yb = yum.YumBase(); pprint.pprint(yb.conf.yumvar, width=1)' Loaded plugins: langpacks, product-id, versionlock {'arch': 'ia32e', 'basearch': 'x86_64', 'releasever': '$releasever', 'uuid': 'xxxxxx-689a-47b6-8aef-8b02fcc1c8f5'}

From your output:

'releasever': '$releasever'

This isn't correct. As I have stated above, your yum is not correctly resolving the 'releasever' variable. I have posted questions above relating to yum.conf.

Thanks Guru for the reply.

vi /etc/yum.conf

[main]

cachedir=/var/cache/yum/$basearch/$releasever

keepcache=0

debuglevel=2

logfile=/var/log/yum.log

exactarch=1

obsoletes=1

gpgcheck=1

plugins=1

installonly_limit=3

distroverpkg=redhat-release

I have #distroverpkg and tried yum clean all; yum repolist but still see same error.

on other server which can list repo perfect have no entry of distroverpkg

What does the following command return?

rpm -q redhat-release-server
rpm -q redhat-release-server

package redhat-release-server is not installed

It looks like this is the problem, you don't have an entry in yum.conf for the releasever and there is no redhat-release-server package for yum to fall back on. It could probably be argued that this is a bug.. but that aside.. the immediate fix would be to put an entry in your yum.conf.

Can you add the following to your yum.conf file and try again?

distroverpkg=7Server

Is this in a container? it seems strange that you have ended up in this situation with a standard OS install.

Awesome...adding this line to yum.conf resolved my problem

# more /etc/yum.conf 
[main]
cachedir=/var/cache/yum/$basearch/$releasever

keepcache=0

debuglevel=2

logfile=/var/log/yum.log

exactarch=1

obsoletes=1

gpgcheck=1

plugins=1

installonly_limit=3
#####distroverpkg=redhat-release

distroverpkg=7Server
# yum clean all
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager, versionlock
Cleaning repos: rhel-7-server-rpms
Cleaning up everything
# yum repolist
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager, versionlock
https://cdn.redhat.com/content/dist/rhel/server/7/%24releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article 

https://access.redhat.com/articles/1320623

If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.

https://cdn.redhat.com/content/dist/rhel/server/7/%24releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
repo id                                                          repo name                                                            status
rhel-7-server-rpms/$releasever/x86_64                            Red Hat Enterprise Linux 7 Server (RPMs)                             0
repolist: 0

Is this a container? how was this system installed?

Can you manually install the redhat-release-server rpm package from the installation media using rpm and try again?

It is a VM and has been installed using ISO image... After installing all the yum was working fine and I have installed many packages and even updated the server from 7.2 to 7.3. For some reason I removed the subscription and then re added and from this time yum stopped working.

# ll |grep -i redhat-release-server
-r--r--r--. 1 root root    27612 Oct 27  2015 redhat-release-server-7.2-9.el7.x86_64.rpm
# rpm -ivh redhat-release-server-7.2-9.el7.x86_64.rpm 
warning: redhat-release-server-7.2-9.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:redhat-release-server-7.2-9.el7  warning: /etc/os-release saved as /etc/os-release.rpmorig
warning: /etc/system-release-cpe saved as /etc/system-release-cpe.rpmorig
################################# [100%]
# 
# cd /etc/yum.repo.d
#ll
total 180
-rw-r--r--. 1 root root 101162 Jul  5 00:19 redhatrepo
-rw-r--r--. 1 root root  73945 Jul 10 01:28 redhat.repo
-rw-r--r--. 1 root root     67 Jul 10 01:23 rhel72

# yum clean all
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager, versionlock
Cleaning repos: rhel-7-server-rpms
Cleaning up everything
# yum repolist
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager, versionlock
https://cdn.redhat.com/content/dist/rhel/server/7/%24releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article 

https://access.redhat.com/articles/1320623

If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.

https://cdn.redhat.com/content/dist/rhel/server/7/%24releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
repo id                                                          repo name                                                            status
rhel-7-server-rpms/$releasever/x86_64                            Red Hat Enterprise Linux 7 Server (RPMs)                             0

repolist: 0
# rpm -q redhat-release-server 
redhat-release-server-7.2-9.el7.x86_64

Any further progress on this issue ? I'm experiencing the exact same problem and the above steps haven't resolved my issue.

I know this topic is old. I'm not sure if Richard was able to correct his issue. Today I just experienced the exact same issue "https://cdn.redhat.com/content/dist/rhel/workstation/7/%24releasever/x86_64/optional/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found"

My issue was the "%24releasever" in the URL

I took the following steps to resolve my issue:

* cat /etc/redhat-release 
    Red Hat Enterprise Linux Workstation release 7.5 (Maipo)

* rpm -qf /etc/redhat-release
    file /etc/redhat-release  is not owned by any package

* rpm -qa | grep release     # No "redhat-release" package found

* Had to download the "redhat-release-workstation-<version>.rpm"

* rpm -ivh redhat-release-workstation-<version>.rpm

* yum clean all && rm -rf /var/cache/yum

* yum repolist    # Successful

I hope this helps someone

YES! This worked for me... Thank you!!!

#distroverpkg=redhat-release rm –rf /var/cache/yum/* yum repolist # Successful These should do the job