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

Uninstalled Event Source results in "Failed to list *v1.Source: the server could not find the requested resource" #4611

Open
aavarghese opened this issue Nov 30, 2020 · 11 comments
Labels
area/sources kind/bug Categorizes issue or PR as related to a bug. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. triage/accepted Issues which should be fixed (post-triage)
Milestone

Comments

@aavarghese
Copy link
Contributor

aavarghese commented Nov 30, 2020

Describe the bug
If we create a new Event Source, ie. we install Redis Stream Sources, the parent controller successfully creates a new dynamic controller for this particular Source. But if we uninstall this Source, the created dynamic controller is not properly destroyed. This results in error messages in the log:

E1130 20:07:23.537960       1 reflector.go:383] k8s.io/client-go@v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible/tools/cache/reflector.go:125: Failed to watch *v1.Source: the server could not find the requested resource

E1130 20:07:24.782159       1 reflector.go:178] k8s.io/client-go@v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible/tools/cache/reflector.go:125: Failed to list *v1.Source: the server could not find the requested resource

E1130 20:07:27.383944       1 reflector.go:178] k8s.io/client-go@v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible/tools/cache/reflector.go:125: Failed to list *v1.Source: the server could not find the requested resource

This code to delete controller is never called:

if !crd.DeletionTimestamp.IsZero() {
// We are intentionally not setting up a finalizer on the CRD.
// This might leave unnecessary dynamic controllers running.
// This is a best effort to try to clean them up.
// Note that without a finalizer there is no guarantee we will be called.
r.deleteController(ctx, gvr)
return nil
}

Expected behavior
Error line below isn't repeated over and over and the appropriate controllers are deleted.

To Reproduce
Install knative-eventing

k apply --filename https://github.com/knative/eventing/releases/download/v0.19.0/eventing-crds.yaml
k apply  --filename https://github.com/knative/eventing/releases/download/v0.19.0/eventing-core.yaml

Install any eventing source
For example, RedisStream

ko apply -f source/config

Delete the eventing source

For example, RedisStream

ko delete -f source/config

Knative release version
0.19.0

Additional context
Same problem also in eventing-autoscaler-keda (same code)
knative-extensions/eventing-autoscaler-keda#2

@aavarghese aavarghese added the kind/bug Categorizes issue or PR as related to a bug. label Nov 30, 2020
@lberk lberk added the priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. label Dec 7, 2020
@lberk lberk added this to the Backlog milestone Dec 7, 2020
@vaikas
Copy link
Contributor

vaikas commented Dec 7, 2020

I think the problem is that with genReconciler the ReconcileKind never gets called with deleted resources. You probably need to manually add a handler, kind of like we do in IMC here so that you can call the cleanup:
https://github.com/knative/eventing/blob/master/pkg/reconciler/inmemorychannel/dispatcher/controller.go#L130

@aavarghese
Copy link
Contributor Author

@vaikas thanks for taking a look at this issue. I did attempt to implement the solution you suggested (similar to IMC) in the other sibling issue for this ... in eventing-autoscaler-keda: https://github.com/knative-sandbox/eventing-autoscaler-keda/pull/54/files#diff-9f218382398a14e88cf9424a19a54422d028e7df5a80e6d107b8d33052897859R64-R68 and unfortunately, the deleteFunc in CRD pkg doesn't get called and instead the specific SOURCE's eventhandler delete function gets called that doesn't have information of all the dynamic controllers created. So it doesn't help. This also happens here in eventing code. I tried it out for eventing this evening. So I'm blocked with both issues here until I can come up with another solution. Will appreciate any advice you have for me...

@github-actions
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 10, 2021
@github-actions github-actions bot closed this as completed Apr 9, 2021
@aavarghese
Copy link
Contributor Author

/reopen

@knative-prow-robot
Copy link
Contributor

@aavarghese: Reopened this issue.

In response to this:

/reopen

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.

@github-actions github-actions bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 10, 2021
@github-actions
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 10, 2021
@lionelvillard
Copy link
Member

/reopen
/remove-lifecycle stale

@knative-prow-robot
Copy link
Contributor

@lionelvillard: Reopened this issue.

In response to this:

/reopen
/remove-lifecycle stale

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.

@knative-prow-robot knative-prow-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 13, 2021
@github-actions
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 12, 2021
@pierDipi
Copy link
Member

/reopen
/remove-lifecycle stale
/triage accepted

@knative-prow-robot knative-prow-robot added the triage/accepted Issues which should be fixed (post-triage) label Dec 12, 2021
@knative-prow-robot
Copy link
Contributor

@pierDipi: Reopened this issue.

In response to this:

/reopen
/remove-lifecycle stale
/triage accepted

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.

@knative-prow-robot knative-prow-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sources kind/bug Categorizes issue or PR as related to a bug. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. triage/accepted Issues which should be fixed (post-triage)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants