OBD部署主备租户失败

【 使用环境 】测试环境
【 OB or 其他组件 】OBD、observer社区版
【 使用版本 】OBD2.9.2,单机部署
【问题描述】 obd 部署备租户失败,出现[ERROR] oceanbase-ce-py_script_create_standby_tenant_pre-4.2.0.0 RuntimeError: ‘NoneType’ object has no attribute ‘fetchone’
【复现路径】存在集群test和testbak,集群test存在租户primary_tenant,使用obd cluster tenant create-standby testbak test primary_tenant -t standby_tenant --tenant-root-password=*#^123456^#*在testbak上部署primary_tenant的备租户standby_tenant失败,出现[ERROR] oceanbase-ce-py_script_create_standby_tenant_pre-4.2.0.0 RuntimeError: ‘NoneType’ object has no attribute ‘fetchone’
【附件及日志】
[2024-09-19 11:16:06.693] [DEBUG] - cmd: [‘testbak’, ‘test’, ‘primary_tenant’]
[2024-09-19 11:16:06.693] [DEBUG] - opts: {‘tenant_name’: ‘standby_tenant’, ‘max_cpu’: None, ‘min_cpu’: None, ‘max_memory’: None, ‘min_memory’: None, ‘memory_size’: None, ‘max_disk_size’: None, 'log_d}
[2024-09-19 11:16:06.694] [DEBUG] - mkdir /root/.obd/lock/
[2024-09-19 11:16:06.694] [DEBUG] - unknown lock mode
[2024-09-19 11:16:06.694] [DEBUG] - try to get share lock /root/.obd/lock/global
[2024-09-19 11:16:06.694] [DEBUG] - share lock /root/.obd/lock/global, count 1
[2024-09-19 11:16:06.694] [DEBUG] - mkdir /root/.obd/cluster/
[2024-09-19 11:16:06.694] [DEBUG] - mkdir /root/.obd/config_parser/
[2024-09-19 11:16:06.695] [DEBUG] - try to get exclusive lock /root/.obd/lock/deploy_testbak
[2024-09-19 11:16:06.695] [DEBUG] - exclusive lock /root/.obd/lock/deploy_testbak, count 1
[2024-09-19 11:16:06.695] [DEBUG] - try to get exclusive lock /root/.obd/lock/deploy_test
[2024-09-19 11:16:06.695] [DEBUG] - exclusive lock /root/.obd/lock/deploy_test, count 1
[2024-09-19 11:16:06.702] [DEBUG] - mkdir /root/.obd/repository
[2024-09-19 11:16:06.702] [DEBUG] - Get local repository oceanbase-ce-4.2.1.8-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:16:06.702] [DEBUG] - try to get share lock /root/.obd/lock/mirror_and_repo
[2024-09-19 11:16:06.702] [DEBUG] - share lock /root/.obd/lock/mirror_and_repo, count 1
[2024-09-19 11:16:06.704] [DEBUG] - Get local repository oceanbase-ce-4.2.1.8-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:16:06.704] [DEBUG] - Searching standby_version_check plugin for components …
[2024-09-19 11:16:06.704] [DEBUG] - Searching standby_version_check plugin for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:16:06.705] [DEBUG] - mkdir /root/.obd/plugins
[2024-09-19 11:16:06.705] [DEBUG] - Found for oceanbase-ce-py_script_standby_version_check-4.2.0.0 for oceanbase-ce-4.2.1.8
[2024-09-19 11:16:06.714] [INFO] Open ssh connection
[2024-09-19 11:16:06.719] [DEBUG] - host: 172.16.4.30, port: 22, user: root, password: 123456
[2024-09-19 11:16:07.008] [DEBUG] - Call oceanbase-ce-py_script_standby_version_check-4.2.0.0 for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:16:07.009] [DEBUG] - import standby_version_check
[2024-09-19 11:16:07.011] [DEBUG] - add standby_version_check ref count to 1
[2024-09-19 11:16:07.011] [DEBUG] - sub standby_version_check ref count to 0
[2024-09-19 11:16:07.011] [DEBUG] - export standby_version_check
[2024-09-19 11:16:07.012] [DEBUG] - plugin oceanbase-ce-py_script_standby_version_check-4.2.0.0 result: True
[2024-09-19 11:16:07.012] [INFO] Cluster status check
[2024-09-19 11:16:07.015] [DEBUG] - Searching status plugin for components …
[2024-09-19 11:16:07.015] [DEBUG] - Searching status plugin for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:16:07.017] [DEBUG] - Found for oceanbase-ce-py_script_status-3.1.0 for oceanbase-ce-4.2.1.8
[2024-09-19 11:16:07.017] [DEBUG] - Call oceanbase-ce-py_script_status-3.1.0 for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:16:07.018] [DEBUG] - import status
[2024-09-19 11:16:07.019] [DEBUG] - add status ref count to 1
[2024-09-19 11:16:07.020] [DEBUG] – root@172.16.4.30 execute: cat /root/testbak/run/observer.pid
[2024-09-19 11:16:07.038] [DEBUG] – exited code 0
[2024-09-19 11:16:07.039] [DEBUG] – root@172.16.4.30 execute: ls /proc/24797
[2024-09-19 11:16:07.115] [DEBUG] – exited code 0
[2024-09-19 11:16:07.116] [DEBUG] - sub status ref count to 0
[2024-09-19 11:16:07.116] [DEBUG] - export status
[2024-09-19 11:16:07.117] [DEBUG] - plugin oceanbase-ce-py_script_status-3.1.0 result: True
[2024-09-19 11:16:07.145] [DEBUG] - Searching create_standby_tenant_pre plugin for components …
[2024-09-19 11:16:07.145] [DEBUG] - Searching create_standby_tenant_pre plugin for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:16:07.147] [DEBUG] - Found for oceanbase-ce-py_script_create_standby_tenant_pre-4.2.0.0 for oceanbase-ce-4.2.1.8
[2024-09-19 11:16:07.147] [DEBUG] - Searching connect plugin for components …
[2024-09-19 11:16:07.148] [DEBUG] - Searching connect plugin for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:16:07.150] [DEBUG] - Found for oceanbase-ce-py_script_connect-4.2.1.4 for oceanbase-ce-4.2.1.8
[2024-09-19 11:16:07.150] [DEBUG] - Searching get_relation_tenants plugin for components …
[2024-09-19 11:16:07.150] [DEBUG] - Searching get_relation_tenants plugin for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:16:07.152] [DEBUG] - Found for oceanbase-ce-py_script_get_relation_tenants-4.2.0.0 for oceanbase-ce-4.2.1.8
[2024-09-19 11:16:07.152] [DEBUG] - Searching create_tenant plugin for components …
[2024-09-19 11:16:07.153] [DEBUG] - Searching create_tenant plugin for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:16:07.155] [DEBUG] - Found for oceanbase-ce-py_script_create_tenant-4.2.0.0 for oceanbase-ce-4.2.1.8
[2024-09-19 11:16:07.155] [DEBUG] - Searching get_deployment_connections plugin for components …
[2024-09-19 11:16:07.155] [DEBUG] - Searching get_deployment_connections plugin for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:16:07.157] [DEBUG] - Found for oceanbase-ce-py_script_get_deployment_connections-4.2.0.0 for oceanbase-ce-4.2.1.8
[2024-09-19 11:16:07.157] [DEBUG] - Call oceanbase-ce-py_script_get_relation_tenants-4.2.0.0 for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:16:07.157] [DEBUG] - import get_relation_tenants
[2024-09-19 11:16:07.160] [DEBUG] - add get_relation_tenants ref count to 1
[2024-09-19 11:16:07.160] [DEBUG] - exclusive lock /root/.obd/lock/deploy_test, count 2
[2024-09-19 11:16:07.184] [DEBUG] - sub get_relation_tenants ref count to 0
[2024-09-19 11:16:07.184] [DEBUG] - export get_relation_tenants
[2024-09-19 11:16:07.184] [DEBUG] - plugin oceanbase-ce-py_script_get_relation_tenants-4.2.0.0 result: True
[2024-09-19 11:16:07.184] [DEBUG] - Call oceanbase-ce-py_script_get_deployment_connections-4.2.0.0 for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:16:07.185] [DEBUG] - import get_deployment_connections
[2024-09-19 11:16:07.185] [DEBUG] - add get_deployment_connections ref count to 1
[2024-09-19 11:16:07.186] [INFO] Get deployment connections
[2024-09-19 11:16:13.324] [DEBUG] - sub get_deployment_connections ref count to 0
[2024-09-19 11:16:13.325] [DEBUG] - export get_deployment_connections
[2024-09-19 11:16:13.325] [DEBUG] - plugin oceanbase-ce-py_script_get_deployment_connections-4.2.0.0 result: True
[2024-09-19 11:16:13.325] [DEBUG] - Call oceanbase-ce-py_script_create_standby_tenant_pre-4.2.0.0 for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:16:13.326] [DEBUG] - import create_standby_tenant_pre
[2024-09-19 11:16:13.331] [DEBUG] - add create_standby_tenant_pre ref count to 1
[2024-09-19 11:16:13.333] [INFO] Check primary tenant
[2024-09-19 11:16:13.338] [ERROR] oceanbase-ce-py_script_create_standby_tenant_pre-4.2.0.0 RuntimeError: ‘NoneType’ object has no attribute ‘fetchone’
[2024-09-19 11:16:13.338] [ERROR] Traceback (most recent call last):
[2024-09-19 11:16:13.338] [ERROR] File “core.py”, line 2305, in create_standby_tenant
[2024-09-19 11:16:13.338] [ERROR] File “core.py”, line 197, in call_plugin
[2024-09-19 11:16:13.339] [ERROR] File “_plugin.py”, line 348, in call
[2024-09-19 11:16:13.339] [ERROR] File “_plugin.py”, line 305, in _new_func
[2024-09-19 11:16:13.339] [ERROR] File “/root/.obd/plugins/oceanbase-ce/4.2.0.0/create_standby_tenant_pre.py”, line 116, in create_standby_tenant_pre
[2024-09-19 11:16:13.339] [ERROR] primary_tenant_info = primary_cursor.fetchone(sql, (primary_tenant, ))
[2024-09-19 11:16:13.339] [ERROR] AttributeError: ‘NoneType’ object has no attribute ‘fetchone’
[2024-09-19 11:16:13.339] [ERROR]
[2024-09-19 11:16:13.339] [DEBUG] - sub create_standby_tenant_pre ref count to 0
[2024-09-19 11:16:13.340] [DEBUG] - export create_standby_tenant_pre
[2024-09-19 11:16:13.340] [DEBUG] - plugin oceanbase-ce-py_script_create_standby_tenant_pre-4.2.0.0 result: False
[2024-09-19 11:16:13.340] [INFO] See https://www.oceanbase.com/product/ob-deployer/error-codes .
[2024-09-19 11:16:13.340] [INFO] Trace ID: 90a90f36-7678-11ef-a45f-509a4c0e6ea6
[2024-09-19 11:16:13.340] [INFO] If you want to view detailed obd logs, please run: obd display-trace 90a90f36-7678-11ef-a45f-509a4c0e6ea6
[2024-09-19 11:16:13.466] [INFO] [ERROR] oceanbase-ce-py_script_create_standby_tenant_pre-4.2.0.0 RuntimeError: ‘NoneType’ object has no attribute ‘fetchone’
[2024-09-19 11:16:13.467] [INFO] See https://www.oceanbase.com/product/ob-deployer/error-codes .
[2024-09-19 11:16:13.467] [INFO] Trace ID: 90a90f36-7678-11ef-a45f-509a4c0e6ea6
[2024-09-19 11:16:13.467] [INFO] If you want to view detailed obd logs, please run: obd display-trace 90a90f36-7678-11ef-a45f-509a4c0e6ea6
[2024-09-19 11:16:13.467] [INFO]
[2024-09-19 11:16:13.468] [DEBUG] - unlock /root/.obd/lock/global
[2024-09-19 11:16:13.468] [DEBUG] - unlock /root/.obd/lock/deploy_testbak
[2024-09-19 11:16:13.469] [DEBUG] - unlock /root/.obd/lock/deploy_test
[2024-09-19 11:16:13.469] [DEBUG] - unlock /root/.obd/lock/mirror_and_repo

两套集群都是在一个obd下运维创建的么

是的
[root@localhost lock]# obd cluster list
±-------------------------------------------------------------+
| Cluster List |
±-----------±------------------------------±----------------+
| Name | Configuration Path | Status (Cached) |
±-----------±------------------------------±----------------+
| test | /root/.obd/cluster/test | running |
| testbak | /root/.obd/cluster/testbak | running |
±-----------±------------------------------±----------------+

https://www.oceanbase.com/docs/community-obd-cn-1000000000955409
请问是参考这篇文档搭建的么,如果不是可以参考一下这篇

是参考的这个文档

看另一个帖显示目前搭建已经没问题,切换有问题,在那个帖子讨论吧,可以附上执行切换操作时候两边的ob日志