tektoncd / triggers

Event triggering with Tekton!
Apache License 2.0
558 stars 420 forks source link

Getting Started clusterrolebinding namespace is wrong #990

Closed nobody4t closed 3 years ago

nobody4t commented 3 years ago

I have an ocp cluster 4.6.x. And I tried the getting-started example. But I got the error when I tried to feed the line from curl command as below:

{"level":"error","ts":"2021-03-10T10:02:02.425Z","logger":"eventlistener","caller":"sink/sink.go:223","msg":"failed to resolve bindings: error getting TriggerBinding : triggerbinding.triggers.tekton.dev \"getting-started-pipelinebinding\" not found","knative.dev/controller":"eventlistener","/triggers-eventid":"793466bf-fe86-4280-886b-9273c7531a35","/trigger":"","stacktrace":"github.com/tektoncd/triggers/pkg/sink.Sink.processTrigger\n\tgithub.com/tektoncd/triggers/pkg/sink/sink.go:223\ngithub.com/tektoncd/triggers/pkg/sink.Sink.HandleEvent.func1\n\tgithub.com/tektoncd/triggers/pkg/sink/sink.go:127"}

But the triggerbinding: getting-started-pipelinebinding does exist. So I wonder how can I debug this? Or is this a bug?

dibyom commented 3 years ago

I've heard of a couple reports of this happening intermittently. Could you delete and recreate your EventListener? Does it work then?

dibyom commented 3 years ago

@dongwangdw what version of openshift and Triggers are you using?

nobody4t commented 3 years ago

I rechecked and it resulted from the failure of cluterrole binding. I made some changes in the getting-started, https://github.com/tektoncd/triggers/blob/main/examples/rbac.yaml#L61.

This file is referred in getting-started from example. In getting-started, namespace getting-started is used but it is default here. This will cause errors. The service account should has no permission to list the triggerbindings. But the error is confusing. I think the error should be improved for right hint. This should be permisson issue here.

nobody4t commented 3 years ago

I just made it with the changes.

we can close this issue. But the getting-started exmaple should be improved.

dibyom commented 3 years ago

Ah got it....I'll keep this issue open to fix the getting-started roles.