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

Handle ugly panic stack trace #48

Open
pa3ng opened this issue Sep 12, 2018 · 3 comments
Open

Handle ugly panic stack trace #48

pa3ng opened this issue Sep 12, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@pa3ng
Copy link

pa3ng commented Sep 12, 2018

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!)
@pa3ng pa3ng added the enhancement New feature or request label Sep 12, 2018
@wass3r
Copy link
Collaborator

wass3r commented Sep 12, 2018

Are you sure the stack trace isn't prefaced with an informative error message?

@pa3ng
Copy link
Author

pa3ng commented Sep 12, 2018

@wass3r I didn't see any. Added the stack trace to the What happened instead? section.

@wass3r
Copy link
Collaborator

wass3r commented Sep 13, 2018

was able to replicate. for now, we probably want to .Fatal out if a chat app is set but the token is not set. long term, we will want to refactor this. things work if you set cli to true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: To do
Development

No branches or pull requests

2 participants