# Error codes

This topic summarizes the errors that may occur during the use of OBD.

## General errors

### OBD-1000: Configuration conflict x.x.x.x: xxx port is used for x.x.x.x

Cause: Port conflicts occur in the configuration file.

Solution: Check and modify the configuration.

### OBD-1001: x.x.x.x:xxx port is already used

Cause: The port has been occupied.

Solution: Check the configuration and change the port.

### OBD-1002: Fail to init x.x.x.x path

Cause:

1. `user` in the configuration file (the current user by default, if unspecified) does not have the write permission on the corresponding directory.
  
2. home_path is not empty.

You can determine the cause based on the error information.

Solution:

For case 1, you can resolve the problem in two ways.

- Run the following command to add or modify `user` information:
  
  ```shell
  obd cluster edit-config <deploy name>
  ```

- Log on to the target server and grant the current account the write permission on the corresponding directory.

For case 2, you can also resolve the problem in two ways.

- Select another directory.
  
- If you are sure that the current directory can be cleared, you can use the `-f` option. OBD will clear this directory by using the current user.

### OBD-1003: fail to clean x.x.x.x:xxx

Cause: `user` in the configuration file (the current user by default, if unspecified) does not have the write permission on the home_path directory.

Solution: You can resolve the problem in two ways.

- Run the following command to add or modify `user` information:
  
  ```shell
  obd cluster edit-config <deploy name>
  ```

- Log on to the target server and grant the current account the write permission on the corresponding directory.

### OBD-1004: Configuration conflict x.x.x.x: xxx is used for x.x.x.x

Cause: Path conflicts occur in the configuration file.

Solution: Check and modify the configuration.

### OBD-1005: Some of the servers in the cluster have been stopped

Cause: Some servers in the current configuration have been stopped, but subsequent operations require the services of all servers to be online.

Solution: Run the `obd cluster start <deploy_name> --wop` command to start all services without loading parameters.

### OBD-1006: Failed to connect to xxx

Cause:

1. OceanBase Deployer (OBD) and the specified server are disconnected.

2. The corresponding component process has exited or does not provide service.

3. The account and password do not match.

Solution:

If the error is due to cause 1, you need to solve the network connection issue.

If the error is due to cause 2, you can try restarting the component first. If the startup still fails, please refer to the error of startup failure for troubleshooting, such as **OBD-2002**.

If the error is due to cause 3, it is likely that you have changed the password by executing SQL statements, and the account password is different from that stored in the configuration file. As a result, OBD cannot connect to the component. In this case, you can use any of the following two solutions:

1. Execute SQL statements to change the password back to that stored in the configuration file of OBD.

2. Run the `vi ~/.obd/cluster/<deploy name>/config.yaml` command to change the password to the one that is in use for the component.

### OBD-1007: (x.x.x.x) xxx must not be less than xxx (Current value: xxx)

Cause: The configuration of the ulimit parameter does not meet the requirements.

Solution: You can modify the corresponding files in the /etc/security/limits.d/ directory and the limits.conf file in the /etc/security/ directory as needed.

## OceanBase deployment errors

### OBD-2000: x.x.x.x not enough memory

Cause: The memory is insufficient.

Solution: When OBD starts, the memory is strictly calculated based on MemAvailable. If any cached memory can be released, run the following command:

```shell
echo 3 > /proc/sys/vm/drop_caches
```

If the memory is still insufficient, run `edit-config` and then adjust `memory_limt` and `system_memory`. Ensure that the following condition is met: `memory_limt/3 ≤ system_memory ≤ memory_limt/2`.

> **Note**
>
> `memory_limt` cannot be lower than 8 GB. In other words, your available memory must be greater than 8 GB.

### OBD-2001: server can not migrate in

Cause: The number of available units is smaller than `--unit-num`.

Solution: Modify the passed value of `--unit-num`. Run the following command to view the number of available units:

```sql
select count(*) num from oceanbase.__all_server where status = 'active' and start_service_time > 0
```

### OBD-2002: failed to start x.x.x.x observer

Cause: There are multiple causes for this error. Two most common causes are as follows.

- `memory_limit` is lower than 8 GB.

- `system_memory` is too large or small. Generally, the following condition must be met: `memory_limt/3 ≤ system_memory ≤ memory_limt/2`.

Solution:

- If the problem is caused by either of the preceding reasons, take actions accordingly.

- If the problem persists, submit an issue on GitHub (<https://github.com/oceanbase/obdeploy/issues>), and designated professionals will help you fix the issue.

### OBD-2003: not enough disk space for clog. Use redo_dir to set other disk for clog, or reduce the value of datafile_size

Cause: The disk usage exceeds the limit.

Solution: Adjust the storage of disks.

- For automatic deployment, the disk usage cannot exceed 72%.
  
- For manual deployment, the disk usage cannot exceed 64%, if the configuration is not modified.

> **Note**
>
> If redo_dir and data_dir are on the same disk, the space to be occupied by data files is included when the disk usage is calculated.

### OBD-2004: Invalid: xxx is not a single server configuration item

Cause: The modified parameter is a global one and cannot be separately modified for a single server.

Solution: Place the parameter to modify under global.

## Test errors

### OBD-3000: parse cmd failed

Cause: The mysqltest initialization file is not an `.sql` file.

Solution: Check the `--init-sql-files` parameter.

### OBD-3001: xxx.sql not found

Cause: The initialization file cannot be found during the initialization of mysqltest.

Solution: Check whether the file declared by `--init-sql-files` is located under the `--init-sql-dir` directory.

### OBD-3002: Failed to load data

Cause: There are multiple causes for this error. Two most common causes are as follows.

1. The tenant has insufficient resources or is under excessive test stress.

2. An error occurred in the data build script.

Solution:

If the error is due to cause 1, you can use a tenant with larger resource specifications or adjust parameters such as warehouses and load-workers to reduce the test stress.

If the error is due to cause 2, you can rerun the test because the data build script is obtained from the TPC official website. If the issue persists, submit an issue on GitHub (<https://github.com/oceanbase/obdeploy/issues>), and designated professionals will help you fix the issue.

### OBD-3003: Failed to run TPC-C benchmark

Cause:

1. The test process was stuck and then terminated due to timeout.

2. An error occurred for the TPC-C test command.

Solution:

- You can try to rerun the test directly, or you can adjust parameters such as terminals to reduce the test pressure before you rerun the test.

- If you did not use the obtpcc package provided on the OceanBase Database official website, use obtpcc for testing.

If the issue persists, submit an issue on GitHub (<https://github.com/oceanbase/obdeploy/issues>), and designated professionals will help you fix the issue.

## OBAgent errors

### OBD-4000: Fail to reload x.x.x.x

Cause: The `http_basic_auth_password` of the node is not the same as that stored in OBD, which causes OBD to fail to access OBAgent.

Solution: If the two passwords are the same, check whether an unsupported parameter is included among the modified options, or whether the name of a parameter is incorrect.

### OBD-4001: Fail to send config file to x.x.x.x

Cause: (Check whether the error is caused by either of the reasons.)

- The disk space for the home_path directory on OBAgent is insufficient.

- `user` in the configuration file (the current user by default, if unspecified) does not have the write permission on the home_path directory on OBAgent.

Solution: You can resolve the problem in two ways.

- Run the following command to add or modify `user` information:
  
  ```shell
  obd cluster edit-config <deploy name>
  ```

- Log on to the target server and grant the current account the write permission on the corresponding directory.
