Translated message

A translation of this page exists in English.

在断开连接的环境中的 oc-mirror 失败,并显示 "HTTP 401 Unauthorized" 错误

Solution In Progress - Updated -

Issue

  • "oc-mirror"从 ~/.docker/config.json 中检索注册中心凭证,这对于用户为了镜像目的而被迫将凭据添加到这样一个通用位置是不方便的。如何以另一种方式定义此路径?
  • 当试图运行 "oc-mirror" 插件,而在 ${HOME}/.docker/config.json${XDG_RUNTIME_DIR}/containers/auth.json 路径中没有一个匹配私有 Container Image Registry 的注册中心凭证时,返回 401 Unauthorized error

    $ ./oc-mirror --config imageset-config.yaml file://archive
    Creating directory: archive/oc-mirror-workspace/src/publish
    Creating directory: archive/oc-mirror-workspace/src/v2
    Creating directory: archive/oc-mirror-workspace/src/charts
    Creating directory: archive/oc-mirror-workspace/src/release-signatures
    backend is not configured in imageset-config.yaml, using stateless mode
    backend is not configured in imageset-config.yaml, using stateless mode
    No metadata detected, creating new workspace
    level=info msg=trying next host error=failed to authorize: failed to fetch anonymous token: unexpected status: 401 Unauthorized host=registry.redhat.ioThe rendered catalog is invalid.Run "oc-mirror list operators --catalog CATALOG-NAME --package PACKAGE-NAME" for more information.error: error rendering new refs: render reference "registry.redhat.io/<any-namespace>/<image-name>:<image-tag>": error resolving name : failed to authorize: failed to fetch anonymous token: unexpected status: 401 Unauthorized
    the command terminates with HTTP401 Unauthorized which is something that we expect since there is no `config.json` file created.
    

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • >= 4.9

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