Bug 2047244

Summary: installing MTC 1.7.0 via legacy operator reported error that 'controller_state' is undefined in operator pod
Product: Migration Toolkit for Containers Reporter: Xin jiang <xjiang>
Component: OperatorAssignee: Jason Montleon <jmontleo>
Status: CLOSED ERRATA QA Contact: Xin jiang <xjiang>
Severity: medium Docs Contact: Steve Goodman <sgoodman>
Priority: medium    
Version: 1.7.0CC: ernelson, prajoshi, rjohnson
Target Milestone: ---   
Target Release: 1.7.0   
Hardware: Unspecified   
OS: Unspecified   
URL: https://github.com/konveyor/mig-legacy-operator/pull/8
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-24 06:32:27 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 Xin jiang 2022-01-27 12:59:02 UTC
Description of problem:
Installed MTC 1.7.0 with legacy operator on ocp 4.5 and found error in operator pod "'controller_state' is undefined"


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

How reproducible:
alwasys


Steps to Reproduce:
1. Download operator.yml from legacy operator image  registry-proxy.engineering.redhat.com/rh-osbs/rhmtc-openshift-migration-legacy-operator:v1.7.0
2. Update images to point to brew.registry.redhat.io in operator.yml and then install mtc operator by executing 'oc create -f operator.yml'
3. download controller.yml from legacy operator image and create migcontroller by executing command 'oc create -f controller.yml'

Actual results:
Operator pod logs reported error

--------------------------- Ansible Task StdOut -------------------------------

 TASK [Set up mig controller monitoring config] ********************************
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'controller_state' is undefined

The error appears to be in '/opt/ansible/roles/migrationcontroller/tasks/main.yml': line 164, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


  - name: \"Set up mig controller monitoring config\"
    ^ here
"}


I did check /opt/ansible/roles/migrationcontroller/defaults/main.yml by oc rsh into operator pod and it missed  controller_state variable

Expected results:
It shouldn't has any error logs in operator pod

Additional info:

Comment 1 Xin jiang 2022-01-27 13:01:18 UTC
I also found it didn't create following secrets
cloud-credentials
cloud-credentials-azure
cloud-credentials-gcp

Comment 2 Xin jiang 2022-01-27 13:07:03 UTC
operator image is brew.registry.redhat.io/rh-osbs/rhmtc-openshift-migration-legacy-operator:v1.7.0-23

Comment 3 Xin jiang 2022-01-27 13:20:39 UTC
I found another issue, not sure if it's the same issue

migration-log-reader pod was not created. 
$ oc get pod
migration-operator-79b95db8d8-krzmv   1/1     Running            0          8h
restic-5ws6f                          1/1     Running            0          8h
restic-c55xm                          1/1     Running            0          8h
restic-q7hn4                          1/1     Running            0          8h
restic-sr9wz                          1/1     Running            0          8h
restic-xqw2w                          1/1     Running            0          8h
velero-7c7bb477f7-jk2ht               1/1     Running            0          8h


$ oc get migrationcontroller migration-controller -o json | jq .spec
{
  "azure_resource_group": "",
  "cluster_name": "host",
  "migration_controller": false,
  "migration_log_reader": true,
  "migration_ui": false,
  "migration_velero": true,
  "restic_timeout": "1h",
  "version": "1.7.0"
}

Comment 4 Jason Montleon 2022-01-28 15:03:17 UTC
This should be fixed by https://github.com/konveyor/mig-legacy-operator/pull/8

Comment 8 Prasad Joshi 2022-02-02 07:18:53 UTC
Verified with MTC 1.7.0 (Legacy-operator)

$ oc get pods -n openshift-migration migration-operator-7986c67bcb-hzqsd -o yaml
image: brew.registry.redhat.io/rh-osbs/rhmtc-openshift-migration-legacy-operator:v1.7.0-26

I don't see any 'controller_state' undefined error in operator pod logs. 

$ oc logs migration-operator-7986c67bcb-hzqsd
PLAY RECAP *********************************************************************
localhost                  : ok=21   changed=1    unreachable=0    failed=0    skipped=9    rescued=0    ignored=0 


Log reader pod is also running fine.

$ oc get pods
NAME                                    READY   STATUS    RESTARTS   AGE
migration-log-reader-6f666d5fcf-9xtp5   2/2     Running   0          53m
migration-operator-7986c67bcb-hzqsd     1/1     Running   0          54m
restic-6mvkx                            1/1     Running   0          53m
restic-ft9md                            1/1     Running   0          53m
restic-rcs9v                            1/1     Running   0          53m
restic-wbpg5                            1/1     Running   0          53m
restic-xnql5                            1/1     Running   0          53m
velero-f89cb5567-4tkfp                  1/1     Running   0          53m


Moving this to Verified status.

Comment 10 errata-xmlrpc 2022-03-24 06:32:27 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.7.0 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-2022:1043