Symptom
After the application is started for a period, web ODC remains inaccessible.
Possible causes
| Error message | Common cause |
|---|---|
| The application fails to start because the application fails to connect to the MetaDB. |
|
| Data migration fails during an upgrade. | The admin account name conflicts with an existing one during the upgrade from a version earlier than ODC V3.2.0. |
| ODC cannot be accessed due to incorrect network settings of the Docker container in the host in containerized deployment scenarios. | The Docker container enables network parameters to configure port mapping, but DNS addressing within the Docker container fails. |
Solutions
Query the ODC log odc.log.
Failure to connect to the MetaDB
The ODC MetaDB information specified in the startup parameters may be incorrect. The endpoint, account, or password of the MetaDB may be incorrect.
Check for the specific cause in the ODC log. Generally, if the startup failure is caused by incorrect MetaDB information, the ODC log contains the following keyword: Could not connect to address.

In this case, check the MetaDB information items in the startup parameters one by one. We recommend that you use the OBClient to perform a connection test in the ODC deployment environment to ensure that the MetaDB connection information is correct.
Tips for docker run parameters
When you use docker run to start odc-server docker, use the -e option to set the environment variable. You can directly reference the environment variable value in docker run by using the export command, or you can directly set the variable in the docker run -e parameter list. 1.web-odc-cannot-be-accessed-after-startup1.web-odc-cannot-be-accessed-after-startup
We recommend that you reference the environment variable value in docker run by using the export command for the following reasons:
A password usually contains special characters, such as the $$ symbol, which will be parsed as a process number in the shell and cause a semantic error. If you reference the variable value in
docker run, the issue is avoided.No one can show the MetaDB connection information by running the
pscommand on the host.
The following example shows how to use the export command to directly reference the environment variable in docker run.
# Create metadb and configure the startup parameters.
export DATABASE_HOST=***
export DATABASE_PORT=***
export DATABASE_NAME=***
export DATABASE_USERNAME=***
export DATABASE_PASSWORD=***
# Start the Docker container of the ODC server
ODC_DOCKER_NAME="odc-server" &&
MEMORY_LIMIT=8G &&
docker run -d -it --name ${ODC_DOCKER_NAME} --network host \
--cpu-period 100000 --cpu-quota 400000 --memory=${MEMORY_LIMIT} \
-e PROFILE_MODE -e DATABASE_HOST -e DATABASE_PORT -e DATABASE_NAME \
-e DATABASE_USERNAME -e DATABASE_PASSWORD \
${ODC_DOCKER_IMAGE_ID}
Data migration failure during upgrade
Admin account name conflict during the upgrade from a version earlier than ODC V3.2.0
To avoid account conflicts, ODC performs a precheck when it starts. If a built-in account name conflicts with another, you must rename the account that conflicts with the one of an earlier version.
View
odc.logto locate the specific error. The log keyword can be:Failed to migrate users
Renamed account name conflicts
Failed to migrate odc users
Duplicated account name

Query for the path of the
rename.propertiesfile generated by ODC in the log. You can use this file to rename an admin user.[2022-03-23 20:15:31.837][main][,,][ERROR][com.alipay.odc.metadb.alipay.V3202BuiltInResourceMigrate][103]: Failed to migrate odc users, the reason is that the account name and the reserved account have the same name, reservedAccountNames=admin, renameFile=/Users/yh263208/oceanbase/odc/ob-odc/app/odc-web-starter/target/classes/static/tmp/rename.propertiesView the content of the
rename.propertiesfile.#Please enter the rename of the conflicting account name here #Wed Mar 23 20:15:31 CST 2022 admin=Enter the new account name after the conflicting name, and then restart the ODC application.
MetaDB data migration error during upgrade
If the data migration failure is not caused by a built-in account name conflict, analyze the migration history and logs.
Connect to the ODC MetaDB and determine whether the upgrade of the application is successful.
The migrate_schema_history table of the ODC MetaDB records the upgrade history of the application. You can check the latest record and see whether the value of
successis1. If the value is1, the application is successfully upgraded. Otherwise, the upgrade failed.Here is the sample statement:
-- Perform an aggregate query based on the version number and execution script. The number of original records may be large due to repeated attempts to re-run failed scripts. select version, script, success, max(install_rank) as install_rank from migrate_schema_history group by version, script, success order by install_rank desc;Check the log for the specific cause of the upgrade failure based on the error message in
odc.log.
Incorrect Docker network settings
If you use Docker to deploy the ODC application, check whether the network settings of the Docker container are correct. ODC can be deployed in two network modes:
The host mode. This deployment mode uses the network settings of the host. You do not need to configure the network.
The network port mapping mode. In this mode, the network port provides network communication for ODC.