-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors when using KeepAlive-style CloudWatch events #369
Comments
Looks like something expects a request with certain fields and should fail earlier. Please feel free to reproduce in a spec and fix. |
Ah, minor update: that particular error was with an earlier version of alexa-app (2.3.4). After upgrading to the latest version (4.2.2) I get a different error: The root cause is the same though. The problem is that the KeepAlive Cloudwatch event doesn't really look like an Alexa request. It looks like this:
I'm not sure what the best solution is here. It kind of makes sense for alexa-app to throw an error if it gets a clearly malformed request like that. But at the same time, it's a well-known practice to use Cloudwatch keepalive events, and I think there should be some way to support that without throwing errors. |
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. |
Lets leave this open as a feature request. I think a generic way to handle non-alexa events could be good. |
maybe calling to app.pre(function(request, response) {
if (request.data && request.data.source === 'aws.events') {
console.log('ping!');
response.resolved = true; // will skip the next handlers.
response.response = {}; // will nullify the response. You can omit this if you don't care for the output.
}
return true;
}); |
I 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:
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?
The text was updated successfully, but these errors were encountered: