-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
clientv3 doesn't renew the auth token #13413
Comments
@ljupchokotev which version are you using? Could you try the latest master branch? I think it’s already fixed. Let me backport the change to the stable releases. |
Sorry, forgot to include that in the issue. I am using v3.5.0, both etcd cluster and go client. I will try the master branch |
@mitake just tried it with the version from master and it doesn't change the behavior, the client still throws the "invalid auth token" error. |
@mitake There is a log line that is logged each time, the actual return error and response is correct. Looks like the error "invalid auth token" in our app is caused by something else. I will investigate more on our side and see, otherwise I will close this issue in a few days. |
@ljupchokotev thanks for checking. BTW did you rebuild your client with the latest version of |
I think it's the same problem with #12385, |
We're seeing the same issue after some time for some clients. In this example we started seeing the error after 7d 6h 45min of client being connected:
|
@mitake did fixed this issue in commit, but clientv3 is still depending on 3.5.0 api and pkg, please see here. Users can manually update the go.mod to use the main branch of clientv3, such as, But after running "go mod tidy", it automatically add 3.5.0 version of api and pkg,
After the fix in commit is merged into the main branch, a new tag, i.e. 3.6.0-rc.1, should be added for api and pkg, and then update the clientv3's go.mod to point to the tags. Otherwises, it will break all new applications which depend-on/try the latest main branch. |
I just realized that it isn't an issue at all, it is just a warning message, please see retry_interceptor.go#L62-L66. The clientv3 can get a new token automatically when the error is ErrInvalidAuthToken, please see retry_interceptor.go#L83. Actually the second "client.Get(context.Background(), "test")" returns the expected K/V, and the err is nil. The issue I pointed out in previous comment is still valid. The clientv3's go.mod in main branch is still pointing to 3.5.0 version of api and pkg. It is not correct, because an application depends on the newest clientv3 in main branch can't even be compiled successfully. |
thanks for checking @ahrtr , I agree with your findings. The warning log message is not harmful at all. Also can we compile the example program if we have the cloned repository of etcd in GOPATH, right? @ljupchokotev @cfz could you check that it's still reproducible on main? I'm also backporting the fix to release-3.5: #13477 |
Yes, I verified that it's working on etcd 3.5.1. Please note the concern I raised previously isn't valid. Although the clientv3 on main branch is still depending on 3.5.0 pkg & api, the versions are replaced with local directories, please see go.mod#L42-L43 , so it shouldn't be a problem. Actually in golang 1.18, a workspace mode will be supported, in that case, we only need to add a go.work in the top directory and get all the required replace directives included in it. On the other hand, I think we should remove all the replace directives in the go.mod files in all modules, so as to remove the build level dependencies on the files on local disk. If this is true and accepted, then we do not need the go.work in future. I raised an issue to track the improvement etcd/issues/13478 . |
hi @mitake, i checked latest main branch, and your backport branch (https://github.com/mitake/etcd/tree/backport-13308-to-3.5), both are failed with my test case described in #12385. |
@cfz The following is my go.mod file for the example, and it's working. Please have a try and let me know the result.
|
Closing this issue since it's already been fixed in commit |
How can the bug in etcd v3.5.13 still exist and be resolved? |
The etcd clientv3 doesn't renew the auth token when it expires, it just fails with
invalid auth token
. It happens with both simple and jwt token types.Steps to reproduce:
etcd --auth-token simple --auth-token-ttl 5
Output:
As you can see, the first
client.Get
succeeded in fetching thetest
key, but the second one fails withinvalid auth token
.Am I missing something simple here?
EDIT: If you make 10 requests while sleeping for 1 second in-between, the error does not show up.
The text was updated successfully, but these errors were encountered: