All Products
Search
Document Center

:Common issues when adding a data source

Last Updated:Jun 20, 2026

When you add a data source in DataWorks, you might encounter issues related to connectivity, parameters, or permissions.

Connectivity issues

Note

Connectivity issues typically manifest as a failed connectivity test.

  • Symptom: When you add a MySQL data source, select classic network as the network type, and click test connectivity, the test fails. The following error message is returned: Connection test failed. Failed to test the connectivity of the data source. Failed to connect to the database. Database connection string... Exception message: Communications link failure. The last packet sent successfully to the server was 0 milliseconds ago.The driver has not received any packets from the server.

    Solution: This error is usually caused by network connectivity issues. Verify network reachability and ensure your firewall and security group settings allow traffic to the IP address and port.

  • Symptom: When you add an Alibaba Cloud MongoDB data source, the connectivity test fails with the following error.

    error message: Timed out after 5000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[..] error with code: PROJECT_DATASOURCE_CONN_ERROR

    Solution: To resolve this issue, first identify the region of your DataWorks workspace. If you use an Alibaba Cloud MongoDB instance, you must identify its network type. In a VPC, DataWorks does not support connectivity tests for MongoDB data sources.

    To synchronize data from a MongoDB instance in a VPC, use one of the following options:

    • Option 1: Synchronize data over the public network

      1. When you configure the data source, select connection string mode.

      2. Enable public network access for your MongoDB instance in the VPC.

      3. Add the required IP addresses to the allowlist of your MongoDB instance. For more information, see Add an allowlist.

      4. Run a connectivity test.

    • Option 2: Configure a custom resource group to synchronize data over an internal network

      1. Prepare an ECS instance to use as a scheduling resource. The instance must be in the same region and network as the MongoDB instance. For more information, see Create and use a custom Data Integration resource group.

      2. Add the IP address of this ECS instance to the allowlist or security group of the MongoDB instance.

      3. Save the data source directly without testing its connectivity. Connectivity tests are not supported in this scenario.

      4. Change the resource group to the custom scheduling resource and run a test.

    Note

    Add the required allowlist entries.

  • Symptom: When you add a self-managed MongoDB data source, the connectivity test fails.

    Solution:

    1. When you configure the data source, select connection string mode.

    2. If you are using a self-managed MongoDB database on an ECS instance in a VPC, enable public network access.

    3. Verify network connectivity to the port. Check the firewall and security group settings of the ECS instance.

    4. Check the security access restrictions, permission settings, and remote logon configurations for your self-managed database.

    5. Verify that the access address (host:port), database name, and username are correct.

      Note

      When adding a MongoDB data source, the username must be an account created in the specific database that you want to access.

      For example, if you want to import the name table from the test database, set the Database Name parameter to test.

      For example, if you specified the test database, you must use an account created in the test database.

  • Symptom: When you add a Redis data source in a VPC, the connectivity test fails with the following error: Failed to test data source connectivity. error message: java.net.SocketTimeoutException: connect timed out.

    Solution: If your Redis instance does not have a public IP address, you must ensure that the data source and the DataWorks workspace are in the same region. Then, you can add a scheduling resource to establish connectivity.

  • Symptom: You configured an allowlist for your MongoDB data source, but the connectivity test still fails with the following error.

    error message: Timed out after 5000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}

    Solution: In a VPC, the MongoDB data source and the default resource group of DataWorks are not connected over the internal network, so you cannot run synchronization tasks directly. You must establish connectivity over the public network or by using a custom resource group.

  • Symptom: Cannot add a MySQL instance in Docker as a data source.

    Solution: You cannot connect to a MySQL instance in Docker by using a JDBC URL with the server's public IP address. To establish a connection, you must map the MySQL port to the host machine and use the mapped port.

  • Symptom: Failed to configure a Redis data source. The connectivity test fails with the following error.

    error message: java.net.SocketTimeoutException: connect timed out

    Solution: DataWorks does not support adding Redis data sources over an internal network. To connect, enable public network access for your Redis instance and select connection string mode during configuration.

  • Symptom: When you add an Alibaba Cloud RDS data source, the connectivity test fails.

    Solution:

    1. If the connectivity test for an RDS data source fails, add the IP addresses of the data integration machines to the allowlist of your RDS instance. For more information, see Add an allowlist.

      Note

      If you use a custom resource group for RDS data synchronization, also add the IP addresses of the resource group's machines to the RDS allowlist.

    2. Ensure that you have entered the correct information, including the RDS instance ID, the UID of the primary account that owns the RDS instance, username, password, and database name.

  • Symptom: When you add a self-managed MySQL data source on an ECS instance, the connectivity test fails.

    Solution:

    1. Verify network connectivity to the port. Check the firewall and security group settings of the ECS instance.

    2. Check the security access restrictions, permission settings, and remote logon configurations for your self-managed database.

    3. Verify that the username, password, and the IP address and port in the JDBC URL are correct.

    4. If you purchased an ECS instance in a VPC, you can run tasks only in script mode. In this case, the connectivity test cannot succeed when you add a data source. Instead, add a custom resource and run the synchronization task on that resource group.

