Skip to content
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

"errorMessage": "No matching processor for event. #19

Closed
henryzhang1984 opened this issue Aug 4, 2017 · 10 comments · Fixed by #20
Closed

"errorMessage": "No matching processor for event. #19

henryzhang1984 opened this issue Aug 4, 2017 · 10 comments · Fixed by #20

Comments

@henryzhang1984
Copy link

henryzhang1984 commented Aug 4, 2017

lambda-cloudwatch-slack-0.1.2

1.when code deploy to aws ,cloudwatch log show:

No matching processor for event. [EventSubscriptionArn: arn:aws:sns:ap-southeast-1:426052853157:staging-asg:51e5c7bb-9436-43c6-8cd6-33fa7aa748d5]

  1. failed to make test in local
    processing cloudwatch notification
    events.js:182
    throw er; // Unhandled 'error' event
    ^

Error: connect ECONNREFUSED 127.0.0.1:443
at Object.exports._errnoException (util.js:1016:11)
at exports._exceptionWithHostPort (util.js:1039:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1138:14)
make: *** [test] Error 1

@henryzhang1984
Copy link
Author

image

@rozhok
Copy link

rozhok commented Aug 7, 2017

Same here. What should we tune?

@creichert
Copy link
Member

@henryzhang1984 Your event seems to be going through SNS, but what service is sending the event? I think there are currently some limitations that the processor has to be pre-defined: https://github.com/assertible/lambda-cloudwatch-slack/blob/master/config.js#L11

I'm happy to check this out if you can post your (scrubbed) event.

@creichert
Copy link
Member

@rozhok What does your event look like?

IMO, we probably need a better way to have a default "catchall" type event.

@rozhok
Copy link

rozhok commented Aug 7, 2017

Here we go:

{
  "Records": [
    {
      "EventSource": "aws:sns",
      "EventVersion": "1.0",
      "EventSubscriptionArn": "arn:aws:sns:eu-west-1:111111111111111:samlpe-alert:ff1e3698-7f85-4da2-a90e-13ad2afe30e0",
      "Sns": {
        "Type": "Notification",
        "MessageId": "0d7a65e4-435e-5ff1-8e80-37e6fba3ef4f",
        "TopicArn": "arn:aws:sns:eu-west-1:111111111111111:Sample-alert",
        "Subject": "ALARM: \"Sample Alert\" in EU - Ireland",
        "Message": "{\"AlarmName\":\"Sample Alert\",\"AlarmDescription\":null,\"AWSAccountId\":\"111111111111111\",\"NewStateValue\":\"ALARM\",\"NewStateReason\":\"Threshold Crossed: 1 datapoint [1446.0 (07/08/17 18:46:00)] was greater than or equal to the threshold (1000.0).\",\"StateChangeTime\":\"2017-08-07T18:51:41.602+0000\",\"Region\":\"EU - Ireland\",\"OldStateValue\":\"OK\",\"Trigger\":{\"MetricName\":\"RequestCount\",\"Namespace\":\"AWS/ApplicationELB\",\"StatisticType\":\"Statistic\",\"Statistic\":\"SUM\",\"Unit\":null,\"Dimensions\":[{\"name\":\"LoadBalancer\",\"value\":\"app/app/6892f491c9b95d3f\"}],\"Period\":300,\"EvaluationPeriods\":1,\"ComparisonOperator\":\"GreaterThanOrEqualToThreshold\",\"Threshold\":1000.0,\"TreatMissingData\":\"\",\"EvaluateLowSampleCountPercentile\":\"\"}}",
        "Timestamp": "2017-08-07T18:51:41.652Z",
        "SignatureVersion": "1",
        "Signature": "lol",
        "SigningCertUrl": "https://sns.eu-west-1.amazonaws.com/SimpleNotificationService-b95095beb82e8f6a0463n12jnkndswea.pem",
        "UnsubscribeUrl": "https://sns.eu-west-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-west-1:111111111111111:Sample-alert:ff1e3698-7f85-4da2-a90e-13ad2afe30e0",
        "MessageAttributes": {}
      }
    }
  ]
}

creichert added a commit that referenced this issue Aug 7, 2017
This will be used to fix #19 by adding a "catch all" event processor
which will propogate the JSON values to Slack, as opposed to failing
with `No matching processor for event`.
@creichert
Copy link
Member

We are working on this in #20

@henryzhang1984
Copy link
Author

image

@CodyReichert
Copy link
Member

CodyReichert commented Aug 8, 2017

Thanks @henryzhang1984 - I see 2 issues here:

  1. The ECONNREFUSED error. Do you have a correct UNENCRYPTED_HOOK_URL value set in the deploy.env file when you deployed to lambda? That's only reason I can see that happening (becuase it did successfully matched a CloudWatch event).

  2. In your original issue, you did post the no matching processor found for event. That one will be fixed in Add test for SNS event w/ no identifying event info #20. (It also seems like you've corrected the EventSubscriptionArn since then, so you should be getting past this).

Can you double check the webhook URL you have configured? Does that all look correct?

@CodyReichert
Copy link
Member

Hey all - we just released v0.2.1 that contains a 'catch-all' handler for events that don't have a matching processor. Now, SampleEvents and various things like should work.

@henryzhang1984 - I believe ECONNREFUSED is an issue with not having a correct Slack Hook URL, so if you're still having issues with that please open another issue and I'll check it out!

@rozhok
Copy link

rozhok commented Aug 11, 2017

@CodyReichert thanks! Will test it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants