Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nil pointer panic #814

Merged
merged 5 commits into from
May 23, 2023
Merged

Fix nil pointer panic #814

merged 5 commits into from
May 23, 2023

Conversation

acumino
Copy link
Member

@acumino acumino commented May 16, 2023

What this PR does / why we need it:
This PR fixes a nil pointer panic and does some housekeeping job.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:

An issue causing nil pointer panic on scaleup of the machinedeployment along with trigger of rolling update, is fixed

@acumino acumino requested a review from a team as a code owner May 16, 2023 06:47
@gardener-robot gardener-robot added needs/review Needs review size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py) labels May 16, 2023
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label May 16, 2023
@acumino
Copy link
Member Author

acumino commented May 16, 2023

/invite @himanshu-kun @rishabh-11

@gardener-robot-ci-3 gardener-robot-ci-3 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels May 16, 2023
Copy link
Contributor

@rishabh-11 rishabh-11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the scenario in which the error can happen?

@acumino
Copy link
Member Author

acumino commented May 16, 2023

Can you explain the scenario in which the error can happen?

When newIS is nil? I got this error locally.

@acumino
Copy link
Member Author

acumino commented May 16, 2023

In my case, I changed the machine type in my working cluster to something which was not available in the subscription list, and nil pointer panic occurred.

@himanshu-kun himanshu-kun self-assigned this May 23, 2023
@himanshu-kun
Copy link
Contributor

stack trace

{"log":"goroutine 681 [running]:"}
2023-05-16 06:37:25	
{"log":"k8s.io/apimachinery/pkg/util/runtime.logPanic({0x19952e0?, 0x2cb9ff0})"}
2023-05-16 06:37:25	
{"log":"\t/go/src/github.com/gardener/machine-controller-manager/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:74 +0x99"}
2023-05-16 06:37:25	
{"log":"k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0xc001086f50?})"}
2023-05-16 06:37:25	
{"log":"\t/go/src/github.com/gardener/machine-controller-manager/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:48 +0x75"}
2023-05-16 06:37:25	
{"log":"panic({0x19952e0, 0x2cb9ff0})"}
2023-05-16 06:37:25	
{"log":"\t/usr/local/go/src/runtime/panic.go:884 +0x212"}
2023-05-16 06:37:25	
{"log":"github.com/gardener/machine-controller-manager/pkg/controller.(*controller).scaleNewMachineSet(...)"}
2023-05-16 06:37:25	
{"log":"\t/go/src/github.com/gardener/machine-controller-manager/pkg/controller/deployment_sync.go:495"}
2023-05-16 06:37:25	
{"log":"github.com/gardener/machine-controller-manager/pkg/controller.(*controller).scale(0x0?, {0x1f20ea8, 0xc000064020}, 0xc0000f6d80, 0x0, {0xc000a4a680?, 0x3, 0x4})"}
2023-05-16 06:37:25	
{"log":"\t/go/src/github.com/gardener/machine-controller-manager/pkg/controller/deployment_sync.go:457 +0xe6e"}
2023-05-16 06:37:25	
{"log":"github.com/gardener/machine-controller-manager/pkg/controller.(*controller).sync(0xc000a2bf00?, {0x1f20ea8, 0xc000064020}, 0xc0000f6d80, {0xc000a4a580?, 0x0?, 0x0?}, 0x0?)"}
2023-05-16 06:37:25	
{"log":"\t/go/src/github.com/gardener/machine-controller-manager/pkg/controller/deployment_sync.go:61 +0x90"}
2023-05-16 06:37:25	
{"log":"github.com/gardener/machine-controller-manager/pkg/controller.(*controller).reconcileClusterMachineDeployment(0xc000706e00, {0xc00014be00, 0x3f})"}
2023-05-16 06:37:25	
{"log":"\t/go/src/github.com/gardener/machine-controller-manager/pkg/controller/deployment.go:549 +0x11aa"}
2023-05-16 06:37:25	
{"log":"github.com/gardener/machine-controller-manager/pkg/controller.worker.func1.1({0x1f2a538, 0xc0000b7ce0}, 0xc0008982c0, 0x1, 0xf, {0x1c47829, 0x18})"}
2023-05-16 06:37:25	
{"log":"\t/go/src/github.com/gardener/machine-controller-manager/pkg/controller/controller.go:568 +0x130"}
2023-05-16 06:37:25	
{"log":"github.com/gardener/machine-controller-manager/pkg/controller.worker.func1()"}
2023-05-16 06:37:25	
{"log":"\t/go/src/github.com/gardener/machine-controller-manager/pkg/controller/controller.go:585 +0x65"}
2023-05-16 06:37:25	
{"log":"k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0x1000040d8bf?)"}
2023-05-16 06:37:25	
{"log":"\t/go/src/github.com/gardener/machine-controller-manager/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:155 +0x3e"}
2023-05-16 06:37:25	
{"log":"k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0x40?, {0x1f08a40, 0xc000896ed0}, 0x1, 0x0)"}
2023-05-16 06:37:25	
{"log":"\t/go/src/github.com/gardener/machine-controller-manager/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:156 +0xb6"}
2023-05-16 06:37:25	
{"log":"k8s.io/apimachinery/pkg/util/wait.JitterUntil(0x1f2a538?, 0x3b9aca00, 0x0, 0x18?, 0xf?)"}
2023-05-16 06:37:25	
{"log":"\t/go/src/github.com/gardener/machine-controller-manager/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133 +0x89"}
2023-05-16 06:37:25	
{"log":"k8s.io/apimachinery/pkg/util/wait.Until(...)"}
2023-05-16 06:37:25	
{"log":"\t/go/src/github.com/gardener/machine-controller-manager/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:90"}
2023-05-16 06:37:25	
{"log":"github.com/gardener/machine-controller-manager/pkg/controller.createWorker.func1()"}
2023-05-16 06:37:25	
{"log":"\t/go/src/github.com/gardener/machine-controller-manager/pkg/controller/controller.go:547 +0x5f"}
2023-05-16 06:37:25	
{"log":"created by github.com/gardener/machine-controller-manager/pkg/controller.createWorker"}
2023-05-16 06:37:25	
{"log":"\t/go/src/github.com/gardener/machine-controller-manager/pkg/controller/controller.go:546 +0x12e"}

cc @elankath

@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels May 23, 2023
@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels May 23, 2023
Copy link
Contributor

@himanshu-kun himanshu-kun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/review Needs review labels May 23, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label May 23, 2023
@himanshu-kun himanshu-kun merged commit 3ab09d1 into gardener:master May 23, 2023
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label May 23, 2023
@acumino acumino deleted the fix-nil branch May 23, 2023 13:27
himanshu-kun added a commit that referenced this pull request May 23, 2023
* Add missing parameter in log

* Drop unused function parameter

* Prevent nil pointer panic

* added log for missing mcs

* updated errorneous comments

---------

Co-authored-by: Sonu Kumar Singh <sksgkpvks@gmail.com>
@himanshu-kun
Copy link
Contributor

/needs cherry-pick

rel-v0.49

@gardener-robot gardener-robot added the needs/cherry-pick Needs to be cherry-picked to older version label May 23, 2023
@himanshu-kun himanshu-kun removed the needs/cherry-pick Needs to be cherry-picked to older version label May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) reviewed/lgtm Has approval for merging reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants