obdiag config 执行异常

【 使用环境 】生产环境
【 OB or 其他组件 】
【 使用版本 】obeanbase版本4.3.2,OceanBase Diagnostic Tool: 2.5.0
【问题描述】执行obdiag config异常
【复现路径】
执行命令

obdiag config -h 10.1.250.157 -uroot@neo_dev  -p'DevOps00!@#' -P2881

异常信息

[ERROR] command failed. Please contact OceanBase community. e: (1146, "Table 'oceanbase.dba_ob_servers' doesn't exist")
Trace ID: d5e15b02-a716-11ef-b63e-246e9612af44
If you want to view detailed obdiag logs, please run: obdiag display-trace d5e15b02-a716-11ef-b63e-246e9612af44
[root@dev4 ~]# obdiag display-trace d5e15b02-a716-11ef-b63e-246e9612af44
[2024-11-20 16:09:59.121] [DEBUG] - cmd: obdiag config
[2024-11-20 16:09:59.122] [DEBUG] - opts: {'inner_config': None, 'h': '10.1.250.157', 'u': 'root@neo_dev', 'p': 'DevOps00!@#', 'P': '2881'}
[2024-11-20 16:09:59.122] [DEBUG] - mkdir /usr/local/oceanbase-diagnostic-tool/conf/inner_config.yml
[2024-11-20 16:09:59.126] [DEBUG] - mkdir /root/.obdiag/config.yml
[2024-11-20 16:09:59.130] [DEBUG] - Getting all the node information of the cluster, please wait a moment ...
[2024-11-20 16:09:59.130] [DEBUG] - get observer version, by sql
[2024-11-20 16:09:59.130] [DEBUG] - start get_observer_version_by_sql . input: 10.1.250.157:2881
[2024-11-20 16:09:59.132] [DEBUG] - connect databse ...
[2024-11-20 16:09:59.133] [DEBUG] - get_observer_version_by_sql ob_version_info is ('5.7.25-OceanBase_CE-v4.3.4.0',)
[2024-11-20 16:09:59.135] [DEBUG] - connect databse ...
[2024-11-20 16:09:59.137] [ERROR] command failed. Please contact OceanBase community. e: (1146, "Table 'oceanbase.dba_ob_servers' doesn't exist")
[2024-11-20 16:09:59.137] [INFO] Trace ID: d5e15b02-a716-11ef-b63e-246e9612af44
[2024-11-20 16:09:59.137] [INFO] If you want to view detailed obdiag logs, please run: obdiag display-trace d5e15b02-a716-11ef-b63e-246e9612af44

麻烦帮忙看下, 谢谢

使用root@sys

https://www.oceanbase.com/docs/common-obdiag-cn-1000000001491138

obdiag config -h 10.1.250.157 -uroot@neo_dev  -p'DevOps00!@#' -P2881

地址,用户都是对的,但是就是异常,信息如下:

[ERROR] command failed. Please contact OceanBase community. e: (1146, "Table 'oceanbase.dba_ob_servers' doesn't exist")

root@neo_dev 这个 换成 root@sys

成功了,非常感谢,点赞

再请假个问题,

obdiag gather scene run --scene=observer.perf_sql --env "{ -Dsmall_oa_169', trace_id='E3E17471B60C1CDC709270A90AFE4FB9'}"

我执行这个以后,提示

ather_scenes_run start ...
gather from_time: 2024-11-20 16:31:10, to_time: 2024-11-20 17:02:10
execute tasks: observer.base
run scene excute yaml mode in node: 10.1.250.157 start
run scene excute yaml mode in node: 10.1.250.157 end
run scene excute yaml mode in node: 10.1.250.160 start
run scene excute yaml mode in node: 10.1.250.160 end
run scene excute yaml mode in node: 10.1.250.161 start
run scene excute yaml mode in node: 10.1.250.161 end
[ERROR] hard code scene execute failed, error :expected string or bytes-like object

Gather scene results stored in this directory: /root/obdiag_gather_pack_20241120165900/obdiag_gather_pack_20241120170110

Trace ID: fc7a0780-a71d-11ef-b074-246e9612af44
If you want to view detailed obdiag logs, please run: obdiag display-trace fc7a0780-a71d-11ef-b074-246e9612af44

[ERROR] hard code scene execute failed, error :expected string or bytes-like object
这个错误是怎么导致的,我应该如何解决

这里格式不对,你参考下
https://www.oceanbase.com/docs/common-obdiag-cn-1000000001491226

image

 obdiag gather scene run --scene=observer.perf_sql --env "{db_connect='-h10.1.250.157 -P2881 -u root@neo_dev -p 'DevOps00!@#' -Dsmall_oa_169', trace_id='E3E17471B60C1CDC709270A90AFE4FB9'}"

提示
-bash: !@#’: event not found

密码有特殊 如何处理

使用双引号试下呢

不行 还是提示-bash: !@#": event not found

obdiag gather scene run --scene=observer.perf_sql --env "{db_connect='-h10.1.250.157 -P2881 -u root@neo_dev -p"DevOps00!@#" -Dsmall_oa_169', trace_id='E3E17471B60C1CDC709270A90AFE4FB9'}"

收到反馈。 你遇到的问题是因为 Bash 解释器对感叹号 ! 进行了历史扩展。Bash 中的 ! 是用来引用之前输入的命令的,因此当你在命令行中直接使用包含 ! 的字符串时,Bash 会尝试解析它,导致错误。

我记录下这个需求了,obdiag 预计这个月月底发布的版本会带上。现在如果方便的话,增加一个正常密码的用户可以绕过(或者改一下密码)

好的 谢谢 点赞


qi请教个问题 traceid 怎么去获取,文档没看懂, 谢谢

从gv$ob_sql_audit中获取或者通过SELECT last_trace_id();获取。两种方式任选其一

  1. 通过sql_audit中获取,比如
select query_sql,trace_id from oceanbase.GV$OB_SQL_AUDIT where query_sql like 'xxx%' order by REQUEST_TIME desc limit 5;
  1. 通过当前session执行SELECT last_trace_id();获取
SELECT last_trace_id();

有疑问,看来我们的文档还需要完善 :grinning:

1、set ob_enable_show_trace=1;
2、执行sql语句
3、select last_trace_id();获取trace_id
还有就是通过查询gv$ob_sql_audit视图