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

[BUG] Operator crashes with ISMPolicy #896

Open
githubcdr opened this issue Nov 8, 2024 · 0 comments
Open

[BUG] Operator crashes with ISMPolicy #896

githubcdr opened this issue Nov 8, 2024 · 0 comments
Labels
bug Something isn't working untriaged Issues that have not yet been triaged

Comments

@githubcdr
Copy link

What is the bug?

A certain ISMPolicy is able to crash the operator, this should not happen.

How can one reproduce the bug?

Apply this policy

apiVersion: opensearch.opster.io/v1
kind: OpenSearchISMPolicy
metadata:
  creationTimestamp: "2024-11-08T12:37:11Z"
  finalizers:
  - opster.io/opensearch-data
  generation: 2
  labels:
    k8slens-edit-resource-version: v1
  name: ism-devops
  namespace: opensearch-testing
  resourceVersion: "369198011"
spec:
  defaultState: hot
  description: A basic policy that will immediately move data to warm, then delete
    after 365 days.
  errorNotification: {}
  ismTemplate:
    indexPatterns:
    - acr-logstash-*
    - github-logstash-*
    - azdevops-logstash-*
    priority: 1
  opensearchCluster:
    name: opensearch-cluster-testing
  policyId: ism_devops
  states:
  - actions: []
    name: hot
    transitions:
    - conditions: {}
      stateName: warm
  - actions:
    - {}
    name: warm
    transitions:
    - conditions: {}
      stateName: cold
  - actions: []
    name: cold
    transitions:
    - conditions: {}
      stateName: delete
  - actions:
    - delete: {}
    name: delete

What is the expected behavior?

Apply this policy and the operator crashes, manually removing the object is needed.

What is your host/environment?

Kubernetes 1.29.0

Do you have any screenshots?

{"level":"info","ts":"2024-11-08T12:38:31.097Z","msg":"Reconciling OpensearchISMPolicy","controller":"opensearchismpolicy","controllerGroup":"o
{"level":"info","ts":"2024-11-08T12:38:31.097Z","msg":"Reconciling OpensearchIndexTemplate","controller":"opensearchindextemplate","controllerG
{"level":"info","ts":"2024-11-08T12:38:31.097Z","msg":"Starting workers","controller":"opensearchuserrolebinding","controllerGroup":"opensearch
{"level":"info","ts":"2024-11-08T12:38:31.097Z","msg":"Reconciling OpenSearchCluster","controller":"opensearchcluster","controllerGroup":"opens
{"level":"info","ts":"2024-11-08T12:38:31.612Z","msg":"Observed a panic in reconciler: runtime error: invalid memory address or nil pointer der
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=0x8 pc=0x17203ec]

goroutine 423 [running]:
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
    /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:115 +0x1e5
panic({0x192c660?, 0x2c45b60?})
    /usr/local/go/src/runtime/panic.go:770 +0x132
github.com/Opster/opensearch-k8s-operator/opensearch-operator/pkg/reconcilers.(*IsmPolicyReconciler).CreateISMPolicy(0xc0066ab780)
    /workspace/pkg/reconcilers/ismpolicy.go:313 +0x36c
github.com/Opster/opensearch-k8s-operator/opensearch-operator/pkg/reconcilers.(*IsmPolicyReconciler).Reconcile(0xc0066ab780)
    /workspace/pkg/reconcilers/ismpolicy.go:172 +0x8f3
github.com/Opster/opensearch-k8s-operator/opensearch-operator/controllers.(*OpensearchISMPolicyReconciler).Reconcile(0xc0003b1ea0, {0x1e0f790,
    /workspace/controllers/opensearchism_controller.go:53 +0x385
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x1e0f790?, {0x1e0f790?, 0xc000fc8210?}, {{{0xc00091a2b8?, 0x185
    /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:118 +0xb7
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0006a0820, {0x1e0f7c8, 0xc0003b19a0}, {0x19aaae0, 0xc0
    /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:314 +0x345
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0006a0820, {0x1e0f7c8, 0xc0003b19a0})
    /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:265 +0x1c9
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
    /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:226 +0x79
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2 in goroutine 99
    /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:222 +0x50c

Do you have any additional context?

@githubcdr githubcdr added bug Something isn't working untriaged Issues that have not yet been triaged labels Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged Issues that have not yet been triaged
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant