obd demo 设置datafile_disk_percentage参数报错

【 使用环境 】测试环境
【 OB or 其他组件 】OBD
【 使用版本 】

OceanBase Deploy: 2.1.0
REVISION: a44bf47214329b0d9dcbcbed7ab827c0b6d98892
BUILD_BRANCH: HEAD
BUILD_TIME: May 19 2023 10:50:39OURCE

【问题描述】
使用OBD部署OceanBase时,通过命令行传参报错:

[ERROR] oceanbase-ce-py_script_generate_config-4.0.0.0 RuntimeError: string indices must be integers

【复现路径】

obd demo --oceanbase-ce.datafile_disk_percentage=90

【问题现象及影响】

obd demo --oceanbase-ce.datafile_disk_percentage=90
Cluster param config check ok
Open ssh connection ok
Generate prometheus configuration ok
Generate grafana configuration ok
Generate observer configuration ok
[ERROR] oceanbase-ce-py_script_generate_config-4.0.0.0 RuntimeError: string indices must be integers
Generate obproxy configuration ok
See https://www.oceanbase.com/product/ob-deployer/error-codes .
Trace ID: 8556cc44-005a-11ee-8ada-000c29e8c65e
If you want to view detailed obd logs, please run: obd display-trace 8556cc44-005a-11ee-8ada-000c29e8c65e

报错日志:

[2023-06-01 15:45:49.494] [ERROR] oceanbase-ce-py_script_generate_config-4.0.0.0 RuntimeError: string indices must be integers
[2023-06-01 15:45:49.494] [ERROR] Traceback (most recent call last):
[2023-06-01 15:45:49.494] [ERROR]   File "core.py", line 1302, in demo
[2023-06-01 15:45:49.494] [ERROR]   File "core.py", line 1056, in genconfig
[2023-06-01 15:45:49.494] [ERROR]   File "core.py", line 184, in call_plugin
[2023-06-01 15:45:49.494] [ERROR]   File "_plugin.py", line 323, in __call__
[2023-06-01 15:45:49.494] [ERROR]   File "_plugin.py", line 285, in _new_func
[2023-06-01 15:45:49.494] [ERROR]   File "/root/.obd/plugins/oceanbase-ce/4.0.0.0/generate_config.py", line 311, in generate_config
[2023-06-01 15:45:49.494] [ERROR]     datafile_size = data_dir_mount['total'] * datafile_disk_percentage / 100
[2023-06-01 15:45:49.494] [ERROR] TypeError: string indices must be integers
[2023-06-01 15:45:49.494] [ERROR]
[2023-06-01 15:45:49.494] [DEBUG] - sub generate_config ref count to 0
[2023-06-01 15:45:49.494] [DEBUG] - export generate_config
[2023-06-01 15:45:49.495] [DEBUG] - Call obproxy-ce-py_script_generate_config-3.1.0 for obproxy-ce-4.1.0.0-7.el7-2a9d9bf67f179dcca2a8c9e7c77373d94e7e2abe
[2023-06-01 15:45:49.495] [DEBUG] - import generate_config
[2023-06-01 15:45:49.495] [DEBUG] - add generate_config ref count to 1
[2023-06-01 15:45:49.539] [INFO] [ERROR] oceanbase-ce-py_script_generate_config-4.0.0.0 RuntimeError: string indices must be integers
[2023-06-01 15:45:49.539] [INFO]

【附件】

1 个赞

稍等,已转交obd相关研发同学

1 个赞

是个BUG,–oceanbase-ce.datafile_disk_percentage=90传入的时候被当做字符串处理了,没有做类型转换。

改用–oceanbase-ce.datafile-size把。

1 个赞