All Products
Search
Document Center

:Connection creation

Last Updated:Mar 12, 2024

This topic describes how to troubleshoot issues related to connectivity, parameters, and permissions when you create connections in DataWorks.

Issues about connectivity

Note
Connectivity test failures are major issues.
  • Problem description: When I create a connection to a MySQL data store whose network type is classic network, the connectivity test fails. The following error message is returned: Connection failed, data store connectivity test failed, database connection failed, database connection string: ...error message: Communications link failure. The last packet sent successfully to the server was 0 milliseconds ago. The dirver has not received any packets from the server.

    Solution: The error is usually caused by network connectivity issues. We recommend that you check whether your network is accessible, whether the firewall has limits on the specified IP address or port, and whether the security group has been configured to allow traffic for the specified IP address or port.

  • Problem description: When I create a connection to an ApsaraDB for MongoDB data store, the connectivity test fails. The following error message is returned:
    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: First, check the region where your DataWorks workspace resides. Then, check the network type of the ApsaraDB for MongoDB data store. If the network type is virtual private cloud (VPC), the ApsaraDB for MongoDB data store does not support connectivity tests in a VPC. To resolve this issue, use Method 1.

    To synchronize data from or to an ApsaraDB for MongoDB data store in a VPC, you can use one of the following methods:
    • Method 1: Synchronize data over the Internet.
      1. Create a connection to the ApsaraDB for MongoDB data store and set the connection type to Connection string mode.
      2. Enable the ApsaraDB for MongoDB data store in a VPC to access the Internet.
      3. Add relevant IP addresses to the whitelist of the ApsaraDB for MongoDB data store. For more information, see Configure an IP address whitelist.
      4. Test the connectivity of the MongoDB connection.
    • Method 2: Configure a custom resource group and synchronize data over the internal network.
      1. Create a custom resource group on an ECS instance that is in the same region and VPC as the ApsaraDB for MongoDB data store. For more information, see Create and use a custom resource group for Data Integration.
      2. Add the IP address of the ECS instance to the whitelist or security group of the ApsaraDB for MongoDB data store.
      3. Save the connection settings without testing the connectivity when you create a MongoDB connection. The ApsaraDB for MongoDB data store does not support connectivity tests in a VPC.
      4. Use the custom resource group to run a sync node for synchronizing data from or to the ApsaraDB for MongoDB data store and test the sync node.
    Note Make sure that relevant IP addresses are added to the whitelist of the corresponding data store.
  • Problem description: When I create a connection to a self-managed MongoDB data store, the connectivity test fails.
    Solution:
    1. Create a connection to the user-created MongoDB data store and set the connection type to Connection string mode.
    2. If the self-managed MongoDB data store is deployed on an ECS instance in a VPC, enable the MongoDB data store to access the Internet.
    3. Check the connectivity between the network and the specified port. Check the firewall and security group settings of the ECS instance.
    4. Check the access control, permissions, and remote logon of the self-managed MongoDB data store.
    5. Confirm that the endpoint in the host:port format, database name, and username are correct for the self-managed MongoDB data store.
      Note

      When you create a MongoDB connection, you must use the username that is created for the database where the table to be synchronized resides. Do not use root as the username.

      For example, to import the name table from the test database, enter test as the database name.

      Enter a username that is created for the specified database, instead of root. For example, use a username that is created for the test database.

  • Problem description: When I create a connection to a Redis data store in a VPC, the connectivity test fails. An error message is returned, as shown in the following figure. Error message

    Solution: If no public IP address is available, ensure that the Redis data store is in the same region as your DataWorks workspace. You can add scheduling resources to support the connectivity of the Redis connection.

  • Problem description: I create a MongoDB connection and a whitelist is configured for the MongoDB data store. However, the connectivity test still fails and the following error message is returned:
    error message: Timed out after 5000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}

    Solution: The MongoDB data store in a VPC cannot be connected to default resource groups of DataWorks on the internal network. Therefore, you cannot use default resource groups to run sync nodes for the MongoDB connection. You can enable the MongoDB data store to access the Internet or create custom resource groups to support the connectivity of the MongoDB connection.

  • Problem description: When I create a connection to a MySQL data store in a Docker container, the connectivity test fails.

    Solution: The MySQL data store in a Docker container cannot be connected by using a Java Database Connectivity (JDBC) URL that is composed of the public IP address of the server. As a result, the connectivity test fails. You must map the port of the MySQL data store to the host of the Docker container and use the mapped link of the port to connect to the MySQL data store.

  • Problem description: When I create a Redis connection, the connectivity test fails. The following error message is returned:
    error message: java.net.SocketTimeoutException: connect timed out

    Solution: DataWorks does not support creating a connection to a Redis data store by using the internal network. We recommend that you enable the Redis data store to access the Internet. When you create a Redis connection, set the connection type to Connection string mode to connect to the Redis data store by using the Internet.

  • Problem description: When I create a connection to an ApsaraDB RDS data store, the connectivity test fails.
    Solution:
    1. When the connectivity test of an RDS connection fails, you must add the IP addresses of servers involved in data synchronization to the whitelist of your ApsaraDB RDS data store. For more information, see Configure an IP address whitelist.
      Note If you use custom resource groups to run sync nodes that synchronize data from or to the ApsaraDB RDS data store, you must add the IP addresses of ECS instances where the custom resource groups are configured to the whitelist of the ApsaraDB RDS data store.
    2. When you create the RDS connection, ensure that the ID of the ApsaraDB RDS instance, the ID of the Alibaba Cloud account used to purchase the ApsaraDB RDS instance, username, password, and database name are correct.
  • Problem description: When I create a connection to a user-created MySQL data store on an ECS instance, the connectivity test fails.
    Solution:
    1. Check the connectivity between the network and the specified port. Check the firewall and security group settings of the ECS instance.
    2. Check the access control, permissions, and remote logon of the self-managed MySQL data store.
    3. Confirm that the username, password, and IP address and port number in the specified JDBC URL are correct for the user-created MySQL data store.
    4. If the ECS instance is in a VPC, you can configure sync nodes for the MySQL connection only on the codeless user interface (UI). The connectivity test of the MySQL connection also fails. In this case, you can create custom resource groups to run these sync nodes.

