Unable to Hit RHEL Package Repos

0

I have an instance in us-gov-west which previously could access the RHEL 8 package repos but now cannot. The error I receive is:

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.

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/dnf/plugin.py", line 104, in _caller
    getattr(plugin, method)()
  File "/usr/lib/python3.6/site-packages/dnf-plugins/amazon-id.py", line 111, in config
    aws_region = json.loads(id_doc)['region']
  File "/usr/lib64/python3.6/json/__init__.py", line 348, in loads
    'not {!r}'.format(s.__class__.__name__))
TypeError: the JSON object must be str, bytes or bytearray, not 'NoneType'

Red Hat Enterprise Linux 8 for x86_64 - AppStream from RHUI (RPMs)                                                                                                              0.0  B/s |   0  B     00:00    
Errors during downloading metadata for repository 'rhel-8-appstream-rhui-rpms':
  - Curl error (6): Couldn't resolve host name for https://rhui.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel8/rhui/8/x86_64/appstream/os [Could not resolve host: rhui.REGION.aws.ce.redhat.com]
Error: Failed to download metadata for repo 'rhel-8-appstream-rhui-rpms': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for https://rhui.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel8/rhui/8/x86_64/appstream/os [Could not resolve host: rhui.REGION.aws.ce.redhat.com]

The issue looks to be that a plugin substitutes REGION with the proper region which isn't happening. I thought the issue might be due to having too old of a version of rh-amazon-rhui-client as I see that was an issue for others in the past so I updated rh-amazon-rhui-client to 4.0.4-1 which did not fix the issue. Networking (routing, DNS, etc) all appears to be functioning fine. Does anyone have any suggestions or pointers? Thank you!

asked 2 years ago4772 views
2 Answers
0
Accepted Answer

The script is probably using the EC2 Instance Meta Data Service to find the region it is in. Was IMDS turned off or set to only support V2 of the IMDS?

profile pictureAWS
EXPERT
kentrad
answered 2 years ago
  • It wasn't IMDS directly, but when I looked into what IMDS was, I realized that the host based firewall (I know it seems redundant but it's a requirement) was blocking access to 169.254.169.254 which IMDS uses. Thanks!

0

For me, this was resolived by installing the rh-amazon-rhui-client rpm. Because I could not do anything with dnf (yum), I could not install it with "dnf install rh-amazon-rhui-client". I had to go to a working server, run "dnf download rh-amazon-rhui-client", which downloaded the file rh-amazon-rhui-client-4.0.14-1.el8.noarch.rpm. I copied that file to the broken server and ran "rpm -Uvh rh-amazon-rhui-client-4.0.14-1.el8.noarch.rpm" to install it. Then, when I ran "dnf update", it reconfigured itself and began working.

kainaw
answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions