ndelitski / rancher-alarms

Will kick your ass if found unhealthy service in Rancher environment
85 stars 20 forks source link

Missing variables: #{healthyState} #34

Open mavcr opened 7 years ago

mavcr commented 7 years ago

I'm using the template in the readme (Hey buddy! Your service #{serviceName} become #{healthyState}, direct link to the service #{serviceUrl}). When there is an unhealthy container it gives the following error:

8/24/2017 1:41:05 PM[ERROR] 2017-8-24 19:41:5:649 { [AssertionError: template has unresolved variables: 8/24/2017 1:41:05 PMtemplate: Hey buddy! Your service #{serviceName} become #{healthyState}, direct link to the service #{serviceUrl} 8/24/2017 1:41:05 PMmissing variables: #{healthyState}] 8/24/2017 1:41:05 PM name: 'AssertionError', 8/24/2017 1:41:05 PM actual: false, 8/24/2017 1:41:05 PM expected: true, 8/24/2017 1:41:05 PM operator: '==', 8/24/2017 1:41:05 PM message: 'template has unresolved variables:\ntemplate: Hey buddy! Your service #{serviceName} become #{healthyState}, direct link to the service #{serviceUrl}\nmissing variables: #{healthyState}', 8/24/2017 1:41:05 PM generatedMessage: false } AssertionError: template has unresolved variables: 8/24/2017 1:41:05 PMtemplate: Hey buddy! Your service #{serviceName} become #{healthyState}, direct link to the service #{serviceUrl} 8/24/2017 1:41:05 PMmissing variables: #{healthyState} 8/24/2017 1:41:05 PM at renderTemplate (/usr/src/app/src/render-template.es6:14:3) 8/24/2017 1:41:05 PM at SlackTarget.notify$ (/usr/src/app/src/notifications/slack.es6:23:13) 8/24/2017 1:41:05 PM at tryCatch (/usr/src/app/node_modules/babel-core/node_modules/regenerator/runtime.js:61:40) 8/24/2017 1:41:05 PM at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/src/app/node_modules/babel-core/node_modules/regenerator/runtime.js:328:22) 8/24/2017 1:41:05 PM at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/src/app/node_modules/babel-core/node_modules/regenerator/runtime.js:94:21) 8/24/2017 1:41:05 PM at invoke (/usr/src/app/node_modules/babel-core/node_modules/regenerator/runtime.js:136:37) 8/24/2017 1:41:05 PM at callInvokeWithMethodAndArg (/usr/src/app/node_modules/babel-core/node_modules/regenerator/runtime.js:172:16) 8/24/2017 1:41:05 PM at previousPromise (/usr/src/app/node_modules/babel-core/node_modules/regenerator/runtime.js:194:19) 8/24/2017 1:41:05 PM at new Promise (/usr/src/app/node_modules/babel-core/node_modules/core-js/modules/es6.promise.js:201:7) 8/24/2017 1:41:05 PM at AsyncIterator.enqueue (/usr/src/app/node_modules/babel-core/node_modules/regenerator/runtime.js:193:13) 8/24/2017 1:41:05 PM at AsyncIterator.prototype.(anonymous function) [as next] (/usr/src/app/node_modules/babel-core/node_modules/regenerator/runtime.js:94:21) 8/24/2017 1:41:05 PM at Object.runtime.async (/usr/src/app/node_modules/babel-core/node_modules/regenerator/runtime.js:215:14) 8/24/2017 1:41:05 PM at SlackTarget.notify (/usr/src/app/src/notifications/slack.es6:20:25) 8/24/2017 1:41:05 PM at ServiceStateMonitor.callee$2$0$ (/usr/src/app/src/monitor.es6:112:16) 8/24/2017 1:41:05 PM at tryCatch (/usr/src/app/node_modules/babel-core/node_modules/regenerator/runtime.js:61:40) 8/24/2017 1:41:05 PM at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/src/app/node_modules/babel-core/node_modules/regenerator/runtime.js:328:22) 8/24/2017 1:41:05 PM 8/24/2017 1:41:05 PMnpm ERR! Linux 4.12.7-1.el7.elrepo.x86_64 8/24/2017 1:41:05 PMnpm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start" 8/24/2017 1:41:05 PMnpm ERR! node v4.7.2 8/24/2017 1:41:05 PMnpm ERR! npm v2.15.11 8/24/2017 1:41:05 PMnpm ERR! code ELIFECYCLE 8/24/2017 1:41:05 PMnpm ERR! rancher-alarms@0.1.7 start: node bin/rancher-alarms.js 8/24/2017 1:41:05 PMnpm ERR! Exit status 1 8/24/2017 1:41:05 PMnpm ERR! 8/24/2017 1:41:05 PMnpm ERR! Failed at the rancher-alarms@0.1.7 start script 'node bin/rancher-alarms.js'. 8/24/2017 1:41:05 PMnpm ERR! This is most likely a problem with the rancher-alarms package, 8/24/2017 1:41:05 PMnpm ERR! not with npm itself. 8/24/2017 1:41:05 PMnpm ERR! Tell the author that this fails on your system: 8/24/2017 1:41:05 PMnpm ERR! node bin/rancher-alarms.js 8/24/2017 1:41:05 PMnpm ERR! You can get information on how to open an issue for this project with: 8/24/2017 1:41:05 PMnpm ERR! npm bugs rancher-alarms 8/24/2017 1:41:05 PMnpm ERR! Or if that isn't available, you can get their info via: 8/24/2017 1:41:05 PMnpm ERR! 8/24/2017 1:41:05 PMnpm ERR! npm owner ls rancher-alarms 8/24/2017 1:41:05 PMnpm ERR! There is likely additional logging output above. 8/24/2017 1:41:05 PM 8/24/2017 1:41:05 PMnpm ERR! Please include the following file with any support request: 8/24/2017 1:41:05 PMnpm ERR! /usr/src/app/npm-debug.log

Once I remove the variable healthyState it sends the message to Slack.

ndelitski commented 7 years ago

Thanks I'll investigate this