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

cache contained <nil> #2898

Open
DerekTBrown opened this issue Aug 1, 2024 · 6 comments
Open

cache contained <nil> #2898

DerekTBrown opened this issue Aug 1, 2024 · 6 comments
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@DerekTBrown
Copy link

I am using controller-runtime to create a controller that tracks pods using a cache. I get the following error:

failed to list from informer: cache contained <nil>, which is not an Object

This is coming from the following line, which indicates that the condition should never happen:

https://github.com/kubernetes-sigs/controller-runtime/blob/main/pkg/cache/internal/cache_reader.go#L80

How should I proceed to debug this?

@DerekTBrown
Copy link
Author

Possibly related to: actions/actions-runner-controller#776

@DerekTBrown
Copy link
Author

DerekTBrown commented Aug 1, 2024

[Correction] this is coming from a List call, so its actually coming from:

https://github.com/kubernetes-sigs/controller-runtime/blob/v0.18.4/pkg/cache/internal/cache_reader.go#L153

@alvaroaleman
Copy link
Member

I've never seen this. Are you using UnsafeDisableDeepCopy?

@DerekTBrown
Copy link
Author

Are you using UnsafeDisableDeepCopy?

Nope.

@DerekTBrown
Copy link
Author

I've never seen this.

I am having an incredibly hard time trying to reproduce this. I tried introspecting controller-runtime and client-go, but I can't see any obvious race conditions or anything that would lead to this behavior.

To try to bisect the issue further, I created a patched version of client-go that will panic if ever a nil object becomes present in the cache:

DerekTBrown/client-go#1

I then patched this into my controller, but haven't seen the issue re-appear. Notably, when I did the patching, I saw a bunch of unrelated version upgrades in my go.sum:

Screenshot 2024-08-02 at 12 14 08 PM

I wonder if this is a bug somewhere in one of these older package versions.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

4 participants