无法登录 dashboard

【 TiDB 使用环境】 /测试
【复现路径】登录dashboard报错


查了一下,以为是权限问题,然后建立了dashboardAdmin账号,报同样错误

又查了报错,说是mysql 连接提交的进程卡住了,然后重启tidb,依然报错

从建立集群到现在的操作
除了一些sqlmod的操作,添加过

server_configs:
  tidb:
    proxy-protocol.networks:

生产环境没添加此参数,使用正常
想到这里啊哈哈
我把这个参数删了就好了,好了,(艹皿艹 )
【资源配置】
6台机器 16c64G2000G硬盘
【附件:截图/日志/监控】
pd日志


粘贴文字版方便其他人检索

[2023/11/23 18:46:14.042 +08:00] [WARN] [client.go:158] ["Unknown error occurred while opening TiDB connection"] [error="commands out of sync. You can't run this command now"]
[2023/11/23 18:46:14.042 +08:00] [WARN] [error.go:89] ["Error when handling request"] [uri=/dashboard/api/user/login] [remoteAddr=10.1.118.171:1645] [errorFullText="authenticate failed, cause: error.api.user.signin.other: commands out of sync. You can't run this command now\n at github.com/pingcap/tidb-dashboard/pkg/apiserver/user/sqlauth.(*Authenticator).Authenticate()\n\t/go/pkg/mod/github.com/pingcap/tidb-dashboard@v0.0.0-20221201151320-ea3ee6971f2e/pkg/apiserver/user/sqlauth/sqlauth.go:40\n at github.com/pingcap/tidb-dashboard/pkg/apiserver/user.(*AuthService).authForm()\n\t/go/pkg/mod/github.com/pingcap/tidb-dashboard@v0.0.0-20221201151320-ea3ee6971f2e/pkg/apiserver/user/auth.go:218\n at github.com/pingcap/tidb-dashboard/pkg/apiserver/user.NewAuthService.func1()\n\t/go/pkg/mod/github.com/pingcap/tidb-dashboard@v0.0.0-20221201151320-ea3ee6971f2e/pkg/apiserver/user/auth.go:110\n at github.com/breeswish/gin-jwt/v2.(*GinJWTMiddleware).LoginHandler()\n\t/go/pkg/mod/github.com/breeswish/gin-jwt/v2@v2.6.4-jwt-patch/auth_jwt.go:437\n at github.com/pingcap/tidb-dashboard/pkg/apiserver/user.(*AuthService).LoginHandler()\n\t/go/pkg/mod/github.com/pingcap/tidb-dashboard@v0.0.0-20221201151320-ea3ee6971f2e/pkg/apiserver/user/auth.go:314\n at github.com/gin-gonic/gin.(*Context).Next()\n\t/go/pkg/mod/github.com/gin-gonic/gin@v1.7.4/context.go:165\n at github.com/pingcap/tidb-dashboard/util/rest.ErrorHandlerFn.func1()\n\t/go/pkg/mod/github.com/pingcap/tidb-dashboard@v0.0.0-20221201151320-ea3ee6971f2e/util/rest/error.go:70\n at github.com/gin-gonic/gin.(*Context).Next()\n\t/go/pkg/mod/github.com/gin-gonic/gin@v1.7.4/context.go:165\n at github.com/gin-contrib/gzip.Gzip.func2()\n\t/go/pkg/mod/github.com/gin-contrib/gzip@v0.0.1/gzip.go:47\n at github.com/gin-gonic/gin.(*Context).Next()\n\t/go/pkg/mod/github.com/gin-gonic/gin@v1.7.4/context.go:165\n at github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1()\n\t/go/pkg/mod/github.com/gin-gonic/gin@v1.7.4/recovery.go:99\n at github.com/gin-gonic/gin.(*Context).Next()\n\t/go/pkg/mod/github.com/gin-gonic/gin@v1.7.4/context.go:165\n at github.com/gin-gonic/gin.(*Engine).handleHTTPRequest()\n\t/go/pkg/mod/github.com/gin-gonic/gin@v1.7.4/gin.go:489\n at github.com/gin-gonic/gin.(*Engine).ServeHTTP()\n\t/go/pkg/mod/github.com/gin-gonic/gin@v1.7.4/gin.go:445\n at github.com/pingcap/tidb-dashboard/pkg/apiserver.(*Service).handler()\n\t/go/pkg/mod/github.com/pingcap/tidb-dashboard@v0.0.0-20221201151320-ea3ee6971f2e/pkg/apiserver/apiserver.go:244\n at net/http.HandlerFunc.ServeHTTP()\n\t/usr/local/go/src/net/http/server.go:2109\n at github.com/pingcap/tidb-dashboard/pkg/utils.(*ServiceStatus).NewStatusAwareHandler.func1()\n\t/go/pkg/mod/github.com/pingcap/tidb-dashboard@v0.0.0-20221201151320-ea3ee6971f2e/pkg/utils/service_status.go:67\n at net/http.HandlerFunc.ServeHTTP()\n\t/usr/local/go/src/net/http/server.go:2109\n at net/http.(*ServeMux).ServeHTTP()\n\t/usr/local/go/src/net/http/server.go:2487\n at go.etcd.io/etcd/embed.(*accessController).ServeHTTP()\n\t/go/pkg/mod/go.etcd.io/etcd@v0.5.0-alpha.5.0.20220915004622-85b640cee793/embed/serve.go:381\n at net/http.serverHandler.ServeHTTP()\n\t/usr/local/go/src/net/http/server.go:2947\n at net/http.(*conn).serve()\n\t/usr/local/go/src/net/http/server.go:1991\n at runtime.goexit()\n\t/usr/local/go/src/runtime/asm_amd64.s:1594"]

proxy-protocol.networks: 后面要跟值的,你啥都没写么?

[server_configs.tidb]
proxy-protocol.networks = “network1,network2”

支持名为network1network2 的网络

那看来虽然你这个和我那个不是同一个问题,但应该都是网络不通导致的。

部署dashborad使用,如果配置了 proxy-protocol.networks 参数,这里有一个坑点就是配置该参数后,TiDB 将允许配置的源 IP 地址使用 PROXY 协议连接到 TiDB,且拒绝这些源 IP 地址使用非 PROXY 协议连接。
在内部 Dashboard 是直连 tidb-server 进行权限验证的,这里就会有访问失败的问题。

要解决这个问题,通常就是不配置proxy-protocol.networks 参数 或者 把proxy-protocol.networks 参数的地址设为没有部署tidb server的外部IP节点。

https://docs.pingcap.com/zh/tidb/v7.4/tidb-configuration-file#fallbackable-span-classversion-mark从-v651-版本开始引入span

7 个赞

:100: :100: :100:

这是解决了是么?

proxy-protocol.networks后面可以跟ip或者ip列表段或者*,设置了之后这些ip只能通过proxy模式连接,无法连接tidb-server4000端口了,dashboard也连不了。我估计你设置了参数但是没值,默认当成*了所有你所有直接都无法连接tidb-server4000端口,dashboard也连不了。

我的是会从2379自动跳转到2382,不知道什么原因

这个参数是绑定网卡吗?

不是。会和你配置负载均衡的IP地址有关,官网有很详细的操作方法,可以去看看文档

学习了

学到了 可以限制登录了

写了,看了jellybean的回复,我理解了,谢谢

解决了

不是删除的问题吧,你是不是重启pd了

不止一次看到这个问题了,确实不友好

:+1: :+1: :+1:这是举一反三呀~可以可以

你再安装tidb的时候指定密码了吗

请不要把一些已经解决的问题重新刷上来。