Parameters

  • Problem description: When I create a MySQL connection, the connectivity test fails. The following error message is returned:
    Connection failed, data store connectivity test failed, database connection failed...error message: No suitable direver found for...

    Solution: The error may be caused by an invalid format of the JDBC URL. When you enter the JDBC URL, do not add spaces or special characters to the URL. The correct format is jdbc:mysql://ServerIP:Port/Database.

  • Problem description: When I create a MongoDB connection, root is used as the username for connecting to the database. An error message is returned.

    Solution: When you create a MongoDB connection, you must use the username that is created for the database where the table to be synchronized resides. Do not use root as the username. For example, to import the name table from the test database, enter test as the database name. Enter a username that is created for the specified database, instead of root. For example, use a username that is created for the test database.

  • Problem description: When I create an RDS connection, the database cannot be connected. An error message is returned.

    Solution: Check the account ID that you enter for the RDS connection. You must enter the ID of the Alibaba Cloud account used to purchase the ApsaraDB RDS instance. Do not enter the account ID of a RAM user.

  • Problem description: When I create the default MaxCompute connection, the connectivity test fails.

    Solution: The default MaxCompute connection named odps_first is created by the system. You do not need to create it again.

  • Problem description: I want to create an AnalyticDB for PostgreSQL connection in DataWorks.

    Solution: You can select PostgreSQL to create an AnalyticDB for PostgreSQL connection.

  • Problem description: A Distributed Relational Database Service (DRDS) instance does not have a public endpoint. I want to map the internal endpoint of the DRDS instance to a custom domain name and create a DRDS connection.

    Solution: The domain name mapping method is not supported. You cannot use this method to create a DRDS connection.

  • Problem description: When I create a connection to an ApsaraDB RDS data store for which a whitelist is configured, the error message user not exist ip white list reference is still returned.

    Solution: The error occurs because the entered username is invalid. Check the username that you enter for the RDS connection.

Permissions

  • Problem description: When I create an AnalyticDB for MySQL connection, the connectivity test fails. The following error message is returned:
    Database connection failed, database connection string: ${jdbcUrl}, username: XXXXXX, error message: You don't have privilege for connecting database 'dw', userId=RAM$XXX, schemaId=XX

    Solution: Check whether the RAM user, whose AccessKey ID and AccessKey secret are entered for the AnalyticDB for MySQL connection, has the permission to access the AnalyticDB for MySQL data store.

    RAM users who can access an AnalyticDB for MySQL data store are authenticated based on the Alibaba Cloud account. You can authorize RAM users of your Alibaba Cloud account to access your AnalyticDB for MySQL data store.

  • Problem description: After a RAM user logs on to the DataWorks console, the RAM user has no permission to view or create connections. An error message is returned.

    Solution: Only RAM users who have the workspace administrator permissions can create, delete, or modify connections.