Skip to content
This repository has been archived by the owner on Aug 14, 2022. It is now read-only.

runtime error: invalid memory address or nil pointer dereference #125

Open
vyalovvldmr opened this issue Aug 28, 2020 · 1 comment
Open

Comments

@vyalovvldmr
Copy link

vyalovvldmr commented Aug 28, 2020

I've just run alertmanager-bot in docker swarm cluster + traefik and have got this error:

2020/08/28 20:21:14 http: panic serving 10.0.1.135:36598: runtime error: invalid memory address or nil pointer dereference
goroutine 248 [running]:
net/http.(*conn).serve.func1(0xc0003723c0)
        /usr/local/go/src/net/http/server.go:1767 +0x139
panic(0xa4d780, 0x1024220)
        /usr/local/go/src/runtime/panic.go:679 +0x1b2
github.com/metalmatze/alertmanager-bot/pkg/alertmanager.HandleWebhook.func1(0xbf6400, 0xc0003da1c0, 0xc0000d1100)
        /go/src/github.com/metalmatze/alertmanager-bot/pkg/alertmanager/webhook.go:41 +0x422
net/http.HandlerFunc.ServeHTTP(0xc000320b70, 0xbf6400, 0xc0003da1c0, 0xc0000d1100)
        /usr/local/go/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0xc0000e9b00, 0xbf6400, 0xc0003da1c0, 0xc0000d1100)
        /usr/local/go/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc00025ae00, 0xbf6400, 0xc0003da1c0, 0xc0000d1100)
        /usr/local/go/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc0003723c0, 0xbf8b00, 0xc000194600)
        /usr/local/go/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
        /usr/local/go/src/net/http/server.go:2928 +0x384

My docker-stack configuration was:

  alertmanager-bot:
    image: metalmatze/alertmanager-bot:0.4.2
    networks:
      - network
    environment:
      - TELEGRAM_ADMIN=<ID>
      - TELEGRAM_TOKEN=<TOKEN>
      - LISTEN_ADDR=0.0.0.0:5054
      - ALERTMANAGER_URL=http://alertmanager:9093
    command:
      - --log.level=info
      - --store=bolt
      - --bolt.path=/data/bot.db
    volumes:
      - alertmanager-bot:/data
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints:
          - node.hostname == ${CONSTRAINT}
      resources:
        limits:
          memory: 128M
        reservations:
          memory: 64M
      labels:
        - traefik.enable=true
        - traefik.http.routers.alertmanager-bot-https.rule=Host(`<HOSTNAME>`)
        - traefik.http.routers.alertmanager-bot-https.entrypoints=websecure
        - traefik.http.routers.alertmanager-bot-https.tls=true
        - traefik.http.routers.alertmanager-bot-https.tls.certresolver=hurma
        - traefik.http.services.alertmanager-bot.loadbalancer.server.port=5054
@metalmatze
Copy link
Owner

Sorry for the late answer. Not sure if this problem still persists.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants