-
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
go panic when using JWT token and root role #9695
Comments
etcd --version |
@jxuan going to take a stab at this unless you already have it knocked out. |
@jxuan ping, would you mind sharing your etcd startup config so I can test against this PR, please. In general, can you outline steps to reproduce the panic? Thanks! |
Sorry for the late reply. Below is my setup: |
To reproduce this error, I have a client connecting to my etcd server host (one host), then I restart the etcd server host. The client will re-connect to the server again. This is when it triggers the go panic. Hope it helps. |
@jxuan thank you for the details! |
Any update on the fix? |
@jxuan sorry for the delay didn't get much done this weekend. Will hop on this Tuesday should have an update soon. |
@jxuan have you had a chance to test this? Would like for you to sign off on this before we merge. |
When I use the latest master code to test jwt token, sometimes ETCD server stops with the following go panic. Note that I am using a test account with root role.
`panic: interface conversion: auth.TokenProvider is *auth.tokenJWT, not *auth.tokenSimple
goroutine 610 [running]:
github.com/coreos/etcd/auth.(*authStore).WithRoot(0xc420373bc0, 0x4d5d760, 0xc42036e7c0, 0x4c505e4, 0xc420f64254)
/Users/jiangxuan/gopath/src/github.com/coreos/etcd/auth/store.go:1277 +0x82a
github.com/coreos/etcd/etcdserver.(*EtcdServer).run.func9.1()
/Users/jiangxuan/gopath/src/github.com/coreos/etcd/etcdserver/server.go:989 +0x8c
github.com/coreos/etcd/etcdserver.(*EtcdServer).goAttach.func1(0xc420112000, 0xc420bc9d10)
/Users/jiangxuan/gopath/src/github.com/coreos/etcd/etcdserver/server.go:2371 +0x55
created by github.com/coreos/etcd/etcdserver.(*EtcdServer).goAttach
/Users/jiangxuan/gopath/src/github.com/coreos/etcd/etcdserver/server.go:2369 +0x1a8`
It is caused by hardcoding tokenSimple in auth/store.go line 1277:
1277 if ts := as.tokenProvider.(*tokenSimple); ts != nil {
It should be written for simple token as well as jwt token, instead of being hardcoded for simpleToken only.
The text was updated successfully, but these errors were encountered: