-
Notifications
You must be signed in to change notification settings - Fork 315
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
JWT token is not refreshed if etcd responds with "auth: revision in header is old" #1344
Comments
@Rmarian, do you have time to work on a pr to fix the issue ? |
@lburgazzoli yes, I already have the fix locally. I can open a PR soon. |
Retry request in case of auth store revision old error from server Fixes etcd-io#1344.
@lburgazzoli So in the end the PR fix is a bit different than what I initially planned. It turned out that the fact that etcd was returning "auth: revision in header is old" was a bug in 3.5.0 since fixed by etcd-io/etcd#13308 However even after testing with 3.5.10 I got another failure "etcdserver: revision of auth store is old". So I added this error to the retry condition as well and now all seems fine. Looks like in the original fix, etcd-io/etcd#13308, the condition was not added as re-tryable but I don't know why. |
Retry request in case of auth store revision old error from server Fixes etcd-io#1344. Signed-off-by: rmarian <marianradu12@gmail.com>
Format affected source files. Fixes etcd-io#1344. Signed-off-by: rmarian <marianradu12@gmail.com>
Retry request in case of auth store revision old error from server Fixes #1344. Signed-off-by: rmarian <marianradu12@gmail.com>
Format affected source files. Fixes #1344. Signed-off-by: rmarian <marianradu12@gmail.com>
Versions
Describe the bug
When using jetcd with authentication enabled, if the cached JWT token becomes invalid because it's revision has become obsolete and etcd responds with "auth: revision in header is old" error, jetcd fails to refresh the token and instead reuses the same one until it expires normally.
To Reproduce
Expected behavior
The instantiated jetcd client continues to work but instead on every subsequent request the error "io.grpc.StatusRuntimeException: UNKNOWN: auth: revision in header is old" is returned
Additional context
Seems like the auth token validity logic must be updated in io.etcd.jetcd.support.Errors:
public static boolean isInvalidTokenError(Status status) { return (status.getCode() == Code.UNAUTHENTICATED || status.getCode() == Code.UNKNOWN) && "etcdserver: invalid auth token".equals(status.getDescription()); }
An extra check for "auth: revision in header is old" should be added here.
After I added this my tests worked fine.
The text was updated successfully, but these errors were encountered: