Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-37741

Show wrong error when oc-mirror failed with unauthorized

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Normal Normal
    • None
    • 4.17
    • oc-mirror
    • Moderate
    • None
    • Rejected
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      Show wrong error when oc-mirror failed with unauthorized

      Version-Release number of selected component (if applicable):

      oc-mirror version WARNING: This version information is deprecated and will be replaced with the output from --short. Use --output=yaml|json to get the full version.Client Version: version.Info{Major:"", Minor:"", GitVersion:"4.17.0-202407291514.p0.gdbf115f.assembly.stream.el9-dbf115f", GitCommit:"dbf115f547a19f12ab72e7b326be219a47d460a0", GitTreeState:"clean", BuildDate:"2024-07-29T15:52:52Z", GoVersion:"go1.22.4 (Red Hat 1.22.4-2.el9) X:strictfipsruntime", Compiler:"gc", Platform:"linux/amd64"}

      How reproducible:

      100%

      Steps to Reproduce:

      1. Remove the authentication file;
      2. Run the oc-mirror command:
      `oc-mirror -c config-133.yaml file://out133 --v2`

      Actual results:

      The real failed information is show as warning, but the error information is about OC_MIRROR_CACHE:
      
      oc-mirror -c config-133.yaml file://out133 --v2
       
      2024/07/31 01:07:58  [WARN]   : ⚠️  --v2 flag identified, flow redirected to the oc-mirror v2 version. This is Tech Preview, it is still under development and it is not production ready.
      2024/07/31 01:07:58  [INFO]   : 👋 Hello, welcome to oc-mirror
      2024/07/31 01:07:58  [INFO]   : ⚙️  setting up the environment for you...
      2024/07/31 01:07:58  [INFO]   : 🔀 workflow mode: mirrorToDisk 
      2024/07/31 01:07:58  [INFO]   : 🕵️  going to discover the necessary images...
      2024/07/31 01:07:58  [INFO]   : 🔍 collecting release images...
      2024/07/31 01:07:58  [INFO]   : 🔍 collecting operator images...
      2024/07/31 01:07:58  [WARN]   : [OperatorImageCollector] catalog unable to retrieve auth token: invalid username/password: unauthorized: Please login to the Red Hat Registry using your Customer Portal credentials. Further instructions can be found here: https://access.redhat.com/RegistryAuthentication : SKIPPING
      2024/07/31 01:07:58  [INFO]   : 🔍 collecting additional images...
      2024/07/31 01:07:58  [INFO]   : 🚀 Start copying the images...
      2024/07/31 01:07:58  [INFO]   : images to copy 0 
      2024/07/31 01:07:58  [INFO]   : === Results ===
      2024/07/31 01:07:58  [INFO]   : 📦 Preparing the tarball archive...
      2024/07/31 01:07:58  [INFO]   : 👋 Goodbye, thank you for using oc-mirror
      2024/07/31 01:07:58  [ERROR]  : unable to add cache repositories to the archive : lstat /test/yinzhou/.oc-mirror/.cache/docker/registry/v2/repositories: no such file or directory
      

      Expected results:

      Show correct error information
       

       

              luzuccar@redhat.com Luigi Mario Zuccarelli
              yinzhou@redhat.com ying zhou
              ying zhou ying zhou
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: