Bug 1739562 - Panic during migration when cluster is in bad state
Summary: Panic during migration when cluster is in bad state
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 4.2.0
Assignee: Kevin Rizza
QA Contact: Fan Jia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-09 14:14 UTC by Kevin Rizza
Modified: 2019-10-16 06:35 UTC (History)
1 user (show)

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


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github operator-framework operator-marketplace pull 240 0 None None None 2019-08-09 18:47:24 UTC
Red Hat Product Errata RHBA-2019:2922 0 None None None 2019-10-16 06:35:45 UTC

Description Kevin Rizza 2019-08-09 14:14:01 UTC
Description of problem:

In marketplace 4.2, migration code was written to ensure that clusters upgrading from 4.1 to 4.2 would remove their datastore catalog source configs and update any existing subscriptions to point to catalog sources created directly by operator sources.

There is an issue with that migration code (which always runs on startup and checks to see if anything needs to be migrated) where if a subscription that does not have the spec.package field set and points to a catalog source that does not exist, the migration code will throw an unhandled error and the marketplace will panic.

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

How reproducible:
Always

Steps to Reproduce:
1. Create a subscription that does not point to a package:

#oc create testsubscription.yaml
```
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  labels:
    csc-owner-name: installed-test-openshift-marketplace
    csc-owner-namespace: openshift-marketplace
  name: test-operators-ui-created
  namespace: openshift-marketplace
spec:
  channel: alpha
  name: ""
  source: installed-test-openshift-marketplace
  sourceNamespace: openshift-marketplace
```

2. Restart the marketplace operator pod

Actual results:
Marketplace will fail to run the migration code and the pod will crash loop.

Expected results:
Marketplace will be unable to migrate this particular subscription since it is invalid, but it should just ignore it and move on.

Comment 3 errata-xmlrpc 2019-10-16 06:35:36 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.