Parameter issues

  • Symptom: When you add a MySQL data source and click test connectivity, the following error is reported.

    Connection test failed. Failed to test the connectivity of the data source. Failed to connect to the database... Exception message: No suitable driver found for...

    Solution: This error can occur if the JDBC URL is in an incorrect format. When you enter the JDBC URL, do not add spaces or special characters. The correct format is jdbc:mysql://ServerIP:Port/Database.

  • Symptom: An error occurs when you add a MongoDB data source with the username root.

    Solution: Do not use the root user. The username must be an account created in the specific database that you intend to access. For example, if you want to import the name table from the test database, set the Database Name parameter to test. The username must then be an account created in the test database.

  • Symptom: Failed to add an RDS data source. When you add the data source and click test connectivity, the error Failed to test data source connectivity: Failed to connect to the database is reported with the exception message "An exception occurred while retrieving instance details. Check the purchaser ID and instance name of the RDS instance."

    Solution: This error occurs if the entered UID belongs to a RAM user. You must enter the UID of the primary account that owns the RDS instance.

  • Symptom: The connectivity test fails when you add the default MaxCompute data source.

    Solution: The data source feature has been updated. You must manually create a MaxCompute data source. For more information, see Bind MaxCompute compute resources.

  • Symptom: Uncertainty about adding HybridDB for PostgreSQL as a data source.

    Solution: Yes. When you add the data source, select PostgreSQL under relational databases.

  • Symptom: Cannot use a custom domain name to map a DRDS instance's internal endpoint.

    Solution: No. You must strictly follow the required format. Domain name mapping is not currently supported.

  • Symptom: The error user not exist ip white list reference is reported when adding an RDS data source, despite a configured allowlist.

    Solution: This error indicates an incorrect username. Verify the username.

Permission issues

  • Symptom: When you test the connectivity of an AnalyticDB for MySQL data source, the following error is reported.

    Failed to connect to the database. Database connection string: ${jdbcUrl}, Username: XXXXXX, Exception message: You don't have privilege for connecting database 'dw', userId=RAM$XXX, schemaId=XX

    Solution: This error indicates the specified RAM user lacks the required permissions to access AnalyticDB for MySQL.

    AnalyticDB for MySQL authenticates users by using Alibaba Cloud accounts. Databases created by a user belong to that user, and the user can grant other users access to tables in those databases. Therefore, you must grant permissions to the account used to connect to AnalyticDB for MySQL.

  • Symptom: A RAM user lacks permission to view or create data sources, which triggers the message You do not have the permissions to perform this operation.

    Solution: Only RAM users with project administrator permissions can add, delete, or modify data sources.