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

oc-mirror will panic when use oci-registries-config

XMLWordPrintable

    • Important
    • No
    • CFE Sprint 241
    • 1
    • Rejected
    • False
    • Hide

      None

      Show
      None
    • NA
    • 8/24: modified, green

      Description of problem:

      when use oci-registries-config, the oc-mirror will panic
      

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

      Client Version: version.Info{Major:"", Minor:"", GitVersion:"4.14.0-202308091944.p0.gdba4a0c.assembly.stream-dba4a0c", GitCommit:"dba4a0cfd0a9fd29c1e4b5bc1da737e1153cc679", GitTreeState:"clean", BuildDate:"2023-08-10T00:13:31Z", GoVersion:"go1.20.5 X:strictfipsruntime", Compiler:"gc", Platform:"linux/amd64"}
      

      How reproducible:

      always 

      Steps to Reproduce:

      1.  mirror to localhost :
      cat config.yaml 
      apiVersion: mirror.openshift.io/v1alpha2
      kind: ImageSetConfiguration
      mirror:
        operators:
          - catalog: oci:///home1/oci-414
            packages:
            - name: cluster-logging
      oc-mirror --config config.yaml docker://localhost:5000 --dest-use-http
      2. use oci-registries-config 
      `oc-mirror --config config.yaml docker://localhost:5000 --dest-use-http   --oci-registries-config /home1/registry.conf`
      

      Actual results:

      2. The oc-mirror will panic :
      oc-mirror --config config.yaml docker://ec2-18-117-165-30.us-east-2.compute.amazonaws.com:5000  --dest-use-http   --oci-registries-config /home1/registry.conf 
      Logging to .oc-mirror.log
      Checking push permissions for ec2-18-117-165-30.us-east-2.compute.amazonaws.com:5000
      Found: oc-mirror-workspace/src/publish
      Found: oc-mirror-workspace/src/v2
      Found: oc-mirror-workspace/src/charts
      Found: oc-mirror-workspace/src/release-signatures
      backend is not configured in config.yaml, using stateless mode
      backend is not configured in config.yaml, using stateless mode
      No metadata detected, creating new workspace
      panic: runtime error: invalid memory address or nil pointer dereference
      [signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x2e8a774]
      
      goroutine 43 [running]:
      github.com/containers/image/v5/docker.(*dockerImageSource).Close(0x3?)
      	/go/src/github.com/openshift/oc-mirror/vendor/github.com/containers/image/v5/docker/docker_image_src.go:170 +0x14
      github.com/openshift/oc-mirror/pkg/cli/mirror.findFirstAvailableMirror.func1()
      	/go/src/github.com/openshift/oc-mirror/pkg/cli/mirror/fbc_operators.go:449 +0x42
      github.com/openshift/oc-mirror/pkg/cli/mirror.findFirstAvailableMirror({0x4c67b38, 0xc0004ca230}, {0xc00ad56000, 0x1, 0x40d19c0?}, {0xc00077e000, 0x94}, {0xc00ac0f6b0, 0x24}, {0x0, ...})
      	/go/src/github.com/openshift/oc-mirror/pkg/cli/mirror/fbc_operators.go:467 +0x6df
      github.com/openshift/oc-mirror/pkg/cli/mirror.(*MirrorOptions).addRelatedImageToMapping(0xc0001c0f00, {0x4c67b38, 0xc0004ca230}, 0xc00ac13480?, {{0xc0074a14e8?, 0x18?}, {0xc0076563f0?, 0x8b?}}, {0xc000c5b580, 0x36})
      	/go/src/github.com/openshift/oc-mirror/pkg/cli/mirror/fbc_operators.go:154 +0x3c5
      github.com/openshift/oc-mirror/pkg/cli/mirror.(*OperatorOptions).plan.func3()
      	/go/src/github.com/openshift/oc-mirror/pkg/cli/mirror/operator.go:570 +0x52
      golang.org/x/sync/errgroup.(*Group).Go.func1()
      	/go/src/github.com/openshift/oc-mirror/vendor/golang.org/x/sync/errgroup/errgroup.go:75 +0x64
      created by golang.org/x/sync/errgroup.(*Group).Go
      	/go/src/github.com/openshift/oc-mirror/vendor/golang.org/x/sync/errgroup/errgroup.go:72 +0xa5
       

      Expected results:

      Should  not panic 

      Additional info:

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

              Created:
              Updated:
              Resolved: