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

Argo Event Contoller 1.7.1 Crash with Nill pointer on Jetstream Install #2086

Closed
zamedic opened this issue Jul 18, 2022 · 4 comments
Closed
Assignees

Comments

@zamedic
Copy link

zamedic commented Jul 18, 2022

Applying the Jetstream Example eventbus causes a crash on Argo events 1.7.1 , kubernetes: v1.24.1

Argo events was installed using Helm Chart

The root cause of the problem is that during the helm install, no jetstream versions were specified, resulting in an empty config map. Ideally, the event controller should not crash but rather catch the null value and show an error, else the event controller can be brought down with 1 bad config.

argo-events-controller-manager Config Map:

apiVersion: v1
data:
  controller-config.yaml: |
    eventBus:
kind: ConfigMap
metadata:
  annotations:
    meta.helm.sh/release-name: argo-events
    meta.helm.sh/release-namespace: argo-events
  creationTimestamp: "2022-07-15T14:16:54Z"
  labels:
    app.kubernetes.io/instance: argo-events
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: argo-events-controller-manager
    app.kubernetes.io/part-of: argo-events
    helm.sh/chart: argo-events-2.0.3
  name: argo-events-controller-manager
  namespace: argo-events
  resourceVersion: "3866"
  uid: 66fe0cd7-96d9-4459-9c42-2422d5c9de82

Crash:

I0718 07:37:41.485998       1 leaderelection.go:258] successfully acquired lease argo-events/argo-events-controller
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x17235ce]

goroutine 548 [running]:
github.com/argoproj/argo-events/controllers/eventbus/installer.(*jetStreamInstaller).Install(0xc000634de0, {0x35f1e88, 0xc000634c90})
	/home/runner/work/argo-events/argo-events/controllers/eventbus/installer/jetstream.go:81 +0xae
github.com/argoproj/argo-events/controllers/eventbus/installer.Install({0x35f1e88, 0xc000634c90}, 0xc000c7ec60, {0x3645ff8, 0xc000d6f720}, 0xc000100800, 0xc000ccf870)
	/home/runner/work/argo-events/argo-events/controllers/eventbus/installer/installer.go:32 +0x1c3
github.com/argoproj/argo-events/controllers/eventbus.(*reconciler).reconcile(0xc000d19f80, {0x35f1e88, 0xc000634c90}, 0xc000c7ec60)
	/home/runner/work/argo-events/argo-events/controllers/eventbus/controller.go:94 +0x31c
github.com/argoproj/argo-events/controllers/eventbus.(*reconciler).Reconcile(0xc000d19f80, {0x35f1e88, 0xc000634b70}, {{{0xc000165fd7, 0x2d99c40}, {0xc000165fd0, 0x30}}})
	/home/runner/work/argo-events/argo-events/controllers/eventbus/controller.go:54 +0x632
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0xc000e4e000, {0x35f1e88, 0xc000634b40}, {{{0xc000165fd7, 0x2d99c40}, {0xc000165fd0, 0x4139f4}}})
	/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:114 +0x26f
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc000e4e000, {0x35f1de0, 0xc000e2ad40}, {0x2b57c40, 0xc0006ba0c0})
	/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:311 +0x33e
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc000e4e000, {0x35f1de0, 0xc000e2ad40})
	/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:266 +0x205
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
	/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227 +0x85
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2
	/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:223 +0x357

Process finished with exit code 0

Event Bus Definition

apiVersion: argoproj.io/v1alpha1
kind: EventBus
metadata:
  name: default
spec:
  jetstream:
    version: 2.8.1
@whynowy
Copy link
Member

whynowy commented Jul 18, 2022

See if it's the same issue as #2045.

@zamedic
Copy link
Author

zamedic commented Jul 19, 2022

While I understand and acknowledge what I did wrong, I think the controller should handle the null and throw and error rather than hard crashing.

@daniel-codefresh
Copy link
Member

While I understand and acknowledge what I did wrong, I think the controller should handle the null and throw and error rather than hard crashing.

@zamedic yes, that makes sense.
We should probably add some config validation on start up rather than erroring out during eventbus reconcile, @whynowy wdyt?

@daniel-codefresh daniel-codefresh self-assigned this Jul 19, 2022
@whynowy
Copy link
Member

whynowy commented Jul 19, 2022

While I understand and acknowledge what I did wrong, I think the controller should handle the null and throw and error rather than hard crashing.

@zamedic yes, that makes sense. We should probably add some config validation on start up rather than erroring out during eventbus reconcile, @whynowy wdyt?

Makes sense!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants