awslabs / aws-lambda-redshift-loader

Amazon Redshift Database Loader implemented in AWS Lambda
Other
597 stars 164 forks source link

Error when trying to send SNS #203

Open if-gh opened 5 years ago

if-gh commented 5 years ago

Hi,

I just deployed 2.7.0 and uploaded a test file to S3 bucket with wrong format to test the notification, but it seems lambda function failed when trying to send SNS. I wonder if this is caused by incompatibility with runtime environment? Got the same error when using nodejs10.x and nodejs12.x. CloudWatch log:

{
    "errorType": "Error",
    "errorMessage": "error",
    "stack": [
        "Error: error",
        "    at _homogeneousError (/var/runtime/CallbackContext.js:13:12)",
        "    at postError (/var/runtime/CallbackContext.js:30:51)",
        "    at done (/var/runtime/CallbackContext.js:57:7)",
        "    at Object.done (/var/runtime/CallbackContext.js:105:16)",
        "    at /var/task/index.js:1377:37",
        "    at /var/task/index.js:1433:13",
        "    at /var/task/node_modules/async/dist/async.js:473:16",
        "    at next (/var/task/node_modules/async/dist/async.js:5329:29)",
        "    at /var/task/node_modules/async/dist/async.js:969:16",
        "    at Response.<anonymous> (/var/task/index.js:1397:13)"
    ]
}

and on nodejs8.10:

{
    "errorMessage": "error"
}

~Since nodejs8.10 is approaching end of life: https://docs.aws.amazon.com/lambda/latest/dg/runtime-support-policy.html~

0.10 have long deprecated and is no longer available in AWS Lambda, I wonder if there is any plan for supporting 10.x and 12.x?

IanMeyers commented 5 years ago

This should be fixed in release 2.7.1 https://github.com/awslabs/aws-lambda-redshift-loader/releases/tag/2.7.1

if-gh commented 5 years ago

Hi Ian, thanks for timely response! I tried 2.7.1 and it seems the logging is not working properly, the CloudWatch log is showing nothing after I uploaded a file. The above error seems only happen after sending the SNS, I tested 2.7.0 again and found that I am able to receive the SNS message regardless. So I used SuppressFailureStatusOnSuccessfulNotification = 'true' to prevent it triggering CloudWatch alarms.