官方 tiup 基准测试无法运行,报错:panic: failed to connect to database when loading data

Bug 反馈
依照官方的性能测试步骤,在运行 ubuntu 20 操作系统的服务器中,无法跑通任何性能测试。
参考的操作文档:
https://docs.pingcap.com/zh/tidb/stable/benchmark-tidb-using-tpcc

【 TiDB 版本】
6.5.0

【 Bug 的影响】

官方 tiup 基准测试无法运行,报错:panic: failed to connect to database when loading data

【可能的问题复现步骤】

# tiup bench tpcc -H 10.x.x.x -P 4000 -D tpcc --warehouses 1 --threads 1 prepare
tiup is checking updates for component bench ...
Starting component `bench`: /root/.tiup/components/bench/v1.12.0/tiup-bench tpcc -H 10.x.x.x -P 4000 -D tpcc --warehouses 1 --threads 1 prepare
panic: failed to connect to database when loading data

goroutine 1 [running]:
github.com/pingcap/go-tpc/tpcc.NewWorkloader(0x0?, 0xc0003dcfa0?)
	/home/runner/work/go-tpc/go-tpc/tpcc/workload.go:110 +0x93d
main.executeTpcc({0xa9ce83, 0x7})
	/home/runner/work/go-tpc/go-tpc/cmd/go-tpc/tpcc.go:64 +0x1ea
main.registerTpcc.func1(0xc000376dc0?, {0xa99807?, 0xa?, 0xa?})
	/home/runner/work/go-tpc/go-tpc/cmd/go-tpc/tpcc.go:94 +0x25
github.com/spf13/cobra.(*Command).execute(0xc000376dc0, {0xc0000d20a0, 0xa, 0xa})
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:846 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0xc000376580)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x39c
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
main.main()
	/home/runner/work/go-tpc/go-tpc/cmd/go-tpc/main.go:250 +0x7e5

【看到的非预期行为】

【期望看到的行为】
可正常运行测试

【相关组件及具体版本】

# tiup bench
tiup is checking updates for component bench ...
Starting component `bench`: /root/.tiup/components/bench/v1.12.0/tiup-bench
Usage: tiup bench {ch/rawsql/tpcc/tpch/ycsb} [flags]

【其他背景信息或者截图】
已排除连接问题。可以使用 mysql client 正常联通。

bogon:key xxx$ mysql -h 10.x.x.x -P 4000 -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 483
Server version: 5.7.25-TiDB-v6.5.0 TiDB Server (Apache License 2.0) Community Edition, MySQL 5.7 compatible

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

用户名密码没指定

谢谢及时的回复。
奇怪的是,增加用户名&密码后报相同的错。

# tiup bench tpcc -H 10.x.x.x -P 4000 --user demo --password 123456 -D tpcc --warehouses 1 --threads 1 prepare
tiup is checking updates for component bench ...
Starting component `bench`: /root/.tiup/components/bench/v1.12.0/tiup-bench tpcc -H 10.x.x.x -P 4000 --user demo --password 123456 -D tpcc --warehouses 1 --threads 1 prepare
panic: failed to connect to database when loading data

goroutine 1 [running]:
github.com/pingcap/go-tpc/tpcc.NewWorkloader(0x0?, 0xc0004a0140?)
	/home/runner/work/go-tpc/go-tpc/tpcc/workload.go:110 +0x93d
main.executeTpcc({0xa9ce83, 0x7})
	/home/runner/work/go-tpc/go-tpc/cmd/go-tpc/tpcc.go:64 +0x1ea
main.registerTpcc.func1(0xc0000feb00?, {0xa99807?, 0xe?, 0xe?})
	/home/runner/work/go-tpc/go-tpc/cmd/go-tpc/tpcc.go:94 +0x25
github.com/spf13/cobra.(*Command).execute(0xc0000feb00, {0xc0001982a0, 0xe, 0xe})
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:846 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0xc0000fe2c0)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x39c
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
main.main()
	/home/runner/work/go-tpc/go-tpc/cmd/go-tpc/main.go:250 +0x7e5

使用 mysql client 可以正常连接。

bogon:key xxx$ mysql -h 10.x.x.x -P 4000 -u demo -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 487
Server version: 5.7.25-TiDB-v6.5.0 TiDB Server (Apache License 2.0) Community Edition, MySQL 5.7 compatible

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
  1. 用户名密码是否正确?
  2. 执行tpcc的命令和 mysql client 连接数据库是在一台机器执行的吗?

不好意思,您的提示是正确的,谢谢🙏。
我使用的这个方式创建了用户:

CREATE USER demo IDENTIFIED BY '123456';

并未授予其 tpcc 数据库建表等权限。
按提示,一直理解为连接问题了 :sob:

授予权限后,可以正常测试了!

GRANT ALL ON tpcc* TO 'demo';
load to order_line in warehouse 1 district 10
begin to check warehouse 1 at condition 3.3.2.1
begin to check warehouse 1 at condition 3.3.2.2
begin to check warehouse 1 at condition 3.3.2.3
begin to check warehouse 1 at condition 3.3.2.6
begin to check warehouse 1 at condition 3.3.2.9
begin to check warehouse 1 at condition 3.3.2.11
begin to check warehouse 1 at condition 3.3.2.4
begin to check warehouse 1 at condition 3.3.2.5
begin to check warehouse 1 at condition 3.3.2.7
begin to check warehouse 1 at condition 3.3.2.8
begin to check warehouse 1 at condition 3.3.2.10
begin to check warehouse 1 at condition 3.3.2.12
Finished

此话题已在最后回复的 60 天后被自动关闭。不再允许新回复。