Bug 1950534 - OPM fails to deprecate bundles
Summary: OPM fails to deprecate bundles
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.7
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.9.0
Assignee: Ankita Thomas
QA Contact: Bruno Andrade
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-16 19:45 UTC by Yashvardhan Nanavati
Modified: 2021-10-18 17:30 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Deprecation processed list of bundles to deprecate out of order Consequence: Bundles truncated as part of another deprecation in the same call end up reported as 'missing' Fix: adding a check for bundles before any deprecation takes place, so as to differentiate between a bundle that isn't present and one that has been truncated Result: Deprecating bundles along same upgrade path no longer errors out.
Clone Of:
Environment:
Last Closed: 2021-10-18 17:30:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github operator-framework operator-registry pull 656 0 None open check presence of all bundles before deprecate 2021-06-15 16:30:13 UTC
Red Hat Product Errata RHSA-2021:3759 0 None None None 2021-10-18 17:30:35 UTC

Description Yashvardhan Nanavati 2021-04-16 19:45:00 UTC
Description of problem:
OPM fails to deprecate bundles even when they are present in the index

Version-Release number of selected component (if applicable):
OPM v1.16.1

How reproducible:
Can be reproduced

Steps to Reproduce:
1. 

opm index deprecatetruncate --generate --binary-image registry.redhat.io/openshift4/ose-operator-registry:v4.6 --from-index registry-proxy.engineering.redhat.com/rh-osbs/iib-pub:v4.6 --bundles registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:3e953a2a4910d026672681f97bdb8bfbc0c0ce21ed74790df254d8398ee8d7b9,registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:5ee476b093569846e19deca332ff18809f01e46353e0d4d8de10876be60ef3e3,registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4 --container-tool podman

2.
3.

Actual results:
The operation fails with the message `Error: error deprecating bundle registry.stage.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:5ee476b093569846e19deca332ff18809f01e46353e0d4d8de10876be60ef3e3: Bundle Image not in database`


Expected results:
The bundles should be deprecated successfully

Additional info:
The issue is that by the time it reaches the bundle starting with `5ee` it has been deprecated because the first bundle in the list has a higher version.

Comment 5 Kevin Rizza 2021-06-28 17:44:37 UTC
This fix is merged upstream and will be resolved in master as soon as the downstream branch pulls in these commits.

Comment 8 Bruno Andrade 2021-07-16 12:10:08 UTC
Looks like now it tries to deprecate the bundle, however, another error message was thrown, is that expected Ankita?

./bin/opm version                                                                                                                                                                                                                     1 ↵
Version: version.Version{OpmVersion:"v1.17.5", GitCommit:"60727603", BuildDate:"2021-07-16T11:56:47Z", GoOs:"linux", GoArch:"386"}


./bin/opm index deprecatetruncate --generate --binary-image registry.redhat.io/openshift4/ose-operator-registry:v4.6 --from-index registry-proxy.engineering.redhat.com/rh-osbs/iib-pub:v4.6 --bundles registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:3e953a2a4910d026672681f97bdb8bfbc0c0ce21ed74790df254d8398ee8d7b9,registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:5ee476b093569846e19deca332ff18809f01e46353e0d4d8de10876be60ef3e3,registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4 --container-tool podman

INFO[0000] deprecating bundles from the index            bundles="[registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:3e953a2a4910d026672681f97bdb8bfbc0c0ce21ed74790df254d8398ee8d7b9 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:5ee476b093569846e19deca332ff18809f01e46353e0d4d8de10876be60ef3e3 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4]"
INFO[0000] Pulling previous image registry-proxy.engineering.redhat.com/rh-osbs/iib-pub:v4.6 to get metadata  bundles="[registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:3e953a2a4910d026672681f97bdb8bfbc0c0ce21ed74790df254d8398ee8d7b9 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:5ee476b093569846e19deca332ff18809f01e46353e0d4d8de10876be60ef3e3 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4]"
INFO[0000] running /usr/bin/podman pull registry-proxy.engineering.redhat.com/rh-osbs/iib-pub:v4.6  bundles="[registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:3e953a2a4910d026672681f97bdb8bfbc0c0ce21ed74790df254d8398ee8d7b9 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:5ee476b093569846e19deca332ff18809f01e46353e0d4d8de10876be60ef3e3 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4]"
ERRO[0000] Trying to pull registry-proxy.engineering.redhat.com/rh-osbs/iib-pub:v4.6...
  Get "https://registry-proxy.engineering.redhat.com/v2/": dial tcp: lookup registry-proxy.engineering.redhat.com: no such host
