failed to authorize: failed to fetch anonymous token: unexpected status: 401 Unauthorized, while running oc-mirror
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.