tidb-dashboard
tidb-dashboard copied to clipboard
Does a login user have to re-authenticate after page refresh?
Question
TiDB 5.4.1
After login in dashboard, some metric or panel in home page report error "request failed with status code 500".

If refresh home or other page, the error may disappear, or may continue to appear.
Open devtools page and click the error link,error message shows "common.unauthenticated".
{"error":true,"message":"common.unauthenticated","code":"common.unauthenticated","full_text":"common.unauthenticated\n at [github.com/pingcap/tidb-dashboard/pkg/apiserver/user.newAuthService.func5()\n\t/nfs/cache/mod/github.com/pingcap/[email protected]/pkg/apiserver/user/auth.go:188\n](http://github.com/pingcap/tidb-dashboard/pkg/apiserver/user.newAuthService.func5()/n/t/nfs/cache/mod/github.com/pingcap/[email protected]/pkg/apiserver/user/auth.go:188/n) at [github.com/breeswish/gin-jwt/v2.(*GinJWTMiddleware).middlewareImpl()\n\t/nfs/cache/mod/github.com/breeswish/gin-jwt/[email protected]/auth_jwt.go:372\n](http://github.com/breeswish/gin-jwt/v2.(*GinJWTMiddleware).middlewareImpl()/n/t/nfs/cache/mod/github.com/breeswish/gin-jwt/[email protected]/auth_jwt.go:372/n) at [github.com/breeswish/gin-jwt/v2.(*GinJWTMiddleware).MiddlewareFunc.func1()\n\t/nfs/cache/mod/github.com/breeswish/gin-jwt/[email protected]/auth_jwt.go:365\n](http://github.com/breeswish/gin-jwt/v2.(*GinJWTMiddleware).MiddlewareFunc.func1()/n/t/nfs/cache/mod/github.com/breeswish/gin-jwt/[email protected]/auth_jwt.go:365/n) at [github.com/gin-gonic/gin.(*Context).Next()\n\t/nfs/cache/mod/github.com/gin-gonic/[email protected]/context.go:165\n](http://github.com/gin-gonic/gin.(*Context).Next()/n/t/nfs/cache/mod/github.com/gin-gonic/[email protected]/context.go:165/n) at [github.com/pingcap/tidb-dashboard/util/rest.ErrorHandlerFn.func1()\n\t/nfs/cache/mod/github.com/pingcap/[email protected]/util/rest/error.go:68\n](http://github.com/pingcap/tidb-dashboard/util/rest.ErrorHandlerFn.func1()/n/t/nfs/cache/mod/github.com/pingcap/[email protected]/util/rest/error.go:68/n) at [github.com/gin-gonic/gin.(*Context).Next()\n\t/nfs/cache/mod/github.com/gin-gonic/[email protected]/context.go:165\n](http://github.com/gin-gonic/gin.(*Context).Next()/n/t/nfs/cache/mod/github.com/gin-gonic/[email protected]/context.go:165/n) at [github.com/gin-contrib/gzip.Gzip.func2()\n\t/nfs/cache/mod/github.com/gin-contrib/[email protected]/gzip.go:47\n](http://github.com/gin-contrib/gzip.Gzip.func2()/n/t/nfs/cache/mod/github.com/gin-contrib/[email protected]/gzip.go:47/n) at [github.com/gin-gonic/gin.(*Context).Next()\n\t/nfs/cache/mod/github.com/gin-gonic/[email protected]/context.go:165\n](http://github.com/gin-gonic/gin.(*Context).Next()/n/t/nfs/cache/mod/github.com/gin-gonic/[email protected]/context.go:165/n) at [github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1()\n\t/nfs/cache/mod/github.com/gin-gonic/[email protected]/recovery.go:99\n](http://github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1()/n/t/nfs/cache/mod/github.com/gin-gonic/[email protected]/recovery.go:99/n) at [github.com/gin-gonic/gin.(*Context).Next()\n\t/nfs/cache/mod/github.com/gin-gonic/[email protected]/context.go:165\n](http://github.com/gin-gonic/gin.(*Context).Next()/n/t/nfs/cache/mod/github.com/gin-gonic/[email protected]/context.go:165/n) at [github.com/gin-gonic/gin.(*Engine).handleHTTPRequest()\n\t/nfs/cache/mod/github.com/gin-gonic/[email protected]/gin.go:489\n](http://github.com/gin-gonic/gin.(*Engine).handleHTTPRequest()/n/t/nfs/cache/mod/github.com/gin-gonic/[email protected]/gin.go:489/n) at [github.com/gin-gonic/gin.(*Engine).ServeHTTP()\n\t/nfs/cache/mod/github.com/gin-gonic/[email protected]/gin.go:445\n](http://github.com/gin-gonic/gin.(*Engine).ServeHTTP()/n/t/nfs/cache/mod/github.com/gin-gonic/[email protected]/gin.go:445/n) at [github.com/pingcap/tidb-dashboard/pkg/apiserver.(*Service).handler()\n\t/nfs/cache/mod/github.com/pingcap/[email protected]/pkg/apiserver/apiserver.go:234\n](http://github.com/pingcap/tidb-dashboard/pkg/apiserver.(*Service).handler()/n/t/nfs/cache/mod/github.com/pingcap/[email protected]/pkg/apiserver/apiserver.go:234/n) at net/http.HandlerFunc.ServeHTTP()\n\t/usr/local/go/src/net/http/server.go:2069\n at [github.com/pingcap/tidb-dashboard/pkg/utils.(*ServiceStatus).NewStatusAwareHandler.func1()\n\t/nfs/cache/mod/github.com/pingcap/[email protected]/pkg/utils/service_status.go:67\n](http://github.com/pingcap/tidb-dashboard/pkg/utils.(*ServiceStatus).NewStatusAwareHandler.func1()/n/t/nfs/cache/mod/github.com/pingcap/[email protected]/pkg/utils/service_status.go:67/n) at net/http.HandlerFunc.ServeHTTP()\n\t/usr/local/go/src/net/http/server.go:2069\n at net/http.(*ServeMux).ServeHTTP()\n\t/usr/local/go/src/net/http/server.go:2448\n at [go.etcd.io/etcd/embed.(*accessController).ServeHTTP()\n\t/nfs/cache/mod/go.etcd.io/[email protected]/embed/serve.go:359\n](http://go.etcd.io/etcd/embed.(*accessController).ServeHTTP()/n/t/nfs/cache/mod/go.etcd.io/[email protected]/embed/serve.go:359/n) at net/http.serverHandler.ServeHTTP()\n\t/usr/local/go/src/net/http/server.go:2887\n at net/http.(*conn).serve()\n\t/usr/local/go/src/net/http/server.go:1952\n at runtime.goexit()\n\t/usr/local/go/src/runtime/asm_amd64.s:1371"}