---
title: 使用 OCP 创建备租户报 Incorrect arguments to get primary connection-OceanBase数据库使用指南
description: 了解OceanBase数据库在实际应用中关于 使用 OCP 创建备租户报 Incorrect arguments to get primary connection相关的常见问题和使用技巧，帮助您快速解决 使用 OCP 创建备租户报 Incorrect arguments to get primary connection的难题。
---
切换语言

- 中文站 - 简体中文
- International - English
- 日本站 - 日本語

划线反馈

# 使用 OCP 创建备租户报 Incorrect arguments to get primary connection

更新时间：2025-07-04 02:41

适用版本： V4.2.x、V4.3.x 内容类型：Troubleshoot  

## 问题现象

在 OCP 上创建备租户时报 `Incorrect arguments to get primary connection`。

## 问题原因

查看报错日志发现，备租户的节点不在主租户的 IP 白名单内。

```shell
grep "YB420A2120A7-00061A72573B4871-0-0" rootservice.log.20240828214722484

```

返回结果如下：

```shell
[2024-08-28 20:40:16.351336] INFO  [SHARE] set_service_passwd_to_encrypt (ob_log_restore_struct.cpp:270) [23393][T1_L0_G0][T1][YB420A2120A7-00061A72573B4871-0-0] [lt=14] set service password success
[2024-08-28 20:40:16.369149] WDIAG [SHARE] detect_tenant_mode_ (ob_log_restore_proxy.cpp:798) [23393][T1_L0_G0][T1][YB420A2120A7-00061A72573B4871-0-0] [lt=12][errcode=0] mysql connect failed(mysql_error="Access denied", host="10.x.x.239", port=2881)
[2024-08-28 20:40:16.380394] WDIAG [SHARE] detect_tenant_mode_ (ob_log_restore_proxy.cpp:798) [23393][T1_L0_G0][T1][YB420A2120A7-00061A72573B4871-0-0] [lt=13][errcode=0] mysql connect failed(mysql_error="Access denied", host="10.x.x.155", port=2881)
[2024-08-28 20:40:16.395026] WDIAG [SHARE] detect_tenant_mode_ (ob_log_restore_proxy.cpp:798) [23393][T1_L0_G0][T1][YB420A2120A7-00061A72573B4871-0-0] [lt=8][errcode=0] mysql connect failed(mysql_error="Access denied", host="10.x.x.200", port=2881)
[2024-08-28 20:40:16.395466] WDIAG [SHARE] detect_tenant_mode_ (ob_log_restore_proxy.cpp:817) [23393][T1_L0_G0][T1][YB420A2120A7-00061A72573B4871-0-0] [lt=9][errcode=-4124] [RESTORE PROXY][DETECT_TENANT_MODE] connect to all server in tenant endpoint list failed(ret=-4124, ret="OB_CONNECT_ERROR", svr_cnt=3)
[2024-08-28 20:40:16.395834] WDIAG [SHARE] try_init (ob_log_restore_proxy.cpp:358) [23393][T1_L0_G0][T1][YB420A2120A7-00061A72573B4871-0-0] [lt=7][errcode=-4124] detect tenant mode failed(ret=-4124, ret="OB_CONNECT_ERROR", user_name=)
[2024-08-28 20:40:16.396026] WDIAG [SHARE] try_init (ob_log_restore_proxy.cpp:365) [23393][T1_L0_G0][T1][YB420A2120A7-00061A72573B4871-0-0] [lt=7][errcode=-4124] [RESTORE PROXY] proxy connect to primary db failed
[2024-08-28 20:40:16.396186] WDIAG try_init (ob_log_restore_proxy.cpp:366) [23393][T1_L0_G0][T1][YB420A2120A7-00061A72573B4871-0-0] [lt=6][errcode=-4002] Incorrect arguments to get primary connection
[2024-08-28 20:40:16.396586] WDIAG [SHARE] construct_restore_sql_proxy_ (ob_log_restore_config.cpp:279) [23393][T1_L0_G0][T1][YB420A2120A7-00061A72573B4871-0-0] [lt=5][errcode=-4002] proxy connect to primary db failed(service_attr_.addr_=["10.x.x.239:2881", "10.x.x.155:2881", "10.x.x200:2881"], user_and_tenant=STANDBYRO@saas_idaas)
[2024-08-28 20:40:16.396600] WDIAG [SHARE] check_before_update_inner_config (ob_log_restore_config.cpp:232) [23393][T1_L0_G0][T1][YB420A2120A7-00061A72573B4871-0-0] [lt=12][errcode=-4002] failed to construct restore sql proxy(ret=-4002, ret="OB_INVALID_ARGUMENT")
[2024-08-28 20:40:16.396862] WDIAG [SHARE] check_before_update_inner_config (ob_log_restore_config.cpp:216) [23393][T1_L0_G0][T1][YB420A2120A7-00061A72573B4871-0-0] [lt=3][errcode=-4002] fail to check before update inner config
[2024-08-28 20:40:16.397123] WDIAG [SHARE] update_inner_config_table (ob_backup_config.cpp:367) [23393][T1_L0_G0][T1][YB420A2120A7-00061A72573B4871-0-0] [lt=3][errcode=-4002] fail to check before update inner config(ret=-4002)
[2024-08-28 20:40:16.397334] WDIAG [RS] admin_set_backup_config (ob_root_service.cpp:10623) [23393][T1_L0_G0][T1][YB420A2120A7-00061A72573B4871-0-0] [lt=6][errcode=-4002] fail to update inner config table(ret=-4002)
[2024-08-28 20:40:16.397400] INFO  [STORAGE.TRANS] rollback_tx (ob_tx_api.cpp:339) [23393][T1_L0_G0][T1015][YB420A2120A7-00061A72573B4871-0-0] [lt=6] rollback tx(ret=0, *this={is_inited_:true, tenant_id_:1015, this:0x7f9262804030}, tx={this:0x7fa12e4b9e20, tx_id:{txid:275623}, state:7, addr:"10.x.x.167:2882", tenant_id:1015, session_id:3221715426, assoc_session_id:3221715426, xid:NULL, xa_mode:"", xa_start_addr:"0.0.0.0:0", access_mode:0, tx_consistency_type:0, isolation:1, snapshot_version:{val:18446744073709551615, v:3}, snapshot_scn:0, active_scn:1724848816349390, op_sn:3, alloc_ts:1724848816349390, active_ts:1724848816349390, commit_ts:-1, finish_ts:1724848816396859, timeout_us:9999101, lock_timeout_us:-1, expire_ts:1724848826348491, coord_id:{id:-1}, parts:[], exec_info_reap_ts:0, commit_version:{val:18446744073709551615, v:3}, commit_times:0, commit_cb:null, cluster_id:1711439072, cluster_version:17180000769, flags_.SHADOW:false, flags_.INTERRUPTED:false, flags_.BLOCK:false, flags_.REPLICA:false, can_elr:false, cflict_txs:[], abort_cause:-6002, commit_expire_ts:0, commit_task_.is_registered():false, ref:2})
[2024-08-28 20:40:16.397441] INFO  [SQL] get_cache_obj (ob_sql_stat_record.cpp:607) [23393][T1_L0_G0][T1015][YB420A2120A7-00061A72573B4871-0-0] [lt=31] sql stat record not found(ret=-5138, key={sql_id:"2805522DD41E1B57DA11967AC5FA258C", plan_hash:0, source_addr:"0.0.0.0:0"})
[2024-08-28 20:40:16.398028] WDIAG [RS] admin_set_config (ob_root_service.cpp:8403) [23393][T1_L0_G0][T1][YB420A2120A7-00061A72573B4871-0-0] [lt=8][errcode=-4002] fail to set backup config(ret=-4002, arg={items:[{name:"log_restore_source", value:"SERVICE=10.x.x.239:2881;10.x.x.155:2881;10.x.x.200:2881 USER=STANDBYRO@saas_idaas PASSWORD=xxxx", comment:"", zone:"", server:"0.0.0.0:0", tenant_name:"", exec_tenant_id:1016, tenant_ids:[], want_to_set_tenant_config:false}], is_inner:false})
[2024-08-28 20:40:16.398071] INFO  [SHARE] add_event (ob_event_history_table_operator.h:266) [23393][T1_L0_G0][T1][YB420A2120A7-00061A72573B4871-0-0] [lt=14] event table add task(ret=0, event_table_name="__all_rootservice_event_history", sql=INSERT INTO __all_rootservice_event_history (gmt_create, module, event, name1, value1, name2, value2, name3, value3, value4, value5, value6, rs_svr_ip, rs_svr_port) VALUES (usec_to_time(1724848816398042), 'root_service', 'admin_set_config', 'ret', -4002, 'arg', '{name:"log_restore_source", value:"SERVICE=10.x.x.239:2881;10.x.x.155:2881;10.x.x.200:2881 USER=STANDBYRO@saas_idaas PASSWORD=xxx", comment:"", zone:"", server:"0.0.0.0:0", tenant_name:"", exec_tenant_id:1016, tenant_ids:[], want_to_set_tenant_config:false}', 'is_inner', 0, '', '', '', '10.33.32.167', 2882))
[2024-08-28 20:40:16.398297] WDIAG [RS] process_ (ob_rs_rpc_processor.h:215) [23393][T1_L0_G0][T1][YB420A2120A7-00061A72573B4871-0-0] [lt=7][errcode=-4002] process failed(ret=-4002)
[2024-08-28 20:40:16.398303] INFO  [RS] process_ (ob_rs_rpc_processor.h:235) [23393][T1_L0_G0][T1][YB420A2120A7-00061A72573B4871-0-0] [lt=5] [DDL] execute ddl like stmt(ret=-4002, cost=48594, ddl_arg=NULL)

```

## 影响的版本

OceanBase 数据库 V4.2.x 及以上版本。

## 解决方法及规避方式

1. 在主租户下查看租户 IP 白名单。

   ```shell
   show variables like 'ob_tcp_invited_nodes';

   ```
 2. 在当前租户 IP 白名单里追加备租户节点的 IP 或者网段。

   ```shell
   set global ob_tcp_invited_nodes='${old_ip_list,new_ip_list}';  

   ```

上一篇

[OceanBase 数据库中租户参数 open_cursors 的含义](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000000639156)

下一篇

[如何规划租户资源的容量？](https://www.oceanbase.com/knowledge-base/oceanbase-database-20000001007) ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
