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

Sealed Secret controller panic: index out of range #1386

Closed
gestgithub opened this issue Nov 20, 2023 · 2 comments
Closed

Sealed Secret controller panic: index out of range #1386

gestgithub opened this issue Nov 20, 2023 · 2 comments
Labels
triage Issues/PRs that need to be reviewed

Comments

@gestgithub
Copy link

Which component:
The name (and version) of the affected component (controller or kubeseal)
sealed secrets controller (v0.23.1) pod crashloops in kubernetes cluster with following log message:

Log:

Defaulted container "sealed-secrets-controller" out of: sealed-secrets-controller, sealed-secrets-backup (init)
controller version: 0.23.1
2023/11/20 07:29:02 Starting sealed-secrets controller version: 0.23.1
Searching for existing private keys
----- sealed-secrets-key12345
----- sealed-secrets-key65478
----- sealed-secrets-key78945
----- sealed-secrets-key56489
----- sealed-secrets-key46584
----- sealed-secrets-key32187
----- sealed-secrets-key94684
----- sealed-secrets-key54684
HTTP server serving on :8080

Updating <redacted> type: 'Normal' reason: 'Unsealed' SealedSecret unsealed successfully
...
Updating <redacted> type: 'Normal' reason: 'Unsealed' SealedSecret unsealed successfully

panic: runtime error: index out of range [1] with length 1

goroutine 12 [running]:
github.com/bitnami-labs/sealed-secrets/pkg/controller.writeKey({0x1ca32b0, 0xc0001a6000}, {0x1cb7b90, 0xc0004b6ea0}, 0x0?, {0xc0005e7ec8, 0x1, 0xc0004bed8e?}, {0xc00004acf0, 0xe}, ...)
	/home/runner/work/sealed-secrets/sealed-secrets/pkg/controller/keys.go:86 +0xcc5
github.com/bitnami-labs/sealed-secrets/pkg/controller.(*KeyRegistry).generateKey(0xc00011a360, {0x1ca32b0, 0xc0001a6000}, 0x0?, {0x0?, 0xc0004befa0?}, {0x7ffcc5e22aef, 0x3f}, {0x0, 0x0})
	/home/runner/work/sealed-secrets/sealed-secrets/pkg/controller/keyregistry.go:56 +0x14f
github.com/bitnami-labs/sealed-secrets/pkg/controller.initKeyRenewal.func1()
	/home/runner/work/sealed-secrets/sealed-secrets/pkg/controller/main.go:125 +0x4e
github.com/bitnami-labs/sealed-secrets/pkg/controller.ScheduleJobWithTrigger.func1()
	/home/runner/work/sealed-secrets/sealed-secrets/pkg/controller/funcs.go:17 +0x37
created by github.com/bitnami-labs/sealed-secrets/pkg/controller.ScheduleJobWithTrigger
	/home/runner/work/sealed-secrets/sealed-secrets/pkg/controller/funcs.go:14 +0x8e

Version of Kubernetes: v1.26.8

Any idea what this might be caused by?

@gestgithub gestgithub added the triage Issues/PRs that need to be reviewed label Nov 20, 2023
@tewfik-ghariani
Copy link
Contributor

Hi, I am not sure what could be the issue ( I am not one of the maintainers ^^ ) but at first I would suggest to upgrade to the latest version which is v0.24.4 and then try again

@gestgithub
Copy link
Author

Nevermind another cluster has not synchronized a key which we needed, after manually moving it, a simple restart worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issues/PRs that need to be reviewed
Projects
None yet
Development

No branches or pull requests

2 participants