lnsp/k8s-crash-informer

Segmentation Fault for Mattermost Informer

TomKriek opened this issue · 7 comments

Hello again, I managed to pull the image, except now the container is giving me a segementation fault. I followed the set up for a ConfigMap on Kubectl and then just applied the informer Yaml. The only anomaly that I can think of that might interfere with everything is Istio running on my cluster and namespace.

Error:

➜ kubectl logs mattermost-informer-85d597568b-cpfnp -n v3-sandbox -c informer
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x8fe1b3]

goroutine 1 [running]:
github.com/lnsp/k8s-crash-informer/pkg/chat.NewMattermostClientFromEnv(0x14dacb8, 0x8, 0x12956c0)
	/build/pkg/chat/chat.go:98 +0x243
github.com/lnsp/k8s-crash-informer/pkg/chat.NewClientFromEnv(0x0, 0xa72f5fe0, 0xc46007b61508dbac, 0xc0001d1dc8)
	/build/pkg/chat/chat.go:79 +0x149
github.com/lnsp/k8s-crash-informer/pkg/controller.Run()
	/build/pkg/controller/controller.go:247 +0x44
main.main()
	/build/main.go:8 +0x20

Output of kubectl version

➜ kubectl version  
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.6", GitCommit:"abdda3f9fefa29172298a2e42f5102e777a8ec25", GitTreeState:"clean", BuildDate:"2019-05-08T13:53:53Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13+", GitVersion:"v1.13.11-gke.14", GitCommit:"56d89863d1033f9668ddd6e1c1aea81cd846ef88", GitTreeState:"clean", BuildDate:"2019-11-07T19:12:22Z", GoVersion:"go1.12.11b4", Compiler:"gc", Platform:"linux/amd64"}

Any advice or help would be appreciated.

lnsp commented

Sorry for the late response, I'm quite busy right now. Weird bug though, I'll look into it.

@lnsp Any possible ETA on when this might be bugfixed?

lnsp commented

I'm not exactly sure why it crashes on NewMattermostFromClientEnv. To crash on line 98,
team should be nil (which should not happen because we check for errors). Which Mattermost version are you running?

I tested locally for what happens when you misspell team names, but it just throws a normal error.

My guess is that the error occurs because of some weird proxying done by Envoy / Istio. Do you allow accessing external services in your Envoy configuration?

About Mattermost output.

Mattermost Version: 5.7.1
Database Schema Version: 5.7.0
Database: mysql

We run it self-hosted on a subdomain for which we have a ServiceEntry for Istio.
I double checked with a curl request to where it's hosted and I'm getting a HTTP 200 code.

Our team name consists of more than 1 word, maybe there is some parsing of the team name going wrong?

Alright so I double checked all settings and I think I went wrong at the URL part. I configured a webhook URL and token for it. But instead I should have used the plain domain where mattermost was hosted and a personal access token.
So it's running now at least. Sorry for the troubles!

lnsp commented

I guess I should clarify the documentation then 👍