Error: Error initializing source docker://registry-proxy.engineering.redhat.com/rh-osbs/iib-pub:v4.6: error pinging docker registry registry-proxy.engineering.redhat.com: Get "https://registry-proxy.engineering.redhat.com/v2/": dial tcp: lookup registry-proxy.engineering.redhat.com: no such host  bundles="[registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:3e953a2a4910d026672681f97bdb8bfbc0c0ce21ed74790df254d8398ee8d7b9 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:5ee476b093569846e19deca332ff18809f01e46353e0d4d8de10876be60ef3e3 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4]"
Error: error pulling image: Trying to pull registry-proxy.engineering.redhat.com/rh-osbs/iib-pub:v4.6...
  Get "https://registry-proxy.engineering.redhat.com/v2/": dial tcp: lookup registry-proxy.engineering.redhat.com: no such host
Error: Error initializing source docker://registry-proxy.engineering.redhat.com/rh-osbs/iib-pub:v4.6: error pinging docker registry registry-proxy.engineering.redhat.com: Get "https://registry-proxy.engineering.redhat.com/v2/": dial tcp: lookup registry-proxy.engineering.redhat.com: no such host
. exit status 125
Usage:
  opm index deprecatetruncate [flags]

Flags:
  -i, --binary-image opm        container image for on-image opm command
  -u, --build-tool string       tool to build container images. One of: [docker, podman]. Defaults to podman. Overrides part of container-tool.
  -b, --bundles strings         comma separated list of bundles to add
  -c, --container-tool string   tool to interact with container images (save, build, etc.). One of: [docker, podman]
  -f, --from-index string       previous index to add to
      --generate                if enabled, just creates the dockerfile and saves it to local disk
  -h, --help                    help for deprecatetruncate
  -d, --out-dockerfile string   if generating the dockerfile, this flag is used to (optionally) specify a dockerfile name
      --permissive              allow registry load errors
  -p, --pull-tool string        tool to pull container images. One of: [none, docker, podman]. Defaults to none. Overrides part of container-tool.
  -t, --tag string              custom tag for container image being built

Global Flags:
      --skip-tls   skip TLS certificate verification for container image registries while pulling bundles or index

╭─bandrade@localhost ~/QE/operator-registry ‹master› 
╰─$                                                                                                                                                                                                                                       1 ↵
╭─bandrade@localhost ~/QE/operator-registry ‹master› 
╰─$ ./bin/opm index deprecatetruncate --generate --binary-image registry.redhat.io/openshift4/ose-operator-registry:v4.6 --from-index registry-proxy.engineering.redhat.com/rh-osbs/iib-pub:v4.6 --bundles registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:3e953a2a4910d026672681f97bdb8bfbc0c0ce21ed74790df254d8398ee8d7b9,registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:5ee476b093569846e19deca332ff18809f01e46353e0d4d8de10876be60ef3e3,registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4 --container-tool podman

