-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
kube::runtime::watcher
exits with The resourceVersion for the provided watch is too old
#1615
Comments
Perhaps this is a bit counter-intuitive, but watcher::Error is an error type that we mostly propagate for logging and our own recovery. The errors may occur, but the errors in that enum are generally recoverable. The problem is your |
Hey, there are really several separate issues going on here:
This will panic on the first error received. Instead, you could do something like: while let Some(event) = stream.try_next().await {
match event {
Ok(event) => println!(
"Event in namespace {}: reason: {:?}, message: {:?}",
ns, event.reason, event.message
),
Err(err) => eprintln!("Error during watch: {err:?}"),
}
}
When reconnecting, However, Kubernetes only keeps the replay cache for so long, and will reject attempts to reconnect if the |
I didn't expect that I should just continue Maybe https://github.com/kube-rs/kube/blob/main/examples/event_watcher.rs#L48 should be updated with the match? |
Fixes kube-rs#1615 Signed-off-by: Natalie Klestrup Röijezon <nat@nullable.se>
Updated the example in #1616. |
Thank you! Looks good to me. |
Current and expected behavior
When I'm trying to watch k8s events, watcher exits with error
ErrorResponse { status: "Failure", message: "The resourceVersion for the provided watch is too old.", reason: "Expired", code: 410 }
instead of re-trying connection.Looks like this happens only for Event and probably when there is nothing going on in a namespace. The namespace from the example has bunch of deployments, but all of them with 0 replicas.
Possible solution
No response
Additional context
Code to prove the bug:
Log before exits:
Environment
GKE
Debian sid
Configuration and features
Affected crates
kube-runtime
Would you like to work on fixing this bug?
maybe
The text was updated successfully, but these errors were encountered: