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

Crash in RemoveFailedPods strategy #630

Closed
perosb opened this issue Sep 18, 2021 · 4 comments · Fixed by #632
Closed

Crash in RemoveFailedPods strategy #630

perosb opened this issue Sep 18, 2021 · 4 comments · Fixed by #632
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.

Comments

@perosb
Copy link

perosb commented Sep 18, 2021

What version of descheduler are you using?

descheduler version: 0.22

Please provide a copy of your descheduler policy config file

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: descheduler-policy-configmap
  namespace: kube-system
data:
  policy.yaml: |
    apiVersion: "descheduler/v1alpha1"
    kind: "DeschedulerPolicy"
    strategies:
      "RemoveFailedPods":
        enabled: true

Disabling RemovedFailedPods I can run all other policies.

What k8s version are you using (kubectl version)?
1.22.1

kubectl version Output
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.1", GitCommit:"632ed300f2c34f6d6d15ca4cef3d3c7073412212", GitTreeState:"archive", BuildDate:"2021-08-19T21:28:12Z", GoVersion:"go1.17", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.1", GitCommit:"632ed300f2c34f6d6d15ca4cef3d3c7073412212", GitTreeState:"clean", BuildDate:"2021-08-19T15:39:34Z", GoVersion:"go1.16.7", Compiler:"gc", Platform:"linux/amd64"}

What did you do?

I0918 06:44:25.850399       1 named_certificates.go:53] "Loaded SNI cert" index=0 certName="self-signed loopback" certDetail="\"apiserver-loopback-client@1631947465\" [serving] validServingFor=[apiserver-loopback-client] issuer=\"apiserver-loopback-client-ca@1631947464\" (2021-09-18 05:44:23 +0000 UTC to 2022-09-18 05:44:23 +0000 UTC (now=2021-09-18 06:44:25.85028599 +0000 UTC))"
I0918 06:44:25.850606       1 secure_serving.go:195] Serving securely on [::]:10258
I0918 06:44:25.851136       1 tlsconfig.go:240] "Starting DynamicServingCertificateController"
I0918 06:44:25.895398       1 node.go:46] "Node lister returned empty list, now fetch directly"
E0918 06:44:25.919640       1 runtime.go:78] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
goroutine 1 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic(0x14cdf80, 0x26e1770)
	/go/src/sigs.k8s.io/descheduler/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:74 +0x84
k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
	/go/src/sigs.k8s.io/descheduler/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:48 +0x80
panic(0x14cdf80, 0x26e1770)
	/usr/local/go/src/runtime/panic.go:965 +0x154
sigs.k8s.io/descheduler/pkg/descheduler/strategies.RemoveFailedPods(0x1a00468, 0x400019c020, 0x1a26ab8, 0x400002ac60, 0x4000255801, 0x0, 0x0, 0x4000602720, 0x6, 0x6, ...)
	/go/src/sigs.k8s.io/descheduler/pkg/descheduler/strategies/failedpods.go:44 +0x70
sigs.k8s.io/descheduler/pkg/descheduler.RunDeschedulerStrategies.func1()
	/go/src/sigs.k8s.io/descheduler/pkg/descheduler/descheduler.go:145 +0x26c
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0x4000707ad0)
	/go/src/sigs.k8s.io/descheduler/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:155 +0x64
k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0x4000707ad0, 0x19c1ff0, 0x4000454210, 0x1, 0x4000028420)
	/go/src/sigs.k8s.io/descheduler/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:156 +0x74
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0x4000707ad0, 0x0, 0x0, 0x1, 0x4000028420)
	/go/src/sigs.k8s.io/descheduler/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133 +0x88
k8s.io/apimachinery/pkg/util/wait.Until(...)
	/go/src/sigs.k8s.io/descheduler/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:90
sigs.k8s.io/descheduler/pkg/descheduler.RunDeschedulerStrategies(0x1a00468, 0x400019c020, 0x400046c2c0, 0x40001a6140, 0x40003be487, 0x9, 0x4000028420, 0x4000092c00, 0x40000ee460)
	/go/src/sigs.k8s.io/descheduler/pkg/descheduler/descheduler.go:117 +0x534
sigs.k8s.io/descheduler/pkg/descheduler.Run(0x400046c2c0, 0x19c2050, 0x400021c0e0)
	/go/src/sigs.k8s.io/descheduler/pkg/descheduler/descheduler.go:64 +0x154
sigs.k8s.io/descheduler/cmd/descheduler/app.Run(...)
	/go/src/sigs.k8s.io/descheduler/cmd/descheduler/app/server.go:93
sigs.k8s.io/descheduler/cmd/descheduler/app.NewDeschedulerCommand.func1(0x40003ba280, 0x400012b7c0, 0x0, 0x4)
	/go/src/sigs.k8s.io/descheduler/cmd/descheduler/app/server.go:78 +0xb8
