Bug 1757212 - If the Destination Cluster for a migplan doesn't exist, the controller crashes with a nil pointer reference
Summary: If the Destination Cluster for a migplan doesn't exist, the controller crashe...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Migration Tooling
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 4.3.0
Assignee: Scott Seago
QA Contact: Zhang Cheng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-30 20:36 UTC by Scott Seago
Modified: 2020-02-06 20:20 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-06 20:20:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2020:0440 0 None None None 2020-02-06 20:20:55 UTC

Description Scott Seago 2019-09-30 20:36:20 UTC
Description of problem:
PV discovery checks src cluster conditions before processing but not dest cluster conditions. As a result, if the dest cluster doesn't exist, the controller crashes with a nil pointer reference.
mponent (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Create a migplan with a dest cluster reference that doesn't exist.
2. Next migplan reconcile will crash the controller

Actual results:

Controller crashes with the following:

E0930 13:39:06.717983   15420 runtime.go:69] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
/home/sseago/go/src/github.com/fusor/mig-controller/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:76
/home/sseago/go/src/github.com/fusor/mig-controller/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:65
/home/sseago/go/src/github.com/fusor/mig-controller/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:51
/usr/lib/golang/src/runtime/asm_amd64.s:522
/usr/lib/golang/src/runtime/panic.go:513
/usr/lib/golang/src/runtime/panic.go:82
/usr/lib/golang/src/runtime/signal_unix.go:390
/home/sseago/go/src/github.com/fusor/mig-controller/pkg/controller/migplan/pvlist.go:57
/home/sseago/go/src/github.com/fusor/mig-controller/pkg/controller/migplan/migplan_controller.go:214
/home/sseago/go/src/github.com/fusor/mig-controller/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:215
/home/sseago/go/src/github.com/fusor/mig-controller/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:158
/home/sseago/go/src/github.com/fusor/mig-controller/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133
/home/sseago/go/src/github.com/fusor/mig-controller/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:134
/home/sseago/go/src/github.com/fusor/mig-controller/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88
/usr/lib/golang/src/runtime/asm_amd64.s:1333
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=0x148 pc=0x12dbcf9]
goroutine 243 [running]:
github.com/fusor/mig-controller/vendor/k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
    /home/sseago/go/src/github.com/fusor/mig-controller/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:58 +0x108
panic(0x14c8460, 0x2621400)
    /usr/lib/golang/src/runtime/panic.go:513 +0x1b9
github.com/fusor/mig-controller/pkg/controller/migplan.(*ReconcileMigPlan).updatePvs(0xc0005f05c0, 0xc014bdcea0, 0xc0002ab110, 0xc014bdcea0)
    /home/sseago/go/src/github.com/fusor/mig-controller/pkg/controller/migplan/pvlist.go:57 +0x229
github.com/fusor/mig-controller/pkg/controller/migplan.(*ReconcileMigPlan).Reconcile(0xc0005f05c0, 0xc000452a68, 0x3, 0xc00d8d3140, 0x1a, 0x2636f00, 0x0, 0x0, 0x0)

Expected results:
Expected the migplan to have an error condition related to the Dest cluster.

Additional info:

Comment 1 Scott Seago 2019-09-30 20:37:24 UTC
Fix is here: https://github.com/fusor/mig-controller/pull/333

Comment 2 Scott Seago 2019-10-01 19:59:14 UTC
Fix is merged on master.

Comment 5 Xin jiang 2020-01-15 07:49:34 UTC
Verified.  if a migplan with a dest cluster reference that doesn't exist, it will show following message.

status:
  conditions:
  - category: Critical
    lastTransitionTime: "2020-01-15T07:47:23Z"
    message: The `dstMigClusterRef` must reference a `migcluster`.
    reason: NotFound
    status: "True"
    type: InvalidDestinationClusterRef

Comment 7 errata-xmlrpc 2020-02-06 20:20:44 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/RHEA-2020:0440


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