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

The resourceVersion for the provided list is too old #102160

Open
apratina opened this issue May 20, 2021 · 16 comments
Open

The resourceVersion for the provided list is too old #102160

apratina opened this issue May 20, 2021 · 16 comments
Labels
kind/support Categorizes issue or PR as a support question. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@apratina
Copy link

We get the following error msg at the time of executing kubect get pod command.

Error:

Error from server (Expired): The resourceVersion for the provided list is too old.\n

Here are the details of k8s version:

  • Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.4", GitCommit:"e87da0bd6e03ec3fea7933c4b5263d151aafd07c", GitTreeState:"clean", BuildDate:"2021-02-18T16:12:00Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"darwin/amd64"}
  • Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.7", GitCommit:"1dd5338295409edcfff11505e7bb246f0d325d15", GitTreeState:"clean", BuildDate:"2021-01-13T13:15:20Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"}

We would like to understand what does this error mean?

@apratina apratina added the kind/bug Categorizes issue or PR as related to a bug. label May 20, 2021
@k8s-ci-robot k8s-ci-robot added needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 20, 2021
@pacoxu
Copy link
Member

pacoxu commented May 20, 2021

Would you run kubectl get pod --v=4 or --v=6 to get more info about the request to apiserver?

/kind support
/remove-kind bug
According to current descriptions, we cannot figure out whether this is a bug.
/priority awaiting-more-evidence

@k8s-ci-robot k8s-ci-robot added kind/support Categorizes issue or PR as a support question. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. and removed kind/bug Categorizes issue or PR as related to a bug. labels May 20, 2021
@apratina
Copy link
Author

Let me try to gather some more detail. In the mean time could you share some more details on what does this msg mean and why we should see this?

@neolit123
Copy link
Member

related: kubernetes/kubectl#965
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apiserver/pkg/storage/etcd3/errors.go#L35

IIUC, this can happen in a case with a lot of pods and slow etcd response times.

/sig cli api machinery

@k8s-ci-robot
Copy link
Contributor

@neolit123: The label(s) sig/api, sig/machinery cannot be applied, because the repository doesn't have them.

In response to this:

related: kubernetes/kubectl#965
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apiserver/pkg/storage/etcd3/errors.go#L35

IIUC, this can happen in a case with a lot of pods and slow etcd response times.

/sig cli api machinery

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.

@k8s-ci-robot k8s-ci-robot added sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 20, 2021
@vsxen
Copy link

vsxen commented May 23, 2021

#72187

@lauchokyip
Copy link
Member

lauchokyip commented May 25, 2021

Hi @apratina . The resourceVersion field is a way to keep track of the persisted version of the object. Every X minutes, the api server will make a call to etcd's database which will truncate old resourceVersion. You are getting the error because the resourceVersion has been deleted and the api server is returning HTTP code 140

A very easy way to reproduce this:

  1. Let the api server listen to port X, willl use port 8080 as an example
kubectl proxy --port=8080
  1. Open your browser and type
http://localhost:8080/api/v1/pods

You will see something like

{
  "kind": "PodList",
  "apiVersion": "v1",
  "metadata": {
    "resourceVersion": "264927"
  },
  1. From the List chart over here (second row), if we set the limit=X and the resourceVersion=X then we can get the exact resourceVersion for the PodList. So type
http://localhost:8080/api/v1/pods?limit=50&resourceVersion=264927

and try decreasing the resourceVersion by 100 each time, for example

http://localhost:8080/api/v1/pods?limit=50&resourceVersion=264027

then

http://localhost:8080/api/v1/pods?limit=50&resourceVersion=263927

Eventually you will see the error message The resourceVersion for the provided list is too old.

Just like what @neolit123 suggested, it might be because you have too many pods and slow etcd response times

@fedebongio
Copy link
Contributor

/triage accepted
/cc @yliaog to dig on a old bug related to this.

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 25, 2021
@yliaog
Copy link
Contributor

yliaog commented May 25, 2021

i was thinking about #91073, it is about 'too large RV', not 'too old RV' though.

@k8s-triage-robot
Copy link

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

This bot triages issues and PRs 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 or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR 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 Aug 23, 2021
@k8s-triage-robot
Copy link

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

This bot triages issues and PRs 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 or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

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

/lifecycle rotten

@k8s-ci-robot k8s-ci-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 Sep 22, 2021
@k8s-triage-robot
Copy link

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

This bot triages issues and PRs 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:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

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

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closing this issue.

In response to this:

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

This bot triages issues and PRs 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:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

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

/close

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.

@kundan2707
Copy link

/reopen

@k8s-ci-robot
Copy link
Contributor

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

@k8s-ci-robot k8s-ci-robot reopened this Jul 16, 2023
@kundan2707
Copy link

Again reported here
projectcalico/calico#6032

@Vandit1604
Copy link
Contributor

From what i could understand after reading @lauchokyip 's comment and Efficient detection of changes, I read this

If a client watch is disconnected then that client can start a new watch from the last returned resourceVersion; the client could also perform a fresh get / list request and begin again. See Resource Version Semantics for more detail.

and the first thought that came into my mind was

Why don't we automatically start a new watch from the last returned resourceVersion or a fresh get / list request when a client watch is disconnected?

IMHO new watch from the last returned resourceVersion should be the preferred approach.
If it is something we didn't needed before but could use now I would love to work on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: Backlog
Development

No branches or pull requests