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

flagger crashes if you define SLACK_URL env var and there's nothing in slack.url parameter #496

Closed
haisumb opened this issue Mar 10, 2020 · 0 comments · Fixed by #504
Closed
Labels
kind/bug Something isn't working

Comments

@haisumb
Copy link

haisumb commented Mar 10, 2020

I created this HelmRelease:

apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
  name: flagger
  namespace: istio-system
spec:
  releaseName: flagger
  chart:
    repository: https://flagger.app
    name: flagger
    version: 0.24.0
  values:
    meshProvider: istio
    metricsServer: http://prometheus:9090
    env:
    - name: SLACK_URL
      valueFrom:
       secretKeyRef:
         name: slack
         key: url
    slack:
      # This will crash flagger
      # url: 
      url: "must provide something here. otherwise flagger crashes"
      channel: haisum
      user: flagger

If I skip url from above, slack integration doesn't work. We get following logs in flux when it tries to do canary:


{"level":"info","ts":"2020-03-10T17:46:50.547Z","caller":"flagger/main.go:110","msg":"Starting flagger version 1.0.0-rc.1 revision e59acc7bae6b2d1c9a3e97abb2dcadc9f0985c2d mesh provider istio"}
{"level":"info","ts":"2020-03-10T17:46:50.598Z","caller":"flagger/main.go:381","msg":"Connected to Kubernetes API v1.14.8"}
{"level":"info","ts":"2020-03-10T17:46:50.598Z","caller":"flagger/main.go:235","msg":"Waiting for canary informer cache to sync"}
{"level":"info","ts":"2020-03-10T17:46:50.698Z","caller":"flagger/main.go:242","msg":"Waiting for metric template informer cache to sync"}
{"level":"info","ts":"2020-03-10T17:46:50.798Z","caller":"flagger/main.go:249","msg":"Waiting for alert provider informer cache to sync"}
{"level":"info","ts":"2020-03-10T17:46:50.901Z","caller":"flagger/main.go:158","msg":"Connected to metrics server http://prometheus:9090"}
{"level":"error","ts":"2020-03-10T17:46:50.901Z","caller":"flagger/main.go:323","msg":"Notifier empty Slack channel","stacktrace":"main.initNotifier\n\t/home/circleci/build/cmd/flagger/main.go:323\nmain.main\n\t/home/circleci/build/cmd/flagger/main.go:164\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:203"}
{"level":"info","ts":"2020-03-10T17:46:50.901Z","caller":"controller/controller.go:153","msg":"Starting operator"}
{"level":"info","ts":"2020-03-10T17:46:50.902Z","caller":"controller/controller.go:162","msg":"Started operator workers"}
{"level":"info","ts":"2020-03-10T17:46:50.902Z","caller":"server/server.go:29","msg":"Starting HTTP server on port 8080"}
{"level":"info","ts":"2020-03-10T17:46:50.907Z","caller":"controller/controller.go:239","msg":"Synced default/helloworld"}
{"level":"info","ts":"2020-03-10T17:47:00.973Z","caller":"controller/events.go:15","msg":"New revision detected! Scaling up helloworld.default","canary":"helloworld.default"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x145cf78]

goroutine 76 [running]:
github.com/weaveworks/flagger/pkg/notifier.(*Slack).Post(0x0, 0xc000267960, 0xa, 0xc000267979, 0x7, 0x180e2f5, 0x30, 0xc00013f440, 0x4, 0x6, ...)
	/home/circleci/build/pkg/notifier/slack.go:66 +0x68
github.com/weaveworks/flagger/pkg/controller.(*Controller).alert(0xc0002037a0, 0xc000063c00, 0x180e2f5, 0x30, 0xc0005e5b01, 0x17b80f3, 0x4)
	/home/circleci/build/pkg/controller/events.go:66 +0x1519
github.com/weaveworks/flagger/pkg/controller.(*Controller).checkCanaryStatus(0xc0002037a0, 0xc00048ea80, 0x1b3e520, 0xc00003a640, 0x1, 0x0)
	/home/circleci/build/pkg/controller/scheduler.go:629 +0x72b
github.com/weaveworks/flagger/pkg/controller.(*Controller).advanceCanary(0xc0002037a0, 0xc00057e9e0, 0xa, 0xc00057e9f9, 0x7, 0x445e00)
	/home/circleci/build/pkg/controller/scheduler.go:182 +0x9f9
github.com/weaveworks/flagger/pkg/controller.CanaryJob.Start.func1(0xc00057e9e0, 0xa, 0xc00057e9f9, 0x7, 0x0, 0xc000472700, 0xc0001003c0, 0xc0002ae6e0, 0x37e11d600)
	/home/circleci/build/pkg/controller/job.go:20 +0x7b
created by github.com/weaveworks/flagger/pkg/controller.CanaryJob.Start
	/home/circleci/build/pkg/controller/job.go:18 +0x70
@stefanprodan stefanprodan added the kind/bug Something isn't working label Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants