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

log-format-json throws panic in v0.5.0 #312

Open
montaguethomas opened this issue Oct 24, 2023 · 1 comment
Open

log-format-json throws panic in v0.5.0 #312

montaguethomas opened this issue Oct 24, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@montaguethomas
Copy link

Describe the bug
When trying to use the -log-format-json=true flag, kms panics:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xafb309]

goroutine 1 [running]:
k8s.io/component-base/logs/json.(*nopSync).Write(0x8?, {0xc0000fec00?, 0x0?, 0xc9a865?})
	<autogenerated>:1 +0x29
go.uber.org/zap/zapcore.(*lockedWriteSyncer).Write(0xc000352990, {0xc0000fec00?, 0x23348a0?, 0x12a8c20?})
	/go/pkg/mod/go.uber.org/[email protected]/zapcore/write_syncer.go:66 +0x72
go.uber.org/zap/zapcore.(*ioCore).Write(0xc00031d260, {0x0, {0xc1461a375222ccdc, 0x23348a0, 0x12a8c20}, {0x0, 0x0}, {0xc9df10, 0xf}, {0x1, ...}, ...}, ...)
	/go/pkg/mod/go.uber.org/[email protected]/zapcore/core.go:99 +0xb5
go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc00035a1a0, {0xc000364000, 0x2, 0x2})
	/go/pkg/mod/go.uber.org/[email protected]/zapcore/entry.go:255 +0x1d9
github.com/go-logr/zapr.(*zapLogger).Info(0xc00031d2f0, 0x0, {0xc9df10?, 0x5a3522?}, {0xc0003564e0, 0x2, 0x2})
	/go/pkg/mod/github.com/go-logr/[email protected]/zapr.go:210 +0xa5
github.com/go-logr/logr.Logger.Info({{0xdc20c8?, 0xc00031d2f0?}, 0x0?}, {0xc9df10, 0xf}, {0xc0003564e0, 0x2, 0x2})
	/go/pkg/mod/github.com/go-logr/[email protected]/logr.go:278 +0xe4
k8s.io/klog/v2.(*loggingT).infoS(0x3?, 0x20?, {0x0?, 0x0?}, 0xc00025dad0?, {0xc9df10?, 0xdbd568?}, {0xc0003564e0, 0x2, 0x2})
	/go/pkg/mod/k8s.io/klog/[email protected]/klog.go:780 +0x113
k8s.io/klog/v2.InfoS(...)
	/go/pkg/mod/k8s.io/klog/[email protected]/klog.go:1512
github.com/Azure/kubernetes-kms/pkg/metrics.InitMetricsExporter({0xc9a865, 0xa}, {0xc9472b, 0x4})
	/workspace/pkg/metrics/exporter.go:17 +0xf6
main.main()
	/workspace/main.go:82 +0x195

Steps To Reproduce
/kubernetes-kms -log-format-json=true

Expected behavior
Does not panic

KMS Plugin for Key Vault version
v0.5.0

Kubernetes version
v1.26.9

@montaguethomas montaguethomas added the bug Something isn't working label Oct 24, 2023
@aramase
Copy link
Member

aramase commented Feb 22, 2024

@nilekhc could you take a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants