Bug 1811142 - 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.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.4.0
Assignee: Robb Hamilton
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On: 1809706
Blocks: 1826494
TreeView+ depends on / blocked
 
Reported: 2020-03-06 17:14 UTC by Robb Hamilton
Modified: 2020-05-04 11:45 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of: 1809706
: 1826494 (view as bug list)
Environment:
Last Closed: 2020-05-04 11:45:08 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github openshift console pull 4678 None closed [release-4.4] Bug 1811142: exclude packages without `status.defaultChannel` so app… 2020-05-05 20:02:03 UTC
Red Hat Product Errata RHBA-2020:0581 None None None 2020-05-04 11:45:29 UTC

Description Robb Hamilton 2020-03-06 17:14:02 UTC
+++ This bug was initially created as a clone of Bug #1809706 +++

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@redhat.com"
```

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 4 shahan 2020-04-23 03:12:26 UTC
create the operatorsource with:
# 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@redhat.com"

Then goto opeatorhub page, the page will not broken and works well 
4.4.0-0.ci-2020-04-22-145203

Comment 6 errata-xmlrpc 2020-05-04 11:45:08 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:0581


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