Bug 1683156 - Should show the error info in the subscription object
Summary: Should show the error info in the subscription object
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.2.0
Assignee: Evan Cordell
QA Contact: Jian Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-02-26 10:52 UTC by Jian Zhang
Modified: 2019-10-16 06:27 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-16 06:27:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:2922 0 None None None 2019-10-16 06:27:49 UTC

Internal Links: 1799167

Description Jian Zhang 2019-02-26 10:52:02 UTC
Description of problem:
There is no error event in the subscription object when failing created the InstallPlan/CSV.


Version-Release number of selected component (if applicable):
OLM image info:
               io.openshift.build.commit.id=1ac9ace63034ea90f31e5ad33435d3f5476c7d85
               io.openshift.build.commit.url=https://github.com/operator-framework/operator-lifecycle-manager/commit/1ac9ace63034ea90f31e5ad33435d3f5476c7d85
               io.openshift.build.source-location=https://github.com/operator-framework/operator-lifecycle-manager

How reproducible:
always

Steps to Reproduce:
1. Create a subscription from Operator Hub on Web console. For example, MongoDB.
2. Removed its sub/csv objects after it was installed. 
3. Recreate it.

Actual results:
No the installplan/csv objects generated.
[core@ip-10-0-134-56 ~]$ oc get sub -n openshift-operators
NAME                   PACKAGE                SOURCE                                    CHANNEL
couchbase-enterprise   couchbase-enterprise   installed-certified-openshift-operators   preview
mongodb-enterprise     mongodb-enterprise     installed-certified-openshift-operators   preview
[core@ip-10-0-134-56 ~]$ 
[core@ip-10-0-134-56 ~]$ 
[core@ip-10-0-134-56 ~]$ oc get ip -n openshift-operators
NAME            CSV                         SOURCE   APPROVAL    APPROVED
install-k2glq   couchbase-operator.v1.1.0            Automatic   true

[core@ip-10-0-134-56 ~]$ oc describe sub mongodb-enterprise -n openshift-operators
Name:         mongodb-enterprise
Namespace:    openshift-operators
Labels:       <none>
Annotations:  <none>
API Version:  operators.coreos.com/v1alpha1
Kind:         Subscription
Metadata:
  Creation Timestamp:  2019-02-26T10:27:49Z
  Generation:          1
  Resource Version:    369990
  Self Link:           /apis/operators.coreos.com/v1alpha1/namespaces/openshift-operators/subscriptions/mongodb-enterprise
  UID:                 2a7d0dc2-39b1-11e9-8ab6-02f3b7fd9150
Spec:
  Channel:                preview
  Install Plan Approval:  Automatic
  Name:                   mongodb-enterprise
  Source:                 installed-certified-openshift-operators
  Source Namespace:       openshift-operators
  Starting CSV:           mongodboperator.v0.3.2
Events:                   <none>

[core@ip-10-0-134-56 ~]$ oc get event -n openshift-operators
No resources found.

Expected results:
Should display the error event in the subscription object.

Additional info:
Check the logs of the catalog-operator, got below errors:
[core@ip-10-0-134-56 ~]$  oc logs -f catalog-operator-6c6d74b786-5ltgv  |grep mongodb
E0226 10:27:49.662135       1 queueinformer_operator.go:155] Sync "openshift-operators" failed: {mongodb-enterprise preview mongodboperator.v0.3.2 {installed-certified-openshift-operators openshift-operators}} not found: rpc error: code = Unknown desc = no bundle found for csv mongodboperator.v0.3.2
E0226 10:27:49.686207       1 queueinformer_operator.go:155] Sync "openshift-operators" failed: {mongodb-enterprise preview mongodboperator.v0.3.2 {installed-certified-openshift-operators openshift-operators}} not found: rpc error: code = Unknown desc = no bundle found for csv mongodboperator.v0.3.2
E0226 10:27:49.716031       1 queueinformer_operator.go:155] Sync "openshift-operators" failed: {mongodb-enterprise preview mongodboperator.v0.3.2 {installed-certified-openshift-operators openshift-operators}} not found: rpc error: code = Unknown desc = no bundle found for csv mongodboperator.v0.3.2

