experimental icon indicating copy to clipboard operation
experimental copied to clipboard

cloudevents Failed to emit cloud events no cloud events client found

Open DirkTheDaring opened this issue 2 years ago • 5 comments

Expected Behavior

Make the tekton / keptn example cloud events work Tekton CloudEvents(Experimental) should emit messages to broker

Actual Behavior

Error in logfiles that "Unable to fetch client from context"

Steps to Reproduce the Problem

  1. kubectl apply -f https://storage.cloud.google.com/tekton-releases-nightly/cloudevents/latest/release.yaml
  2. run a job
  3. Observer log
kubectl -n tekton-cloudevents logs -l app=tekton-cloudevents-controller  -c tekton-cloudevents-controller -f
{"level":"info","ts":1648988823.5500846,"logger":"cloudevents-pipelinerun-controller","caller":"cloudevent/sender.go:69","msg":"send event for object of kind: &TypeMeta{Kind:,APIVersion:,}","knative.dev/controller":"github.com.tektoncd.experimental.cloudevents.pkg.reconciler.pipelinerun.Reconciler","knative.dev/kind":"tekton.dev.PipelineRun","knative.dev/traceid":"53704d8e-267f-4e45-9fa1-21eef24823e1","knative.dev/key":"default/build-artifact-run-58x25"}
{"level":"error","ts":1648988823.550098,"logger":"cloudevents-pipelinerun-controller","caller":"cloudevent/cloudeventclient.go:66","msg":"Unable to fetch client from context.","knative.dev/controller":"github.com.tektoncd.experimental.cloudevents.pkg.reconciler.pipelinerun.Reconciler","knative.dev/kind":"tekton.dev.PipelineRun","knative.dev/traceid":"53704d8e-267f-4e45-9fa1-21eef24823e1","knative.dev/key":"default/build-artifact-run-58x25","stacktrace":"github.com/tektoncd/experimental/cloudevents/pkg/reconciler/events/cloudevent.Get\n\tgithub.com/tektoncd/experimental/cloudevents/pkg/reconciler/events/cloudevent/cloudeventclient.go:66\ngithub.com/tektoncd/experimental/cloudevents/pkg/reconciler/events/cloudevent.SendCloudEventWithRetries\n\tgithub.com/tektoncd/experimental/cloudevents/pkg/reconciler/events/cloudevent/sender.go:78\ngithub.com/tektoncd/experimental/cloudevents/pkg/reconciler/events.Emit\n\tgithub.com/tektoncd/experimental/cloudevents/pkg/reconciler/events/events.go:45\ngithub.com/tektoncd/experimental/cloudevents/pkg/reconciler/pipelinerun.(*Reconciler).ReconcileKind\n\tgithub.com/tektoncd/experimental/cloudevents/pkg/reconciler/pipelinerun/reconciler.go:74\ngithub.com/tektoncd/pipeline/pkg/client/injection/reconciler/pipeline/v1beta1/pipelinerun.(*reconcilerImpl).Reconcile\n\tgithub.com/tektoncd/[email protected]/pkg/client/injection/reconciler/pipeline/v1beta1/pipelinerun/reconciler.go:235\nknative.dev/pkg/controller.(*Impl).processNextWorkItem\n\tknative.dev/[email protected]/controller/controller.go:542\nknative.dev/pkg/controller.(*Impl).RunContext.func3\n\tknative.dev/[email protected]/controller/controller.go:478"}
{"level":"warn","ts":1648988823.5501328,"logger":"cloudevents-pipelinerun-controller","caller":"events/events.go:47","msg":"Failed to emit cloud events no cloud events client found in the context","knative.dev/controller":"github.com.tektoncd.experimental.cloudevents.pkg.reconciler.pipelinerun.Reconciler","knative.dev/kind":"tekton.dev.PipelineRun","knative.dev/traceid":"53704d8e-267f-4e45-9fa1-21eef24823e1","knative.dev/key":"default/build-artifact-run-58x25"}

Additional Info

  • Kubernetes version: v1.23.5 Output of kubectl version:

Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.5", GitCommit:"c285e781331a3785a7f436042c65c5641ce8a9e9", GitTreeState:"clean", BuildDate:"2022-03-16T15:58:47Z", GoVersion:"go1.17.8", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.3", GitCommit:"816c97ab8cff8a1c72eccca1026f7820e93e0d25", GitTreeState:"clean", BuildDate:"2022-01-25T21:19:12Z", GoVersion:"go1.17.6", Compiler:"gc", Platform:"linux/amd64"}


- Tekton Pipeline version:

**Output of `tkn version` or `kubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'`**

Client version: 0.23.1 Pipeline version: v0.34.1 Triggers version: v0.19.1 Dashboard version: v0.24.1



<!-- Any other additional information -->
Patched the following things 

#!/usr/bin/bash BROKER_NAMESPACE=cloudevents BROKER_NAME=events-broker BROKER_SINK="http://broker-ingress.knative-eventing.svc.cluster.local/$BROKER_NAMESPACE/$BROKER_NAME"

NAMESPACE=tekton-cloudevents kubectl patch configmap/config-defaults
--namespace $NAMESPACE
--type merge
--patch '{"data":{"default-cloud-events-sink": "'$BROKER_SINK'"}}'

NAMESPACE=tekton-pipelines kubectl patch configmap/feature-flags-triggers
--namespace $NAMESPACE
--type merge
--patch '{"data":{"enable-api-fields": "alpha"}}'

DirkTheDaring avatar Apr 03 '22 12:04 DirkTheDaring

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale with a justification. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

tekton-robot avatar Jul 02 '22 12:07 tekton-robot

/remove-lifecycle stale

afrittoli avatar Jul 02 '22 13:07 afrittoli

Hello @DirkTheDaring , sorry I missed this issue before, is this still a problem? I could look into it next week

afrittoli avatar Jul 02 '22 13:07 afrittoli

yes it is, i worked around it, but i dropped the whole idea, some months ago, because of no reaction, so i believed this to be dead - it simply does not work anymore with current versions - happy to try it again, though

DirkTheDaring avatar Jul 02 '22 14:07 DirkTheDaring

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale with a justification. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

tekton-robot avatar Sep 30 '22 15:09 tekton-robot

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten with a justification. Rotten issues close after an additional 30d of inactivity. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle rotten

Send feedback to tektoncd/plumbing.

tekton-robot avatar Oct 30 '22 15:10 tekton-robot

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen with a justification. Mark the issue as fresh with /remove-lifecycle rotten with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/close

Send feedback to tektoncd/plumbing.

tekton-robot avatar Nov 29 '22 15:11 tekton-robot

@tekton-robot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen with a justification. Mark the issue as fresh with /remove-lifecycle rotten with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/close

Send feedback to tektoncd/plumbing.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

tekton-robot avatar Nov 29 '22 15:11 tekton-robot