Skip to content

Error while creating Glue Connection: Request to connector timed out after 45 seconds when validating credential

0

I am getting a timeout error while creating an AWS Glue Connection for my rds instance-mysql.

  • My RDS instance is in public subnet. I am creating the glue ENI in the same subnet. I have verified the network communication with the help of "reachability analyzer" and this is fine.
  • My Glue service role has read permissions to RDS.
  • My Glue service role has read and write permissions to secret manager, along with kms(decrypt) -- please note that although i am using username-password (and not secret manager) to create the connection, internally I see it's creating a secret manager entry. When my role did not have secret manager permission, I was getting another error (AccessDeniedException: Failed to attach resource policy to service linked secret). This is little confusing and looks like a bug.. Nonetheless, I added secrets-manager permissions (and KMS) to my service role, and since then I am getting this new error - "Request to connector timed out after 45 seconds when validating credential "
  • I used the same credentials to connect to my RDS instance and I can do that successfully.
  • I tried the connection with RDS-postgreSQL also. Again I am getting the same error.

Please help. Thanks!

asked 2 years ago2.3K views

3 Answers
0
Accepted Answer

For others benefit, just wanted to highlight, this issue was coming when I am creating the connection from AWS glue console and selecting mysql (or postgresql) as the data source. If I choose JDBC as the connection type, I am not facing any such error.

**Till the time, aws glue team looks into the issue, I am accepting this as an answer. Hope this helps the people who are stuck with this issue!

answered 2 years ago

0

Does your security group on the RDS allow the glue connection?

Because your RDS may be set to public, you will need to use the private IP address of the RDS Instance in the JDBC connection and not the endpoint hostname as GLUE in theory is in a different VPC therefore it will resolve to the Public IP.

EXPERT

answered 2 years ago

  • Yes my RDS security group does allow glue connection (glue security group). I tried with turning off public accessibility to NO for RDS, as well. No luck, same error.

    ** Also my understanding is that internal DNS triggers first, which in my opinion should identify the destination first, which in turn means that public accessibility should not matter. please correct me if I am missing out anything here.

  • Internal DNS resolution is first IF in the same VPC. Glue techincally is not in your VPC but an AWS VPC. Have you tried using the Private IP in the connection?

  • Looks like, this issue is coming when I am creating the connection from AWS glue console and selecting mysql (or postgresql) as the data source. I tried with JDBC connection and it is working fine (with dns name).

0

The timeout error you're experiencing while creating an AWS Glue Connection for your RDS instance could be due to several factors. Let's address some potential issues and solutions:

  1. Network Configuration: Even though your RDS instance is in a public subnet and you've verified network communication with the reachability analyzer, there might still be some network-related issues. Ensure that the security group associated with your RDS instance allows inbound traffic from the Glue service on the appropriate port (typically 3306 for MySQL or 5432 for PostgreSQL).

  2. VPC Endpoint: If you're using a VPC, make sure you have a VPC endpoint for AWS Glue. This allows Glue to communicate with your resources within the VPC without going through the public internet, which can help resolve timeout issues.

  3. Firewall Rules: Check if there are any firewall rules or network ACLs that might be blocking the connection between Glue and your RDS instance.

  4. Connection Properties: Double-check the connection properties, including the JDBC URL, port, and database name. Make sure they are correctly formatted and match your RDS instance details.

  5. IAM Permissions: While you've mentioned that your Glue service role has the necessary permissions, it's worth double-checking that it has all required permissions for both RDS and Secrets Manager. The fact that Secrets Manager is involved even when using username-password authentication is expected behavior, as AWS Glue securely stores connection credentials.

  6. RDS Instance Status: Verify that your RDS instance is in an available state and not undergoing maintenance or other operations that might affect its accessibility.

  7. Increase Timeout: If possible, try increasing the connection timeout setting for the Glue Connection. However, this option might not be directly available in the console and may require using the AWS CLI or SDK.

  8. Use EC2 for Testing: Launch an EC2 instance in the same VPC and subnet as your RDS instance, and try connecting to the RDS from there. This can help isolate whether the issue is specific to Glue or a more general networking problem.

If the issue persists after checking these points, you may need to contact AWS Support for further assistance, as there could be underlying service-specific issues or conflicts that are not immediately apparent.
Sources
Troubleshooting connection issues in AWS Glue - AWS Glue
Creating connections for connectors - AWS Glue
AWS Glue job failed while connecting to aws glue cause of timeout | AWS re:Post

answered 2 years ago

EXPERT

reviewed 2 years ago

  • I already tried these suggestions and none of them worked. I created an EC2 instance in the same vpc-subnet and I am able to connect to my RDS instance, from there.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.