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

Repeated error messages when a Cloud Events sink is configured #5683

Closed
aruiz14 opened this issue Oct 25, 2022 · 5 comments
Closed

Repeated error messages when a Cloud Events sink is configured #5683

aruiz14 opened this issue Oct 25, 2022 · 5 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@aruiz14
Copy link

aruiz14 commented Oct 25, 2022

Expected Behavior

Absence of error logs.

Actual Behavior

The following error message is produced every time an event is produced:

{
  "severity": "error",
  "timestamp": "2022-10-25T09:07:48.433Z",
  "logger": "tekton-pipelines-controller",
  "caller": "cache/cacheclient.go:58",
  "message": "Unable to fetch client from context.",
  "commit": "40a438a",
  "knative.dev/controller": "github.com.tektoncd.pipeline.pkg.reconciler.taskrun.Reconciler",
  "knative.dev/kind": "tekton.dev.TaskRun",
  "knative.dev/traceid": "073c5d18-258f-44b6-8633-9f922f9ebe53",
  "knative.dev/key": "tekton-pipelines/ginkgo-action-phc96",
  "stacktrace": "github.com/tektoncd/pipeline/pkg/reconciler/events/cache.Get\n\tgithub.com/tektoncd/pipeline/pkg/reconciler/events/cache/cacheclient.go:58\ngithub.com/tektoncd/pipeline/pkg/reconciler/events/cloudevent.SendCloudEventWithRetries\n\tgithub.com/tektoncd/pipeline/pkg/reconciler/events/cloudevent/cloud_event_controller.go:143\ngithub.com/tektoncd/pipeline/pkg/reconciler/events.Emit\n\tgithub.com/tektoncd/pipeline/pkg/reconciler/events/event.go:64\ngithub.com/tektoncd/pipeline/pkg/reconciler/taskrun.(*Reconciler).finishReconcileUpdateEmitEvents\n\tgithub.com/tektoncd/pipeline/pkg/reconciler/taskrun/taskrun.go:295\ngithub.com/tektoncd/pipeline/pkg/reconciler/taskrun.(*Reconciler).ReconcileKind\n\tgithub.com/tektoncd/pipeline/pkg/reconciler/taskrun/taskrun.go:189\ngithub.com/tektoncd/pipeline/pkg/client/injection/reconciler/pipeline/v1beta1/taskrun.(*reconcilerImpl).Reconcile\n\tgithub.com/tektoncd/pipeline/pkg/client/injection/reconciler/pipeline/v1beta1/taskrun/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:491"
}

Steps to Reproduce the Problem

  1. Install Tekton.
  2. Configure a Cloud Events sink.
  3. Add some dummy TaskRun and observe the controller logs.

Additional Info

  • Kubernetes version: 1.23

    Output of kubectl version:

Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.9", GitCommit:"c1de2d70269039fe55efb98e737d9a29f9155246", GitTreeState:"clean", BuildDate:"2022-07-13T14:19:57Z", GoVersion:"go1.17.11", 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}'

v0.40.2

I suspect this happens due to #3862, when a Cloud Events Sink is configured but the experimental cloud events for Run objects are disabled (default).
From what I could see, the cache.ToContext function is only called from ReconcileKind for Run objects. However, SendCloudEventWithRetries is trying to retrieve this cache client, which fails if the object being processed is not a Run.

I assume one of the fixes would be to store the cache client in the context of every kind reconciler, retrieving it conditionally to the kind being checked or maybe just removing the log error, but I'm afraid I'm not familiar with the code to decide which one should make it.

Thanks in advance!

@aruiz14 aruiz14 added the kind/bug Categorizes issue or PR as related to a bug. label Oct 25, 2022
@mike-serchenia
Copy link

the same issue

but with send-cloudevents-for-runs: 'true'

@tekton-robot
Copy link
Collaborator

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 tekton-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 22, 2023
@tekton-robot
Copy link
Collaborator

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 tekton-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Apr 21, 2023
@tekton-robot
Copy link
Collaborator

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
Copy link
Collaborator

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
Status: Done
Development

No branches or pull requests

3 participants