Bug 1937295 - Upgrade from 1.3.2 to 1.4.2 fails because existing CRs are incompatible with new CRD schema
Summary: Upgrade from 1.3.2 to 1.4.2 fails because existing CRs are incompatible with ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Migration Toolkit for Containers
Classification: Red Hat
Component: Operator
Version: 1.4.2
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: 1.4.2
Assignee: Pranav Gaikwad
QA Contact: Xin jiang
Avital Pinnick
URL:
Whiteboard:
: 1937290 1937291 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-03-10 10:12 UTC by Xin jiang
Modified: 2021-03-15 08:15 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-03-15 08:15:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
upgrade (55.56 KB, image/png)
2021-03-10 10:12 UTC, Xin jiang
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:0814 0 None None None 2021-03-15 08:15:46 UTC

Description Xin jiang 2021-03-10 10:12:53 UTC
Created attachment 1762247 [details]
upgrade

Description of problem:
I installed MTC 1.3.2 on OCP4.8 by selecting channel "release-v1.3". When MTC 1.3.2 is ready on cluster, and then selecting channel "release-v1.4", waiting for it to upgrade to 1.4.2.But it was stuck there. The new operator is showing "Pending". The old version is showing "Canot update, Catalog Source was removed". see the screen.

Version-Release number of selected component (if applicable):
MTC 1.4.2 stage

How reproducible:
Always

Steps to Reproduce:
1. installed MTC 1.3.2 on OCP4.8 by selecting channel "release-v1.3".
2. Create MigController instance
3. Selecting channel "release-v1.4" wand waiting for upgrade to 1.4.2

Actual results:
The upgrade is stuck.  The new operator is showing "Pending". The old version is showing "Canot update, Catalog Source was removed". see the screen.


Expected results:
The upgrade should be complete automatically


Additional info:

Comment 1 Jian Zhang 2021-03-10 10:16:15 UTC
I guess the root cause is here, the new CRD schema doesn’t compatible with the existing old CR, hence leads the "constraints not satisfiable" when upgrading.
E0310 03:57:57.503921       1 queueinformer_operator.go:290] sync {"update" "openshift-migration/install-8x4cf"} failed: error transitionin    g InstallPlan: error validating existing CRs against new CRD's schema: migplans.migration.openshift.io: error validating custom resource ag    ainst new schema &apiextensions.CustomResourceValidation{OpenAPIV3Schema:(*apiextensions.JSONSchemaProps)(0xc001ba5400)}: [].spec.persisten    tVolumes.capacityConfirmed: Required value and error updating InstallPlan status: error updating InstallPlan status: Operation cannot be fu    lfilled on installplans.operators.coreos.com "install-8x4cf": the object has been modified; please apply your changes to the latest version     and try again

The "constraints not satisfiable" indicate two operators may provide the same GVK or Package in a namespace.

Comment 2 Xin jiang 2021-03-10 10:16:53 UTC
I found some message from the csv of new version
status:
  conditions:
  - lastTransitionTime: "2021-03-10T03:57:56Z"
    lastUpdateTime: "2021-03-10T03:57:56Z"
    message: requirements not yet checked
    phase: Pending
    reason: RequirementsUnknown
  - lastTransitionTime: "2021-03-10T03:57:56Z"
    lastUpdateTime: "2021-03-10T03:57:56Z"
    message: one or more requirements couldn't be found
    phase: Pending
    reason: RequirementsNotMet
  lastTransitionTime: "2021-03-10T03:57:56Z"
  requirementStatus:
.....
  - group: apiextensions.k8s.io
    kind: CustomResourceDefinition
    message: CRD is not present
    name: directimagestreammigrations.migration.openshift.io
    status: NotPresent
    version: v1
  - group: apiextensions.k8s.io
    kind: CustomResourceDefinition
    message: CRD is not present
    name: directvolumemigrationprogresses.migration.openshift.io
    status: NotPresent
    version: v1

Comment 3 Sergio 2021-03-10 11:04:24 UTC
It seems a problem in the CRDs, we can find this in the installplan

Status:
  Catalog Sources:
    quay-applications
  Conditions:
    Last Transition Time:  2021-03-10T10:06:27Z
    Last Update Time:      2021-03-10T10:06:27Z
    Message:               error validating existing CRs agains new CRD's schema: migplans.migration.openshift.io: error validating custom resource against new schema &apiextensions.CustomResourceValidation{OpenAPIV3Schema:(*apiextensions.JSONSchemaProps)(0xc00474a000)}: [].spec.persistentVolumes.capacityConfirmed: Required value

Comment 4 Sergio 2021-03-10 12:05:11 UTC
In order to reproduce the issue we need to create a migplan with PVC before the upgrade.

Comment 5 Xin jiang 2021-03-10 13:42:23 UTC
*** Bug 1937291 has been marked as a duplicate of this bug. ***

Comment 6 Xin jiang 2021-03-10 13:42:33 UTC
*** Bug 1937290 has been marked as a duplicate of this bug. ***

Comment 7 Pranav Gaikwad 2021-03-10 15:15:41 UTC
Cherry-picked into release 1.4.2 branches here: 

https://github.com/konveyor/mig-controller/pull/995

https://github.com/konveyor/mig-operator/pull/609

Comment 14 errata-xmlrpc 2021-03-15 08:15:38 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 (Migration Toolkit for Containers (MTC) image release advisory 1.4.2), 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-2021:0814


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