Bug 1809706 - Pushing an operator whose default channel points to a non-existent CSV breaks the entire OperatorHub UI
Summary: Pushing an operator whose default channel points to a non-existent CSV breaks...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 4.5.0
Assignee: Robb Hamilton
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks: 1811142
TreeView+ depends on / blocked
 
Reported: 2020-03-03 17:49 UTC by Jason Montleon
Modified: 2021-02-03 14:31 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: The console expects all packages to have a defaultChannel and will fail if a package does not have one. Consequence: If a package without a defaultChannel is added, the entire console fails. Fix: Any packages without defaultChannels should be filtered out so the console does not fail. Result: The console no longer fails if a package without a defaultChannel is added.
Clone Of:
: 1811142 (view as bug list)
Environment:
Last Closed: 2020-07-13 17:17:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 4639 0 None closed Bug 1809706: exclude packages without `status.defaultChannel` so app… 2021-02-16 07:28:57 UTC
Red Hat Product Errata RHBA-2020:2409 0 None None None 2020-07-13 17:18:07 UTC

Description Jason Montleon 2020-03-03 17:49:17 UTC
Description of problem:
In the process of rebranding our operator I missed updating the name of the currentCSV for the default channel. I pushed the app with operator-courier which did not fail to validate and I ended up breaking OperatorHub completely.

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

How reproducible:
Always

Steps to Reproduce:
1. Install OpenShift 4.1
2. Install an operatorsource pointing at my bad bundle
3. Browse to OperatorHub

Actual results:
OperatorHub is completely broken

Expected results:
operator-courier doesn't validate the bad bundle
OperatorHub doesn't break due to the bad CSV

Additional info:
Knowing it was my operator(source) I looked at the pod and saw the following which led me pretty directly to the problem:
time="2020-03-03T17:34:33Z" level=warning msg="strict mode disabled" error="error loading manifests from appregistry: error loading operator manifests: error loading package into db: [FOREIGN KEY constraint failed, no default channel specified for konveyor-operator]" port=50051 type=appregistry

operator-source with bad bundle:
```
apiVersion: operators.coreos.com/v1
kind: OperatorSource
metadata:
  name: jmontleon-operator
  namespace: openshift-marketplace
spec:
  type: appregistry
  endpoint: https://quay.io/cnr
  registryNamespace: jmontleon
  displayName: "Migration Operator"
  publisher: "ocp-migrate-team"
```

Error in the UI is:
TypeError
Description:

o.a(...) is undefined
Component Trace: 
in OperatorHubList
    in Unknown
    in Unknown
    in x
    in t
    in x
    in div
    in div
    in Unknown
    in t
    in OperatorHubPage
    in t
    in e
    in w
    in e
    in div
    in div
    in section
    in h
    in Unknown
    in x
    in x
    in main
    in div
    in b
    in t
    in e
    in e
    in e

Stack Trace:
g/y<@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/operator-hub-chunk-02d8d2277a00b831aae3.min.js:1:18799
g@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/operator-hub-chunk-02d8d2277a00b831aae3.min.js:1:18725
Ra@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/vendors~main-chunk-40fda64599f8ff76fdc8.min.js:118:55337
pi@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/vendors~main-chunk-40fda64599f8ff76fdc8.min.js:118:62378
Kc@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/vendors~main-chunk-40fda64599f8ff76fdc8.min.js:118:99519
Fc@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/vendors~main-chunk-40fda64599f8ff76fdc8.min.js:118:84010
Hc@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/vendors~main-chunk-40fda64599f8ff76fdc8.min.js:118:81035
Tc@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/vendors~main-chunk-40fda64599f8ff76fdc8.min.js:118:79608
po/<@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/vendors~main-chunk-40fda64599f8ff76fdc8.min.js:118:41759
e.unstable_runWithPriority@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/vendors~main-chunk-40fda64599f8ff76fdc8.min.js:126:3878
lo@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/vendors~main-chunk-40fda64599f8ff76fdc8.min.js:118:41488
po@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/vendors~main-chunk-40fda64599f8ff76fdc8.min.js:118:41707
ho@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/vendors~main-chunk-40fda64599f8ff76fdc8.min.js:118:41640
Ac@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/vendors~main-chunk-40fda64599f8ff76fdc8.min.js:118:79935
notify@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/vendors~main-chunk-40fda64599f8ff76fdc8.min.js:29:47885
i</e.notifyNestedSubs@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/vendors~main-chunk-40fda64599f8ff76fdc8.min.js:29:47454
f</n.notifySubscribers@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/vendors~main-chunk-40fda64599f8ff76fdc8.min.js:35:1722366
i</e.handleChangeWrapper@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/vendors~main-chunk-40fda64599f8ff76fdc8.min.js:29:47522
m@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/vendors~main-chunk-40fda64599f8ff76fdc8.min.js:12:508121
h/</</<@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/main-chunk-7cf55c70a0cf82419afb.min.js:1:122509
dispatch@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/vendors~main-chunk-40fda64599f8ff76fdc8.min.js:12:511620
s/</</<@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/main-chunk-7cf55c70a0cf82419afb.min.js:1:101612
s/</<@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/main-chunk-7cf55c70a0cf82419afb.min.js:1:101582
c/</<@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/main-chunk-7cf55c70a0cf82419afb.min.js:1:98979
c/<@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/main-chunk-7cf55c70a0cf82419afb.min.js:1:99084
i@https://console-openshift-console.apps.jmontleon.migration.redhat.com/static/main-chunk-7cf55c70a0cf82419afb.min.js:1:97825

Comment 3 Yadan Pei 2020-03-09 07:05:51 UTC
The issue is still reproduced on 4.5.0-0.nightly-2020-03-06-190457, will check on newer build

Comment 4 Yadan Pei 2020-03-12 03:11:56 UTC
1. cluster admin create the operator source 
# cat operator-source.yaml
apiVersion: operators.coreos.com/v1
kind: OperatorSource
metadata:
  name: jmontleon-operator
  namespace: openshift-marketplace
spec:
  type: appregistry
  endpoint: https://quay.io/cnr
  registryNamespace: jmontleon
  displayName: "Migration Operator"
  publisher: "ocp-migrate-team"
# oc create -f operator-source.yaml 
operatorsource.operators.coreos.com/jmontleon-operator created
# oc get operatorsource  -n openshift-marketplace
NAME                  TYPE          ENDPOINT              REGISTRY              DISPLAYNAME           PUBLISHER                     STATUS      MESSAGE                                       AGE
certified-operators   appregistry   https://quay.io/cnr   certified-operators   Certified Operators   Red Hat                       Succeeded   The object has been successfully reconciled   108m
community-operators   appregistry   https://quay.io/cnr   community-operators   Community Operators   Red Hat                       Succeeded   The object has been successfully reconciled   108m
jmontleon-operator    appregistry   https://quay.io/cnr   jmontleon             Migration Operator    ocp-migrate-team   Succeeded   The object has been successfully reconciled   2m18s
redhat-marketplace    appregistry   https://quay.io/cnr   redhat-marketplace    Red Hat Marketplace   Red Hat                       Succeeded   The object has been successfully reconciled   108m
redhat-operators      appregistry   https://quay.io/cnr   redhat-operators      Red Hat Operators     Red Hat                       Succeeded   The object has been successfully reconciled   108m

2. view Operator Hub, operator items can be loaded and no broken

Verified on     4.5.0-0.nightly-2020-03-11-214319

Comment 6 errata-xmlrpc 2020-07-13 17:17:45 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, 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/RHBA-2020:2409


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