StackStorm / hubot-stackstorm

Hubot plugin for integration with StackStorm event-driven infrastructure automation platform.
Apache License 2.0
49 stars 39 forks source link

Exit hubot on Unauthorized errors #178

Closed arm4b closed 5 years ago

arm4b commented 5 years ago

Addresses https://github.com/StackStorm/st2chatops/issues/124 Accidentally Closes #157 Accidentally Closes stackstorm/st2#4119

This bugfix solves particular problem when invalid, expired ST2_API_KEY / ST2_AUTH_TOKEN or any other Unauthorized response from st2 server leads to bot exit.

Previously the bot was running forever with no exit, trying to re-auth in a loop every ST2_COMMANDS_RELOAD_INTERVAL (2mins). Now we deem such errors as fatal.

nmaludy commented 5 years ago

This might also address #157

At least if the service was dying we would know there was an error instead of having it logged and then continue on like there was no problem, even though the connection failed and the service isn't working.

arm4b commented 5 years ago

Thanks @nmaludy Let me try to reproduce it from the instructions https://github.com/StackStorm/st2/issues/4119

arm4b commented 5 years ago

@blag added the tests, per your request.