Comment 4 Stephen Cuppett 2019-05-03 18:43:21 UTC
Errors are present in logs. Introducing these at this point may introduce additional issues and instability at this point.

Comment 6 Jian Zhang 2019-07-24 06:28:20 UTC
I created a fake subscription, and can get the exact failure info: `targeted catalogsource openshift-operator-lifecycle-manager/test-operator missing` successfully, looks good to me, verify it, thanks!

OLM version:  io.openshift.build.commit.id=bb4e01820fafdfacacf275531dd8ea32bca19ccb

mac:~ jianzhang$ cat sub.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
 generateName: etcd-
 namespace: openshift-operators
spec:
 source: test-operator
 sourceNamespace: openshift-operator-lifecycle-manager
 name: etcd
 startingCSV: etcdoperator.v0.9.2
 channel: alpha

mac:~ jianzhang$ oc get catalogsource -n openshift-operator-lifecycle-manager
No resources found.

mac:~ jianzhang$ oc describe sub -n openshift-operators etcd-7zbvq
Name:         etcd-7zbvq
Namespace:    openshift-operators
Labels:       <none>
Annotations:  <none>
API Version:  operators.coreos.com/v1alpha1
Kind:         Subscription
Metadata:
  Creation Timestamp:  2019-07-24T06:06:52Z
  Generate Name:       etcd-
  Generation:          1
  Resource Version:    627616
  Self Link:           /apis/operators.coreos.com/v1alpha1/namespaces/openshift-operators/subscriptions/etcd-7zbvq
  UID:                 3b0f995d-add9-11e9-b040-06252e9f972a
Spec:
  Channel:           alpha
  Name:              etcd
  Source:            test-operator
  Source Namespace:  openshift-operator-lifecycle-manager
  Starting CSV:      etcdoperator.v0.9.2
Status:
  Catalog Health:
    Catalog Source Ref:
      API Version:       operators.coreos.com/v1alpha1
      Kind:              CatalogSource
      Name:              certified-operators
      Namespace:         openshift-marketplace
      Resource Version:  14644
      UID:               0810fcaa-ad13-11e9-8206-02247b6f9a52
    Healthy:             true
    Last Updated:        2019-07-24T06:06:52Z
    Catalog Source Ref:
      API Version:       operators.coreos.com/v1alpha1
      Kind:              CatalogSource
      Name:              community-operators
      Namespace:         openshift-marketplace
      Resource Version:  404680
      UID:               0790e2a3-ad13-11e9-8206-02247b6f9a52
    Healthy:             true
    Last Updated:        2019-07-24T06:06:52Z
    Catalog Source Ref:
      API Version:       operators.coreos.com/v1alpha1
      Kind:              CatalogSource
      Name:              redhat-operators
      Namespace:         openshift-marketplace
      Resource Version:  276867
      UID:               07bc34fb-ad13-11e9-8206-02247b6f9a52
    Healthy:             true
    Last Updated:        2019-07-24T06:06:52Z
  Conditions:
    Last Transition Time:  2019-07-24T06:06:52Z
    Message:               targeted catalogsource openshift-operator-lifecycle-manager/test-operator missing
    Reason:                UnhealthyCatalogSourceFound
    Status:                True
    Type:                  CatalogSourcesUnhealthy
  Last Updated:            2019-07-24T06:06:52Z
Events:                    <none>

And, after I change the `subscription` to correct source, it is updated correctly, cool! See below:
mac:~ jianzhang$ oc edit sub -n openshift-operators etcd-7zbvq  
subscription.operators.coreos.com/etcd-7zbvq edited
mac:~ jianzhang$ oc get sub  -n openshift-operators
NAME         PACKAGE   SOURCE                CHANNEL
etcd-7zbvq   etcd      community-operators   clusterwide-alpha
mac:~ jianzhang$ oc describe sub etcd-7zbvq  -n openshift-operators
Name:         etcd-7zbvq
Namespace:    openshift-operators
Labels:       <none>
Annotations:  <none>
API Version:  operators.coreos.com/v1alpha1
Kind:         Subscription
Metadata:
  Creation Timestamp:  2019-07-24T06:06:52Z
  Generate Name:       etcd-
  Generation:          2
  Resource Version:    633978
  Self Link:           /apis/operators.coreos.com/v1alpha1/namespaces/openshift-operators/subscriptions/etcd-7zbvq
  UID:                 3b0f995d-add9-11e9-b040-06252e9f972a
