question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RDSDataService "Communications link failure" when unpausing

See original GitHub issue

Confirm by changing [ ] to [x] below to ensure that it’s a bug:

Describe the bug

Running AWS.RDSDataService.executeStatement against a auto-paused Serverless Aurora instance results in the following, unhandled, error:

BadRequestException: 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.
    at Object.extractError (/Users/michael/Work/scratch/mysql/node_modules/aws-sdk/lib/protocol/json.js:51:27)
    at Request.extractError (/Users/michael/Work/scratch/mysql/node_modules/aws-sdk/lib/protocol/rest_json.js:55:8)
    at Request.callListeners (/Users/michael/Work/scratch/mysql/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/Users/michael/Work/scratch/mysql/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/Users/michael/Work/scratch/mysql/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/Users/michael/Work/scratch/mysql/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/michael/Work/scratch/mysql/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/michael/Work/scratch/mysql/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/michael/Work/scratch/mysql/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/michael/Work/scratch/mysql/node_modules/aws-sdk/lib/request.js:685:12)

Apparently the Communications link failure is expected while compute is being automatically re-provisioned (see additional context), and the client is expected to retry with a delay.

Is the issue in the browser/Node.js? Node.js

If on Node.js, are you running this on AWS Lambda? Issue can be reproduced on local machine.

Details of the browser/Node.js version v12.13.0

SDK version number Example: v2.553.0

To Reproduce (observed behavior)

  1. Create a Serverless Aurora cluster instructions
  2. With the “pause compute capacity after consecutive minutes of inactivity” set to the minimum of 5 minutes
  3. Once commissioned wait 5-10 minutes for Aurora to scale to 0 capacity units (i.e. paused).
  4. Run minimal query script below (replacing ARNs as required) - it will fail with the error reported above.
  5. Wait ~30-60 seconds and re-run the query script - it will return a result.
import AWS from 'aws-sdk';

const db = new AWS.RDSDataService({ region: 'eu-west-1' });

async function main() {
  const sql = ;
  const result = await db
    .executeStatement({
      sql: 'select * from information_schema.tables;',
      resourceArn: 'DATABASE_ARN',
      secretArn: 'CONNECTION_SECRET_ARN',
    })
    .promise();
  console.log(JSON.stringify(result, null, 2));
}
main();

Expected behavior

I expected the aws-sdk to retry with a delay after receiving the BadRequestException.

Additional context

*A search across StackOverflow found a response from AWS support that the failure itself is expected behaviour (https://stackoverflow.com/questions/58192747/aws-aurora-serverless-communication-link-failure).

Clients are expected to wait and retry.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
thomasmichaelwallacecommented, Nov 1, 2019

Cool - @ajredniwja - I’ve given it a go. See #2931

0reactions
lock[bot]commented, Jan 16, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Catching and Parsing AWS RDSDataService exceptions
I am using RDSDataService in a lambda to execute queries in an Aurora Serverless DB. ... AWS Aurora Serverless - Communication Link Failure....
Read more >
"Communications link failure The last packet sent ... - ERROR
​This issue occurs when secure agent is not able to communicate with RDS instance in AWS. This error can be seen with different...
Read more >
Share an Aurora Serveless between services using ...
If aurora is paused, I just fail and lambda will retry at which point the database is hopefully up and running. Create a...
Read more >
Class: AWS.RDSDataService — AWS SDK for JavaScript
An Endpoint object representing the endpoint URL for service requests. ... timeout after failing to establish a connection with the server ...
Read more >
aws-sdk | Yarn - Package Manager
... RDSDataService: Retry on Serverless Aurora "Communications link failure" ... feature: MediaLive: This release adds support for pausing and unpausing one ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found