Bug 1951869
| Summary: | MigPlan custom resource does not detect invalid source cluster reference | ||
|---|---|---|---|
| Product: | Migration Toolkit for Containers | Reporter: | whu |
| Component: | General | Assignee: | Jason Montleon <jmontleo> |
| Status: | CLOSED ERRATA | QA Contact: | Xin jiang <xjiang> |
| Severity: | low | Docs Contact: | Avital Pinnick <apinnick> |
| Priority: | medium | ||
| Version: | 1.4.3 | CC: | ernelson, rjohnson, sregidor, whu, xjiang |
| Target Milestone: | --- | ||
| Target Release: | 1.6.0 | ||
| 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-09-29 14:34:47 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
whu
2021-04-21 02:48:40 UTC
I'm concerned about this one because it indicates that there's something bad with verification during reconciliation, but marking as low because the likelyhood of this being set to something bad is basically zero if the UI is being used. If the API is being used, it's usually in a similarly controlled and scripted manner. the change srcMigClusterRef to a non-existent cluster caused controller pod crashed There is a nil ptr dereference coming from: https://github.com/konveyor/mig-controller/blame/master/pkg/controller/migplan/validation.go#L299 This was not merged yet when I wrote/tested my PR. (https://github.com/konveyor/mig-controller/commit/bd4e0a0035ff2ad9ca0483dbdbcb87dea95da568) Testing a fix. Looking in other areas it should be trivial. E0901 07:37:37.779754 1 runtime.go:78] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference) goroutine 580 [running]: k8s.io/apimachinery/pkg/util/runtime.logPanic(0x230f860, 0x3b865b0) /remote-source/app/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:74 +0x95 k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0) /remote-source/app/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:48 +0x86 panic(0x230f860, 0x3b865b0) /opt/rh/go-toolset-1.16/root/usr/lib/go-toolset-1.16-golang/src/runtime/panic.go:965 +0x1b9 github.com/konveyor/mig-controller/pkg/apis/migration/v1alpha1.(*MigCluster).BuildRestConfig(0x0, 0x2a4ab40, 0xc005910280, 0x25e3ce0, 0x8, 0xc005c702a0) /remote-source/app/pkg/apis/migration/v1alpha1/migcluster_types.go:423 +0x3a github.com/konveyor/mig-controller/pkg/apis/migration/v1alpha1.(*MigCluster).GetClient(0x0, 0x2a4ab40, 0xc005910280, 0xc005910280, 0x0, 0x0, 0xc000e2aa50) /remote-source/app/pkg/apis/migration/v1alpha1/migcluster_types.go:209 +0x5a github.com/konveyor/mig-controller/pkg/controller/migplan.ReconcileMigPlan.getPotentialFilePermissionConflictNamespaces(0x2a4a868, 0xc00047bcc0, 0x2a1fb70, 0xc000d54080, 0xc0003282a0, 0x0, 0x0, 0xc000bbb400, 0x3c7c9c0, 0x0, ...) /remote-source/app/pkg/controller/migplan/validation.go:299 +0x165 github.com/konveyor/mig-controller/pkg/controller/migplan.ReconcileMigPlan.validateNamespaces(0x2a4a868, 0xc00047bcc0, 0x2a1fb70, 0xc000d54080, 0xc0003282a0, 0x0, 0x0, 0x2a2a020, 0xc0012d6b40, 0xc000bbb400, ...) /remote-source/app/pkg/controller/migplan/validation.go:451 +0x389 github.com/konveyor/mig-controller/pkg/controller/migplan.ReconcileMigPlan.validate(0x2a4a868, 0xc00047bcc0, 0x2a1fb70, 0xc000d54080, 0xc0003282a0, 0x0, 0x0, 0x2a2a020, 0xc0012d6b40, 0xc000bbb400, ...) /remote-source/app/pkg/controller/migplan/validation.go:158 +0x39c github.com/konveyor/mig-controller/pkg/controller/migplan.(*ReconcileMigPlan).Reconcile(0xc000d540c0, 0x2a2a020, 0xc0012d6b40, 0xc000eba378, 0x13, 0xc0006b97a0, 0x4, 0xc0012d6b00, 0x0, 0x0, ...) /remote-source/app/pkg/controller/migplan/migplan_controller.go:261 +0x553 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0002fa500, 0x2a29f78, 0xc000784800, 0x23a4e20, 0xc000b2c240) /remote-source/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:263 +0x30d sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0002fa500, 0x2a29f78, 0xc000784800, 0x0) /remote-source/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:235 +0x205 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.1(0x2a29f78, 0xc000784800) /remote-source/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:198 +0x4a k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1() /remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:185 +0x37 k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0xc000136f50) /remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:155 +0x5f k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc0025edf50, 0x29dbba0, 0xc0016099e0, 0xc000784801, 0xc00097a060) /remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:156 +0x9b k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc000136f50, 0x3b9aca00, 0x0, 0xc000ba2d01, 0xc00097a060) /remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133 +0x98 k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext(0x2a29f78, 0xc000784800, 0xc000e2bdb0, 0x3b9aca00, 0x0, 0x273f601) /remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:185 +0xa6 k8s.io/apimachinery/pkg/util/wait.UntilWithContext(0x2a29f78, 0xc000784800, 0xc000e2bdb0, 0x3b9aca00) /remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:99 +0x57 created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1 /remote-source/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:195 +0x497 panic: runtime error: invalid memory address or nil pointer dereference [recovered] panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x118 pc=0x196c9da] https://github.com/konveyor/mig-controller/pull/1186 for release-1.6.0 verified with MTC 1.6.0 registry.redhat.io/rhmtc/openshift-migration-controller-rhel8@sha256:6a5624104074029dc4e83cacadd1fc48b1561c7e2f237bb032bb73c9a274b9b5 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 (Moderate: Migration Toolkit for Containers (MTC) 1.6.0 security & bugfix update), 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/RHSA-2021:3694 |