Bug 2008596

Summary: Web console crashes when MigStorage CR, with Secret CR outside the 'openshift-config' namespace, is deleted
Product: Migration Toolkit for Containers Reporter: Sergio <sregidor>
Component: UIAssignee: Ian <ibolton>
Status: CLOSED ERRATA QA Contact: Xin jiang <xjiang>
Severity: low Docs Contact: Avital Pinnick <apinnick>
Priority: low    
Version: 1.6.0CC: ernelson, ibolton, rjohnson, ssingla
Target Milestone: ---   
Target Release: 1.6.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-28 09:48:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sergio 2021-09-28 16:05:58 UTC
Description of problem:
When we create a migration storage using a secret that is not placed inside openshift-config namespace and we delete it, the UI crashes.


Version-Release number of selected component (if applicable):
MTC 1.6.0
SOURCE CLUSTER: AWS 4.8 MTC 1.6.0
TARGET CLUSTER: AWS 4.9 MTC 1.6.0

How reproducible:
Always

Steps to Reproduce:
1. Remove all migration storage resources

2. Create this minio migration storage

SECRET

$ cat <<EOF | oc create -f -
apiVersion: v1
data:
  aws-access-key-id: ZmFrZXNlY3JldA==
  aws-secret-access-key: ZmFrZXNlY3JldA==
kind: Secret
metadata:
  name: aws.automation.test-creds
  namespace: openshift-migration
type: Opaque
EOF


MIGSTORAGE

$ cat <<EOF | oc create -f -
apiVersion: migration.openshift.io/v1alpha1
kind: MigStorage
metadata:
  name: aws.automation.test
  namespace: openshift-migration
spec:
  backupStorageConfig:
    awsBucketName: miniobucket
    awsS3Url: http://minio-minio.apps.cam-xxx-xxx.yy.xxx.xxx.com
    credsSecretRef:
      name: aws.automation.test-creds
      namespace: openshift-migration
    insecure: true
  backupStorageProvider: aws
  volumeSnapshotConfig:
    credsSecretRef:
      name: aws.automation.test-creds
      namespace: openshift-migration
  volumeSnapshotProvider: aws
EOF



3. Go to the UI and delete the migration storage created in step 2


Actual results:
The UI crashes and in the browser's console we can read this error

app.bundle.js:2 Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Bmessage%2C%20name%2C%20stack%2C%20config%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

app.bundle.js:2 Uncaught (in promise) Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Bmessage%2C%20name%2C%20stack%2C%20config%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.


Expected results:
The UI should not crash

Additional info:
In order to make the UI work again we can go to (in a chrome browser)

right click -> inspect -> Application -> Storage -> Local Storage  -> 

And remove the keys "persist:root" and "currentUser"

After removing those keys refresh the UI and it will start working again without problems.

Comment 8 ssingla 2021-10-18 06:51:56 UTC
Verified with 1.6.1 on aws 4.8 -> 4.9 
The UI did not crash on deleting the migstorage.

Moving from ON_QA to VERIFIED.

Comment 12 errata-xmlrpc 2021-10-28 09:48:01 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) 1.6.1 release 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-2021:4023