Question:
Node.js version 0.10.25
AWS SDK Version latest - 2.0.23
I have an app that is continuously listening to a Queue (SQS) and if there are messages posted in that queue the app will read the message and process it and save some data to S3. When I start the app after about 20 minutes I am getting the following error continuously.
1 2 3 4 5 6 7 8 9 10 11 12 |
Potentially unhandled rejection [160] SignatureDoesNotMatch: Signature expired: 20141104T062952Z is now earlier than 20141104T062952Z (20141104T064452Z - 15 min.) at Request.extractError (/myproject/node_modules/aws-sdk/lib/protocol/query.js:39:29) at Request.callListeners (/myproject/node_modules/aws-sdk/lib/sequential_executor.js:100:18) at Request.emit (/myproject/node_modules/aws-sdk/lib/sequential_executor.js:77:10) at Request.emit (/myproject/node_modules/aws-sdk/lib/request.js:604:14) at Request.transition (/myproject/node_modules/aws-sdk/lib/request.js:21:12) at AcceptorStateMachine.runTo (/myproject/node_modules/aws-sdk/lib/state_machine.js:14:12) at /myproject/node_modules/aws-sdk/lib/state_machine.js:26:10 at Request. at Request. at Request.callListeners (/myproject/node_modules/aws-sdk/lib/sequential_executor.js:104:18) |
It is not an issue with my system time. My system time is in sync with the time of my EC2 instance. Why am I getting this error? Is it related to SQS or S3?
Answer:
Thanks to Loren Segal (Amazon) for his quick response. Refer https://github.com/aws/aws-sdk-js/issues/401 for more details. In short, the SDK is not retrying signature errors for which the work around is
1 2 3 4 5 6 |
AWS.events.on('retry', function(resp) { if (resp.error.code === 'SignatureDoesNotMatch') { resp.error.retryable = true; } }); |
This is not a regression i.e, it is not a bug introduced in 2.0.23