Closed joshfrench closed 6 months ago
Seeing the same issue with version 1.11.10
as well:
{"severity":"INFO","timestamp":"2023-12-12T21:08:32.082738159Z","logger":"knative-operator","caller":"leaderelection/context.go:158","message":"\"knative-operator-6db6cdf8d5-4m8b7_7b06b719-fee2-43a3-8908-329fab17315b\" has started leading \"knative-operator.knative.dev.operator.pkg.reconciler.knativeserving.reconciler.00-of-01\"","commit":"cd1aafc-dirty","knative.dev/pod":"knative-operator-6db6cdf8d5-4m8b7"}
{"severity":"INFO","timestamp":"2023-12-12T21:08:32.102931158Z","logger":"knative-operator","caller":"knativeserving/knativeserving.go:83","message":"Deleting cluster-scoped resources","commit":"cd1aafc-dirty","knative.dev/pod":"knative-operator-6db6cdf8d5-4m8b7","knative.dev/controller":"knative.dev.operator.pkg.reconciler.knativeserving.Reconciler","knative.dev/kind":"operator.knative.dev.KnativeServing","knative.dev/traceid":"ed42b3fe-cddb-4ef7-9bc1-53160e625810","knative.dev/key":"knative-serving/knative-serving"}
panic: runtime error: index out of range [0] with length 0
goroutine 703 [running]:
knative.dev/operator/pkg/reconciler/common.FetchManifestFromArray({0x0?, 0x0?, 0x1b09c20?})
knative.dev/operator/pkg/reconciler/common/releases.go:237 +0x4f0
knative.dev/operator/pkg/reconciler/knativeserving.(*Reconciler).installed(0xc000292000, {0x1ff4468, 0xc001a74c60}, {0x200bcd0?, 0xc001c8a000})
knative.dev/operator/pkg/reconciler/knativeserving/knativeserving.go:158 +0x96
knative.dev/operator/pkg/reconciler/knativeserving.(*Reconciler).FinalizeKind(0xc000292000, {0x1ff4468, 0xc001a74c60}, 0xc0000dd1a0?)
knative.dev/operator/pkg/reconciler/knativeserving/knativeserving.go:84 +0x35d
knative.dev/operator/pkg/client/injection/reconciler/operator/v1beta1/knativeserving.(*reconcilerImpl).Reconcile(0xc0003d4000, {0x1ff4468, 0xc001a74c30}, {0xc000e226e0, 0x1f})
knative.dev/operator/pkg/client/injection/reconciler/operator/v1beta1/knativeserving/reconciler.go:241 +0x3b8
knative.dev/pkg/controller.(*Impl).processNextWorkItem(0xc000b96660)
knative.dev/pkg@v0.0.0-20231023150739-56bfe0dd9626/controller/controller.go:542 +0x4ad
knative.dev/pkg/controller.(*Impl).RunContext.func3()
knative.dev/pkg@v0.0.0-20231023150739-56bfe0dd9626/controller/controller.go:491 +0x59
created by knative.dev/pkg/controller.(*Impl).RunContext in goroutine 698
knative.dev/pkg@v0.0.0-20231023150739-56bfe0dd9626/controller/controller.go:489 +0x349
I did not pinpoint the issue, but I have a hunch it was related to orphaned KnativeServing
CRs left around from previous deployments, possibly in other namespaces.
I cannot reproduce this on an empty cluster, which also speaks for https://github.com/knative/operator/issues/1652#issuecomment-1854565124. Can you prove instructions (maybe try to get all existing Knative related K8s objects?) to reproduce the issue?
We moved past it by simply deleting all Knative-related resources and reinstalling. But as another data point we are using Helm to manage these charts, which notoriously does not remove CRDs when you delete a release. So there was a path to end up with a valid KnativeServing
even after the operator was deleted. IIRC the impacted workflow was something like:
KnativeServing
CRKnativeServing
?)@joshfrench @ReToCode I opened a PR fixing this issue. Just make sure that the list is not empty before calling common.FetchManifestFromArray
.
Normally, status.manifests should not be empty at all with the operator. However, it looks like we have to check.
Describe the bug
Knative Operator pod crashes with a panic shortly after launch:
This is using an unmodified manifest from https://github.com/knative/operator/releases/download/knative-v1.12.1/operator.yaml.
Expected behavior Not a panic.
To Reproduce Apply Knative Operator manifest. Wait.
Knative release version I have witnessed this on v1.12.0 and v1.12.1.