Spec:
  Channel:           clusterwide-alpha
  Name:              etcd
  Source:            community-operators
  Source Namespace:  openshift-marketplace
  Starting CSV:      etcdoperator.v0.9.4-clusterwide
Status:
  Catalog Health:
    Catalog Source Ref:
      API Version:       operators.coreos.com/v1alpha1
      Kind:              CatalogSource
      Name:              certified-operators
      Namespace:         openshift-marketplace
      Resource Version:  14644
      UID:               0810fcaa-ad13-11e9-8206-02247b6f9a52
    Healthy:             true
    Last Updated:        2019-07-24T06:22:03Z
    Catalog Source Ref:
      API Version:       operators.coreos.com/v1alpha1
      Kind:              CatalogSource
      Name:              community-operators
      Namespace:         openshift-marketplace
      Resource Version:  404680
      UID:               0790e2a3-ad13-11e9-8206-02247b6f9a52
    Healthy:             true
    Last Updated:        2019-07-24T06:22:03Z
    Catalog Source Ref:
      API Version:       operators.coreos.com/v1alpha1
      Kind:              CatalogSource
      Name:              redhat-operators
      Namespace:         openshift-marketplace
      Resource Version:  276867
      UID:               07bc34fb-ad13-11e9-8206-02247b6f9a52
    Healthy:             true
    Last Updated:        2019-07-24T06:22:03Z
  Conditions:
    Last Transition Time:  2019-07-24T06:22:03Z
    Message:               all available catalogsources are healthy
    Reason:                AllCatalogSourcesHealthy
    Status:                False
    Type:                  CatalogSourcesUnhealthy
  Current CSV:             etcdoperator.v0.9.4-clusterwide
  Install Plan Ref:
    API Version:       operators.coreos.com/v1alpha1
    Kind:              InstallPlan
    Name:              install-7l275
    Namespace:         openshift-operators
    Resource Version:  633927
    UID:               5a032de6-addb-11e9-b746-0a5d228dcfd6
  Installed CSV:       etcdoperator.v0.9.4-clusterwide
  Installplan:
    API Version:  operators.coreos.com/v1alpha1
    Kind:         InstallPlan
    Name:         install-7l275
    Uuid:         5a032de6-addb-11e9-b746-0a5d228dcfd6
  Last Updated:   2019-07-24T06:22:04Z
  State:          AtLatestKnown
Events:           <none>

mac:~ jianzhang$ oc get ip  -n openshift-operators
NAME            CSV                               SOURCE   APPROVAL    APPROVED
install-7l275   etcdoperator.v0.9.4-clusterwide            Automatic   true
mac:~ jianzhang$ oc get csv  -n openshift-operators
NAME                              DISPLAY   VERSION             REPLACES                          PHASE
etcdoperator.v0.9.4-clusterwide   etcd      0.9.4-clusterwide   etcdoperator.v0.9.2-clusterwide   Succeeded
mac:~ jianzhang$ oc get pods  -n openshift-operators
NAME                             READY   STATUS    RESTARTS   AGE
etcd-operator-7548d6cb99-qt5ks   3/3     Running   0          66s


@Evan
Do we plan to add the `STATUS` column for the `subscription` in the future? If yes, it would be great!
mac:~ jianzhang$ oc get sub  -n openshift-operators
NAME         PACKAGE   SOURCE                CHANNEL
etcd-7zbvq   etcd      community-operators   clusterwide-alpha

Comment 7 Evan Cordell 2019-07-24 13:06:21 UTC
> Do we plan to add the `STATUS` column for the `subscription` in the future? If yes, it would be great!

This is a good idea! We will need to think about how best to display it (since there can be many conditions set, and only a short string for status)

Comment 9 errata-xmlrpc 2019-10-16 06:27:41 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-2019:2922


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