Errors when using KeepAlive-style CloudWatch events
See original GitHub issueI have a CloudWatch event that essentially acts as a keepalive function by calling my Alexa Lambda backend with a “matched event” once every 10 minutes.
This generates a ton of errors like this in my logs:
"errorMessage": "Cannot read property 'new' of undefined",
"errorType": "TypeError",
"stackTrace": [
"new alexa.request (/var/task/node_modules/alexa-app/index.js:149:30)",
"/var/task/node_modules/alexa-app/index.js:227:21",
"tryCatcher (/var/task/node_modules/bluebird/js/main/util.js:26:23)",
"Promise._resolveFromResolver (/var/task/node_modules/bluebird/js/main/promise.js:483:31)",
"new Promise (/var/task/node_modules/bluebird/js/main/promise.js:71:37)",
"alexa.app.request (/var/task/node_modules/alexa-app/index.js:226:12)",
"handler (/var/task/node_modules/alexa-app/index.js:357:10)"
]
I don’t think this is hurting anything, but obviously I’d prefer to see something more constructive and less distracting than those errors.
Is there a better way to build a keepalive function with CloudWatch? Or should alexa-app be a little more resilient when it receives events that it’s not expecting?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
Troubleshooting CloudWatch Events - AWS Documentation
You can use the steps in this section to troubleshoot CloudWatch Events. ... A client error (ResourceNotFoundException) occurred when calling the GetPolicy ...
Read more >Lambda with CloudWatch Events — Failure Handling - Medium
The setup will be really simple: A Lambda function that always throws an error, triggered by any CloudWatch event with a source equal...
Read more >How to monitor AWS Lambda events through Cloudwatch ...
Stream logs to another lambda that can send SNS alert - the lambda can monitor key words like ERROR, Exception etc. Catch exceptions...
Read more >Monitoring Amazon RAM using CloudWatch Events
Example: Alerting on resource share failures. Consider the scenario where you want to share Amazon EC2 capacity reservations with other accounts in your ......
Read more >@aws-sdk/client-cloudwatch-events - npm
Start using @aws-sdk/client-cloudwatch-events in your project by ... easy to debug and has better error handling as compared to using ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have a background task which triggers my Alexa Lambda function from a CloudWatch Event also. I have changed the lambda handler in my code to this, which handles the different request type. I defined my own app.scheduled() function that handles the CW event.
This is another common use case that I think would be great to have handled within alexa-app itself.
maybe calling to
.pre()
and resolving the request will help?