Skip to content

Handle ugly panic stack trace #48

Open
@pa3ng

Description

Report

What did you do?

  1. Set the metrics field to false
  2. Build the docker image. Here's my Dockerfile:
FROM target/flottbot:golang

ADD config config

CMD ["/go/flottbot"]
  1. Run the docker image without any environment variables (this will cause the stack trace):
docker run -it thorhousebot

What did you expect to happen?

I was expecting a prettier and more informative error message, i.e. "Your slack token was not found" or something like that.

What happened instead?

Ugly stack trace poop.

INFO[0000] Configuring bot...
WARN[0000] Could not set Slack Token: Variable 'SLACK_TOKEN' has not been defined.
ERRO[0000] Slack Interactive Components callback path is empty:
INFO[0000] Configured bot 'thorhousebot'!
DEBU[0000] Looking for rules directory...
DEBU[0000] Fetching all rule YAML files...
DEBU[0000] Reading and parsing rule YAML files...
INFO[0000] Configured 'thorhousebot' rules!
fatal error: all goroutines are asleep - deadlock!

goroutine 1 [semacquire]:
sync.runtime_Semacquire(0xc000025998)
        /usr/local/go/src/runtime/sema.go:56 +0x39
sync.(*WaitGroup).Wait(0xc000025990)
        /usr/local/go/src/sync/waitgroup.go:130 +0x64
main.main()
        /go/src/github.com/target/flottbot/main.go:71 +0x27c

goroutine 8 [chan receive]:
github.com/target/flottbot/core.Matcher(0xc00001ef00, 0xc00001ef60, 0xc00013a420, 0xc00001eea0, 0xc000087900)
        /go/src/github.com/target/flottbot/core/matcher.go:23 +0x7a
created by main.main
        /go/src/github.com/target/flottbot/main.go:61 +0x212

goroutine 9 [chan receive]:
github.com/target/flottbot/core.Outputs(0xc00001ef60, 0xc00001eea0, 0xc000087900)
        /go/src/github.com/target/flottbot/core/outputs.go:19 +0x9c
created by main.main
        /go/src/github.com/target/flottbot/main.go:62 +0x248

Your Environment

  • Run flottbot --version and paste the output here: Version : 0.1.0
  • What OS are you running on? macOS Sierra version 10.12.6
  • Your bot.yml (remove any sensitive information!)
  • Maybe the contents of the .yml for the rule you're trying to run, if applicable (remove any sensitive information!)
name: thorhousebot 

chat_application: slack 
slack_token: ${SLACK_TOKEN} 

cli: false 

scheduler: false

debug: true

log_json: false

webhook: false

metrics: false 
# please paste contents of your rule, if applicable (remove any sensitive information!)

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    • Status

      To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions