Search code examples
aws-lambdaaws-api-gatewayslackslack-api

Custom Slack Command with AWS API Gateway - 500_service_error


I'd developing a custom Slack command returning response from an Amazon lambda via API Gateway. Everything was working well when suddenly I couldn't make any call without returning

'Darn - that slash command didn't work (error message: `500_service_error`

Via Curl, the response status is '200' and I'm still receiving correctly the json response of my lambda.

  • Do you have any idea a potential origin of this bug?
  • Is there any way to be able to debug custom App for Slack?

Thanks


Solution

  • I've discussed with the Slack team that can check their internal logs for you:

    "Unfortunately we don't have a debug console available for developers just yet"

    "I can confirm that Slack is receiving a 500 server error when connecting to your Slash command endpoint. Unfortunately I don't really have any more information from our end"

    The real problem is the transformation of the call body from form to json at the level of the API Gateway. Slack is sending a form body that has to be transformed in json for the lamda. I was following this thread https://forums.aws.amazon.com/thread.jspa?messageID=673012&tstart=0#673012:

    It will be nice in future to have the logs of the Slack features, to have JSON payload instead of form and in the same time to enable directly the Cloudwatch logs for API Gateway in order to check random bugs :)

    Thanks