INFO[0000] deprecating bundles from the index            bundles="[registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:3e953a2a4910d026672681f97bdb8bfbc0c0ce21ed74790df254d8398ee8d7b9 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:5ee476b093569846e19deca332ff18809f01e46353e0d4d8de10876be60ef3e3 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4]"
INFO[0000] Pulling previous image registry-proxy.engineering.redhat.com/rh-osbs/iib-pub:v4.6 to get metadata  bundles="[registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:3e953a2a4910d026672681f97bdb8bfbc0c0ce21ed74790df254d8398ee8d7b9 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:5ee476b093569846e19deca332ff18809f01e46353e0d4d8de10876be60ef3e3 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4]"
INFO[0000] running /usr/bin/podman pull registry-proxy.engineering.redhat.com/rh-osbs/iib-pub:v4.6  bundles="[registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:3e953a2a4910d026672681f97bdb8bfbc0c0ce21ed74790df254d8398ee8d7b9 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:5ee476b093569846e19deca332ff18809f01e46353e0d4d8de10876be60ef3e3 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4]"
INFO[0046] running /usr/bin/podman pull registry-proxy.engineering.redhat.com/rh-osbs/iib-pub:v4.6  bundles="[registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:3e953a2a4910d026672681f97bdb8bfbc0c0ce21ed74790df254d8398ee8d7b9 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:5ee476b093569846e19deca332ff18809f01e46353e0d4d8de10876be60ef3e3 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4]"
INFO[0051] Getting label data from previous image        bundles="[registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:3e953a2a4910d026672681f97bdb8bfbc0c0ce21ed74790df254d8398ee8d7b9 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:5ee476b093569846e19deca332ff18809f01e46353e0d4d8de10876be60ef3e3 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4]"
INFO[0051] running podman inspect                        bundles="[registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:3e953a2a4910d026672681f97bdb8bfbc0c0ce21ed74790df254d8398ee8d7b9 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:5ee476b093569846e19deca332ff18809f01e46353e0d4d8de10876be60ef3e3 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4]"
INFO[0051] running podman create                         bundles="[registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:3e953a2a4910d026672681f97bdb8bfbc0c0ce21ed74790df254d8398ee8d7b9 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:5ee476b093569846e19deca332ff18809f01e46353e0d4d8de10876be60ef3e3 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4]"
INFO[0051] running podman cp                             bundles="[registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:3e953a2a4910d026672681f97bdb8bfbc0c0ce21ed74790df254d8398ee8d7b9 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:5ee476b093569846e19deca332ff18809f01e46353e0d4d8de10876be60ef3e3 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4]"
INFO[0057] running podman rm                             bundles="[registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:3e953a2a4910d026672681f97bdb8bfbc0c0ce21ed74790df254d8398ee8d7b9 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:5ee476b093569846e19deca332ff18809f01e46353e0d4d8de10876be60ef3e3 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4]"
INFO[0061] deprecating bundles                           bundles="[registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:3e953a2a4910d026672681f97bdb8bfbc0c0ce21ed74790df254d8398ee8d7b9 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:5ee476b093569846e19deca332ff18809f01e46353e0d4d8de10876be60ef3e3 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4]"
ERRO[0061] permissive mode disabled                      bundles="[registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:3e953a2a4910d026672681f97bdb8bfbc0c0ce21ed74790df254d8398ee8d7b9 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:5ee476b093569846e19deca332ff18809f01e46353e0d4d8de10876be60ef3e3 registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4]" error="error deprecating bundle registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4: Bundle deprecation causing default channel removal"
Error: error deprecating bundle registry.redhat.io/openshift-pipelines-tech-preview/pipelines-rhel8-operator-metadata@sha256:0f4b4082d0b087da0a56cf43ce17763925ac2bca743bf1ef164a38375ae3c5a4: Bundle deprecation causing default channel removal
Usage:
  opm index deprecatetruncate [flags]

Flags:
  -i, --binary-image opm        container image for on-image opm command
  -u, --build-tool string       tool to build container images. One of: [docker, podman]. Defaults to podman. Overrides part of container-tool.
  -b, --bundles strings         comma separated list of bundles to add
  -c, --container-tool string   tool to interact with container images (save, build, etc.). One of: [docker, podman]
  -f, --from-index string       previous index to add to
      --generate                if enabled, just creates the dockerfile and saves it to local disk
  -h, --help                    help for deprecatetruncate
  -d, --out-dockerfile string   if generating the dockerfile, this flag is used to (optionally) specify a dockerfile name
      --permissive              allow registry load errors
  -p, --pull-tool string        tool to pull container images. One of: [none, docker, podman]. Defaults to none. Overrides part of container-tool.
  -t, --tag string              custom tag for container image being built

Global Flags:
      --skip-tls   skip TLS certificate verification for container image registries while pulling bundles or index

Comment 10 Ankita Thomas 2021-07-19 21:03:39 UTC
This is expected when deprecating the head of the default channel. You can't deprecate the entire bundle, you'd have to build the index without it.

Comment 11 Bruno Andrade 2021-07-20 00:36:15 UTC
Thanks, marking as VERIFIED considering the previous comment

Comment 14 errata-xmlrpc 2021-10-18 17:30:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.9.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:3759


Note You need to log in before you can comment on or make changes to this bug.