Panic error on slack message send attempt
rajewluk opened this issue · 10 comments
After completion of test panic error occures in the api server and api-server ms restarts what breaks testsuite execution. The last console log in the api server:
`{"level":"info","ts":1707567262.5946426,"caller":"event/emitter.go:180","msg":"listener notified","listen-on":["start-test","end-test-success","end-test-failed","end-test-aborted","end-test-timeout","start-testsuite","end-testsuite-success","end-testsuite-failed","end-testsuite-aborted","end-testsuite-timeout","created","deleted","updated"],"queue-group":"slack","selector":"","metadata":{"events":"[start-test end-test-success end-test-failed end-test-aborted end-test-timeout start-testsuite end-testsuite-success end-testsuite-failed end-testsuite-aborted end-testsuite-timeout created deleted updated]","name":"slack","selector":""},"id":"dc725de3-7cda-48ea-94df-2577fe42c7e6","type":"end-test-failed","resource":"","resourceId":"65c76311750176aebdf0d53a","executionName":"testsuite-basic-test-7","executionId":"65c76311750176aebdf0d53a","labels":"argocd.argoproj.io/instance=testkube executor=basic-executor test-type=smoke-test ","topic":"events.test.stop"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x19802a1]
goroutine 298 [running]:
github.com/kubeshop/testkube/pkg/slack.(*Notifier).composeTestMessage(0xc0006f6ba0, 0xc00454ab40, {0xc00255ae40, 0xf})
/home/runner/work/testkube/testkube/pkg/slack/slack.go:228 +0x101
github.com/kubeshop/testkube/pkg/slack.(*Notifier).composeMessage(0x206b1e0?, 0xc00037efc0)
/home/runner/work/testkube/testkube/pkg/slack/slack.go:149 +0x85
github.com/kubeshop/testkube/pkg/slack.(*Notifier).SendEvent(0xc0006f6ba0, 0xc00037efc0)
/home/runner/work/testkube/testkube/pkg/slack/slack.go:77 +0x32
github.com/kubeshop/testkube/pkg/event/kind/slack.(*SlackListener).Notify(0xc00057e690, {{0xc003b2c510, 0x24}, {0xc00255ae30, 0x10}, 0x0, {0x0, 0x0}, 0xc002a01900, 0xc00454ab40, ...})
/home/runner/work/testkube/testkube/pkg/event/kind/slack/listener.go:54 +0xaa
github.com/kubeshop/testkube/pkg/event.(*Emitter).notifyHandler.func1({{0xc003b2c510, 0x24}, {0xc00255ae30, 0x10}, 0x0, {0x0, 0x0}, 0xc002a01900, 0xc00454ab40, 0x0, ...})
/home/runner/work/testkube/testkube/pkg/event/emitter.go:179 +0x102
reflect.Value.call({0x21edf20?, 0xc000702dc0?, 0xc001f0e2d0?}, {0x25ded7d, 0x4}, {0xc000e19e40, 0x1, 0xbcfb?})
/opt/hostedtoolcache/go/1.21.5/x64/src/reflect/value.go:596 +0xce7
reflect.Value.Call({0x21edf20?, 0xc000702dc0?, 0x740931e?}, {0xc000e19e40?, 0xc0032caa80?, 0xc0035d1300?})
/opt/hostedtoolcache/go/1.21.5/x64/src/reflect/value.go:380 +0xb9
github.com/nats-io/nats%2ego.(*EncodedConn).subscribe.func1(0xc0013c89a0?)
/home/runner/go/pkg/mod/github.com/nats-io/nats.go@v1.31.0/enc.go:234 +0x5f7
github.com/nats-io/nats%2ego.(*Conn).waitForMsgs(0xc00036a000, 0xc0009d64e0)
/home/runner/go/pkg/mod/github.com/nats-io/nats.go@v1.31.0/nats.go:3045 +0x3f2
created by github.com/nats-io/nats%2ego.(*Conn).subscribeLocked in goroutine 172
/home/runner/go/pkg/mod/github.com/nats-io/nats.go@v1.31.0/nats.go:4256 +0x3c8`
can you check what do go you have for kubectl testkube get executions 65c76311750176aebdf0d53a
?
it should fail either before or not at all. what Testube version do you use?
We use v1.16.37 helm chart. I am sorry, but I don't get your first question. What should i check in this execution?
thank you! you can run kubectl testkube get executions 65c76311750176aebdf0d53a
in your terminal
it returns plenty of standard logs from the job that i cannot paste in here :)
ok, is executio statuss failed or passed?
Hey @rajewluk, I made a fix, but I have a question, did you change the template for slack messages?
@nicufk no, we didn't change neither template nor config, but I see we are still using SLACK_CHANNEL, SLACK_TOKEN and SLACK_URL of Test resource which is not longer supported I think 🤔