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

OPM 1.26.4 fails to sort the bundles in semver order

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Normal Normal
    • None
    • 4.12, 4.15
    • OLM / Registry
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • No
    • None
    • None
    • Rejected
    • OPECO 247
    • 1
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

      When adding multiple bundles in a single command, OPM fails to order the bundles in the correct sequence leading to failure. But when those exact bundles are added individually, it works just fine.

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

      OPM 1.26.4

      How reproducible:

      Every time

      Steps to Reproduce:

      1. Let's take this index image as the base image: registry-proxy.engineering.redhat.com/rh-osbs/iib:594871 and extract the index.db from this
      
      2. Then run the following opm command
      
      opm registry add --database /tmp/iib-594891-11mc1z0t/database/index.db --enable-alpha --bundle-images registry.stage.redhat.io/devspaces/devspaces-operator-bundle@sha256:3e30c30e2959a62702c761d0f741bfa0a2521679498a95e672267069c368db65,registry.stage.redhat.io/devspaces/devspaces-operator-bundle@sha256:493418d9ab680411c7c2f9f4480b0ee0326219c9157eb153552642b0196648c2,registry.stage.redhat.io/devspaces/devspaces-operator-bundle@sha256:28537a07e1b20827957ca419bf3db808b50850ff326d01a334b22e629e6deaa3,registry.stage.redhat.io/devspaces/devspaces-operator-bundle@sha256:6f2b7739164df001aee2ff636b818e2ec596050139f2eb47174786112cdef0d5,registry.stage.redhat.io/devspaces/devspaces-operator-bundle@sha256:958434866d920ca451bf175bfe67880bca5cd01547b014352edd24b5af147fe1,registry.stage.redhat.io/devspaces/devspaces-operator-bundle@sha256:600d7b73e119db96e8443dc3f8b4587211068fa3b6d0f4a6e797c77b224b07a1,registry.stage.redhat.io/devspaces/devspaces-operator-bundle@sha256:ae866a29bf34b03cc5774993e227c7e0aa274216a4129e8c43d79e3c901d396e,registry.stage.redhat.io/devspaces/devspaces-operator-bundle@sha256:0725a8a29b839fd38bf89dcb9086f249147137c3822cf408fe7e120028636d56,registry.stage.redhat.io/devspaces/devspaces-operator-bundle@sha256:919be509208c0cbad852100ca967639630800eda2a7fa0e3082ef8ee86015cf8 --overwrite-latest
      
      

      Actual results:

      OPM fails with the following error message
      
      Error: [Bundle registry.stage.redhat.io/devspaces/devspaces-operator-bundle@sha256:ae866a29bf34b03cc5774993e227c7e0aa274216a4129e8c43d79e3c901d396e already exists, Cannot overwrite a bundle that is not at the head of a channel using --overwrite-latest, Bundle registry.stage.redhat.io/devspaces/devspaces-operator-bundle@sha256:3e30c30e2959a62702c761d0f741bfa0a2521679498a95e672267069c368db65 already exists, Bundle registry.stage.redhat.io/devspaces/devspaces-operator-bundle@sha256:6f2b7739164df001aee2ff636b818e2ec596050139f2eb47174786112cdef0d5 already exists, Bundle registry.stage.redhat.io/devspaces/devspaces-operator-bundle@sha256:600d7b73e119db96e8443dc3f8b4587211068fa3b6d0f4a6e797c77b224b07a1 already exists, Bundle registry.stage.redhat.io/devspaces/devspaces-operator-bundle@sha256:0725a8a29b839fd38bf89dcb9086f249147137c3822cf408fe7e120028636d56 already exists, Bundle registry.stage.redhat.io/devspaces/devspaces-operator-bundle@sha256:919be509208c0cbad852100ca967639630800eda2a7fa0e3082ef8ee86015cf8 already exists, Bundle registry.stage.redhat.io/devspaces/devspaces-operator-bundle@sha256:493418d9ab680411c7c2f9f4480b0ee0326219c9157eb153552642b0196648c2 already exists, Bundle registry.stage.redhat.io/devspaces/devspaces-operator-bundle@sha256:28537a07e1b20827957ca419bf3db808b50850ff326d01a334b22e629e6deaa3 already exists, Bundle registry.stage.redhat.io/devspaces/devspaces-operator-bundle@sha256:958434866d920ca451bf175bfe67880bca5cd01547b014352edd24b5af147fe1 already exists]

      Expected results:

      The bundles are added successfully

      Additional info:

      Our hunch is OPM is not able to sort the semver order correctly, especially the builds that have the nvr in this format : 
      
      devspacesoperator.v3.7.1-0.1691407091.p 
      devspacesoperator.v3.7.1-0.1691409576.p 
      devspacesoperator.v3.7.1-0.1691548593.p
      
      We tried the above in the IIB service which uses OPM 1.26.4
      
      Here's the failing request that exposed the bug: https://iib.engineering.redhat.com/api/v1/builds/594891/logs
      
      If the same bundles are added in multiple requests, the addition is successful
      
      https://iib.engineering.redhat.com/api/v1/builds/595701
      https://iib.engineering.redhat.com/api/v1/builds/595702
      https://iib.engineering.redhat.com/api/v1/builds/595703
      https://iib.engineering.redhat.com/api/v1/builds/595704
      https://iib.engineering.redhat.com/api/v1/builds/595705

              rh-ee-jkeister Jordan Keister
              ynanavat Yashvardhan Nanavati
              None
              None
              Xia Zhao Xia Zhao
              None
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: