failed to authorize: failed to fetch anonymous token: unexpected status: 401 Unauthorized, while running oc-mirror

Solution Verified - Updated -

Issue

  • 401 Unauthorized - Server message: unauthorized: while running oc-mirror.
  • Getting Unauthorized while running oc-mirror command as root user.
  • Even after successful login to registry.redhat.io getting 401 Unauthorized after executing oc-mirror command.
[root@~]# podman login registry.redhat.io
Username: user_id
Password: password
Login Succeeded!

[root@~]# oc-mirror list operators --catalog=registry.redhat.io/redhat/redhat-operator-index:v4.12
level=info msg=trying next host error=failed to authorize: failed to fetch anonymous token: unexpected status: 401 Unauthorized host=registry.redhat.io
error: failed to list operators, please check catalog name - registry.redhat.io/redhat/redhat-operator-index:v4.12 : render reference "registry.redhat.io/redhat/redhat-operator-index:v4.12": error resolving name : failed to authorize: failed to fetch anonymous token: unexpected status: 401 Unauthorized


Environment

  • OpenShift Container Platform
    • 4.11 +
  • oc-mirror

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content