mattermost-community / mattermost-plugin-aws-SNS

Plugin that receives SNS notification from Alerts created by AWS CloudWatch and sent via AWS SNS
Apache License 2.0
21 stars 22 forks source link

Crash with LocalStack #55

Closed levb closed 3 years ago

levb commented 3 years ago

Hi @here,

I started in the past days to work on the following ticket: issue-mattermost-plugin-aws-SNS-12

I started the server and the web application. After that, I deployed the plugin to my local server.

Everything was fine up to this point, and I was able to enable the plugin from the System Console.

I created a Docker Compose file for setting up LocalStack.

After starting the Docker container for LocalStack, I created an SNS topic and created a subscription to the plugin endpoint.

The server received the request, but as soon as the plugin tried to handle the subscription confirmation it caused a panic. I will add the relevant logs below:

DEBU[2020-11-30T20:02:33.8645253+02:00] panic: runtime error: invalid memory address or nil pointer dereference  caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.8647957+02:00] [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xc17258]  caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.864933+02:00]                                               caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.8650892+02:00] goroutine 52 [running]:                       caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.865398+02:00] main.(*Plugin).sendSubscribeConfirmationMessage(0xc0004a1e30, 0xc000128000, 0xab, 0xc0004b0080, 0x7c)  caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.8656209+02:00]     /home/george/work/mattermost/projects/mattermost-plugin-aws-SNS/server/plugin.go:226 +0x58  caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.8658226+02:00] main.(*Plugin).handleSubscriptionConfirmation(0xc0004a1e30, 0x7f1bac7959c8, 0xc0003a7d80)  caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.86603+02:00]   /home/george/work/mattermost/projects/mattermost-plugin-aws-SNS/server/plugin.go:146 +0xd3  caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.8662584+02:00] main.(*Plugin).ServeHTTP(0xc0004a1e30, 0xc000188420, 0xf286a0, 0xc000487790, 0xc0001c4000)  caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.866506+02:00]  /home/george/work/mattermost/projects/mattermost-plugin-aws-SNS/server/plugin.go:120 +0x1c8  caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.8667758+02:00] github.com/mattermost/mattermost-server/v5/plugin.(*hooksRPCServer).ServeHTTP(0xc00043c260, 0xc00018c0e0, 0x146c918, 0x0, 0x0)  caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.8669825+02:00]     /home/george/go/pkg/mod/github.com/mattermost/mattermost-server/v5@v5.28.1/plugin/client_rpc.go:365 +0x2b2  caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.8674166+02:00] reflect.Value.call(0xc000481440, 0xc000488348, 0x13, 0xe04fd0, 0x4, 0xc000500f08, 0x3, 0x3, 0x0, 0x0, ...)  caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.8676548+02:00]     /usr/local/go/src/reflect/value.go:476 +0x8c7  caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.8679075+02:00] reflect.Value.Call(0xc000481440, 0xc000488348, 0x13, 0xc0004e8708, 0x3, 0x3, 0x7f1bad16ddd8, 0x0, 0xc)  caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.86812+02:00]   /usr/local/go/src/reflect/value.go:337 +0xb9  caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.8685071+02:00] net/rpc.(*service).call(0xc00048e740, 0xc00049a3c0, 0xc00048a8e0, 0xc00048a8f0, 0xc000492b80, 0xc0004850a0, 0xc7aa80, 0xc00018c0e0, 0x16, 0xc8c2c0, ...)  caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.8687644+02:00]     /usr/local/go/src/net/rpc/server.go:377 +0x189  caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.8689528+02:00] created by net/rpc.(*Server).ServeCodec       caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.8691673+02:00]     /usr/local/go/src/net/rpc/server.go:474 +0x445  caller="plugin/hclog_adapter.go:53" plugin_id=com.mattermost.aws-sns
ERRO[2020-11-30T20:02:33.870296+02:00] Plugin failed to ServeHTTP, RPC call failed   caller="mlog/log.go:229" error="unexpected EOF" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:02:33.870299+02:00] plugin process exited                         caller="plugin/hclog_adapter.go:51" plugin_id=com.mattermost.aws-sns wrapped_extras="pathplugins/com.mattermost.aws-sns/server/dist/plugin-linux-amd64pid10265errorexit status 2"
DEBU[2020-11-30T20:03:03.8014424+02:00] Error pinging plugin                          caller="plugin/supervisor.go:124" error="connection is shut down"
ERRO[2020-11-30T20:03:03.8383255+02:00] Health check failed for plugin                caller="plugin/health_check.go:59" error="Plugin RPC connection is not responding" id=com.mattermost.aws-sns
DEBU[2020-11-30T20:03:03.8746073+02:00] Restarting plugin due to failed health check  caller="plugin/health_check.go:72" id=com.mattermost.aws-sns
WARN[2020-11-30T20:03:03.9052253+02:00] error closing client during Kill              caller="plugin/hclog_adapter.go:69" plugin_id=com.mattermost.aws-sns wrapped_extras="errconnection is shut down"
WARN[2020-11-30T20:03:03.9328728+02:00] plugin failed to exit gracefully              caller="plugin/hclog_adapter.go:71" plugin_id=com.mattermost.aws-sns
DEBU[2020-11-30T20:03:04.1437795+02:00] starting plugin                               caller="plugin/hclog_adapter.go:51" plugin_id=com.mattermost.aws-sns wrapped_extras="pathplugins/com.mattermost.aws-sns/server/dist/plugin-linux-amd64args[plugins/com.mattermost.aws-sns/server/dist/plugin-linux-amd64]"
DEBU[2020-11-30T20:03:04.178655+02:00] plugin started                                caller="plugin/hclog_adapter.go:51" plugin_id=com.mattermost.aws-sns wrapped_extras=pathplugins/com.mattermost.aws-sns/server/dist/plugin-linux-amd64pid11983
DEBU[2020-11-30T20:03:04.1787748+02:00] waiting for RPC address                       caller="plugin/hclog_adapter.go:51" plugin_id=com.mattermost.aws-sns wrapped_extras=pathplugins/com.mattermost.aws-sns/server/dist/plugin-linux-amd64

I was wondering if anyone has noticed this problem recently?

_Issue created from a Mattermost message by @george.cionca._