github.com/spf13/cobra.(*Command).execute(0x40003ba280, 0x40001a6010, 0x4, 0x4, 0x40003ba280, 0x40001a6010)
	/go/src/sigs.k8s.io/descheduler/vendor/github.com/spf13/cobra/command.go:856 +0x1d0
github.com/spf13/cobra.(*Command).ExecuteC(0x40003ba280, 0x400063ff48, 0x1, 0x1)
	/go/src/sigs.k8s.io/descheduler/vendor/github.com/spf13/cobra/command.go:960 +0x268
github.com/spf13/cobra.(*Command).Execute(...)
	/go/src/sigs.k8s.io/descheduler/vendor/github.com/spf13/cobra/command.go:897
main.main()
	/go/src/sigs.k8s.io/descheduler/cmd/descheduler/descheduler.go:34 +0xa0
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=0x0 pc=0x12b7020]

goroutine 1 [running]:
k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
	/go/src/sigs.k8s.io/descheduler/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:55 +0x108
panic(0x14cdf80, 0x26e1770)
	/usr/local/go/src/runtime/panic.go:965 +0x154
sigs.k8s.io/descheduler/pkg/descheduler/strategies.RemoveFailedPods(0x1a00468, 0x400019c020, 0x1a26ab8, 0x400002ac60, 0x4000255801, 0x0, 0x0, 0x4000602720, 0x6, 0x6, ...)
	/go/src/sigs.k8s.io/descheduler/pkg/descheduler/strategies/failedpods.go:44 +0x70
sigs.k8s.io/descheduler/pkg/descheduler.RunDeschedulerStrategies.func1()
	/go/src/sigs.k8s.io/descheduler/pkg/descheduler/descheduler.go:145 +0x26c
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0x4000707ad0)
	/go/src/sigs.k8s.io/descheduler/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:155 +0x64
k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0x4000707ad0, 0x19c1ff0, 0x4000454210, 0x1, 0x4000028420)
	/go/src/sigs.k8s.io/descheduler/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:156 +0x74
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0x4000707ad0, 0x0, 0x0, 0x1, 0x4000028420)
	/go/src/sigs.k8s.io/descheduler/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133 +0x88
k8s.io/apimachinery/pkg/util/wait.Until(...)
	/go/src/sigs.k8s.io/descheduler/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:90
sigs.k8s.io/descheduler/pkg/descheduler.RunDeschedulerStrategies(0x1a00468, 0x400019c020, 0x400046c2c0, 0x40001a6140, 0x40003be487, 0x9, 0x4000028420, 0x4000092c00, 0x40000ee460)
	/go/src/sigs.k8s.io/descheduler/pkg/descheduler/descheduler.go:117 +0x534
sigs.k8s.io/descheduler/pkg/descheduler.Run(0x400046c2c0, 0x19c2050, 0x400021c0e0)
	/go/src/sigs.k8s.io/descheduler/pkg/descheduler/descheduler.go:64 +0x154
sigs.k8s.io/descheduler/cmd/descheduler/app.Run(...)
	/go/src/sigs.k8s.io/descheduler/cmd/descheduler/app/server.go:93
sigs.k8s.io/descheduler/cmd/descheduler/app.NewDeschedulerCommand.func1(0x40003ba280, 0x400012b7c0, 0x0, 0x4)
	/go/src/sigs.k8s.io/descheduler/cmd/descheduler/app/server.go:78 +0xb8
github.com/spf13/cobra.(*Command).execute(0x40003ba280, 0x40001a6010, 0x4, 0x4, 0x40003ba280, 0x40001a6010)
	/go/src/sigs.k8s.io/descheduler/vendor/github.com/spf13/cobra/command.go:856 +0x1d0
github.com/spf13/cobra.(*Command).ExecuteC(0x40003ba280, 0x400063ff48, 0x1, 0x1)
	/go/src/sigs.k8s.io/descheduler/vendor/github.com/spf13/cobra/command.go:960 +0x268
github.com/spf13/cobra.(*Command).Execute(...)
	/go/src/sigs.k8s.io/descheduler/vendor/github.com/spf13/cobra/command.go:897
main.main()
	/go/src/sigs.k8s.io/descheduler/cmd/descheduler/descheduler.go:34 +0xa0

@perosb perosb added the kind/bug Categorizes issue or PR as related to a bug. label Sep 18, 2021
@a7i
Copy link
Contributor

a7i commented Sep 20, 2021

/assign

@damemi
Copy link
Contributor

damemi commented Sep 20, 2021

@a7i looks like we aren't checking for ThresholdPriority to be properly set in

evictions.WithPriorityThreshold(strategyParams.ThresholdPriority),

@seanmalloy @ingvagabund we should consider a patch release once we fix this

@perosb
Copy link
Author

perosb commented Sep 20, 2021

Confirmed that setting thresholdPriority: 90000 it runs properly.

@damemi
Copy link
Contributor

damemi commented Sep 20, 2021

/priority critical-urgent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.
Projects
None yet
4 participants