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!

질문됨 2년 전3338회 조회
2개 답변
0
수락된 답변

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
전문가
kentrad
답변함 2년 전
  • 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
답변함 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