operator-framework / operator-registry

Operator Registry runs in a Kubernetes or OpenShift cluster to provide operator catalog data to Operator Lifecycle Manager.
Apache License 2.0
212 stars 248 forks source link

OPM could provide further and helpful information to address the scenario `channel stable: this may be due to incorrect channel head` #942

Open camilamacedo86 opened 2 years ago

camilamacedo86 commented 2 years ago

What is the problem

The following error is faced usually when a user tries to add a bundle that has a version lower than the head of the channel:

2022-04-04T12:02:06.160781Z - failed - Failed to add the bundles to the index image: add prunes bundle opentelemetry-operator.v0.44.0-2 ([registry-proxy.engineering.redhat.com/rh-osbs/rhosdt-opentelemetry-operator-bundle@sha256:221e15cb50273b1dccd308ecc0ef01c22d1f2f9eba9befe6eeeb3ab234f41f2f](http://registry-proxy.engineering.redhat.com/rh-osbs/rhosdt-opentelemetry-operator-bundle@sha256:221e15cb50273b1dccd308ecc0ef01c22d1f2f9eba9befe6eeeb3ab234f41f2f)) from package opentelemetry-product, channel stable: this may be due to incorrect channel head (opentelemetry-operator.v0.44.0, skips/replaces [])

The above error message does not provide details and has not been demonstrated helpful to users sorting the problem by themselves which usually overwhelms us trying to help them.

What is the request?

a) Could we provide further details about what exactly is wrong or failed? b) Could we provide a suggestion on how to solve the issue?

Example:

By adding in this error message a text as follows:

Note that the head of the channel stable where you are trying to add the bundle opentelemetry-operator.v0.44.0-2 is opentelemetry-operator.v0.44.0. You must ensure that your solutions and upgrade graphs follows the Semantic Versioning 2.0.0 (https://semver.org/). Then, it means that you cannot configure that lower versions should replace higher bundle versions. You might want to use the link https://semvercompare.azurewebsites.net/?version=1.0.0&version=1.0.0-1&version=1.0.0-2 to check if the version provided in your new distribution is bigger than what is added in the index already for this channel.

camilamacedo86 commented 2 years ago

c/c @gallettilance @ankitathomas @anik120 wdyt?

exdx commented 2 years ago

Hi @camilamacedo86,

Thank you for raising this issue -- it does look like the error message is unclear. It would be straightforward to provide a more informative error message in this case that highlights that the bundle being added is lower semver than the one at the head of the channel.

@ankitathomas mentioned that this error is a consequence of the channel sorting heuristic that's implemented in the registry project. This issue should not be present in the new FBC-based format, since there is much more control over the contents of the catalog, and users can modify the channel contents in a more straightforward way. Since this mainly affects users of the now-deprecated sqlite-based catalogs, it's unclear how much should be done in terms of a fix.

camilamacedo86 commented 2 years ago

Hi @exdx and @ankitathomas,

I understand that this error is not present in FBC. However, we will still be using the command and SQLIndex for an extended period and this question came a lot. So, since the effort to improve the message is very low shows valid we do that. I push a PR to let us address this one, see; https://github.com/operator-framework/operator-registry/pulls

Could you help out with the review?