{"action":"closed","issue":{"url":"https://api.github.com/repos/elasticfence/kaae/issues/34","repository_url":"https://api.github.com/repos/elasticfence/kaae","labels_url":"https://api.github.com/repos/elasticfence/kaae/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/elasticfence/kaae/issues/34/comments","events_url":"https://api.github.com/repos/elasticfence/kaae/issues/34/events","html_url":"https://github.com/elasticfence/kaae/issues/34","id":181300971,"number":34,"title":"Kibana stops running once a scheduled report kicks off after reinstall","user":{"login":"sethyes","id":17435794,"avatar_url":"https://avatars.githubusercontent.com/u/17435794?v=3","gravatar_id":"","url":"https://api.github.com/users/sethyes","html_url":"https://github.com/sethyes","followers_url":"https://api.github.com/users/sethyes/followers","following_url":"https://api.github.com/users/sethyes/following{/other_user}","gists_url":"https://api.github.com/users/sethyes/gists{/gist_id}","starred_url":"https://api.github.com/users/sethyes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethyes/subscriptions","organizations_url":"https://api.github.com/users/sethyes/orgs","repos_url":"https://api.github.com/users/sethyes/repos","events_url":"https://api.github.com/users/sethyes/events{/privacy}","received_events_url":"https://api.github.com/users/sethyes/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"lmangani","id":1423657,"avatar_url":"https://avatars.githubusercontent.com/u/1423657?v=3","gravatar_id":"","url":"https://api.github.com/users/lmangani","html_url":"https://github.com/lmangani","followers_url":"https://api.github.com/users/lmangani/followers","following_url":"https://api.github.com/users/lmangani/following{/other_user}","gists_url":"https://api.github.com/users/lmangani/gists{/gist_id}","starred_url":"https://api.github.com/users/lmangani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmangani/subscriptions","organizations_url":"https://api.github.com/users/lmangani/orgs","repos_url":"https://api.github.com/users/lmangani/repos","events_url":"https://api.github.com/users/lmangani/events{/privacy}","received_events_url":"https://api.github.com/users/lmangani/received_events","type":"User","site_admin":false},"assignees":[{"login":"lmangani","id":1423657,"avatar_url":"https://avatars.githubusercontent.com/u/1423657?v=3","gravatar_id":"","url":"https://api.github.com/users/lmangani","html_url":"https://github.com/lmangani","followers_url":"https://api.github.com/users/lmangani/followers","following_url":"https://api.github.com/users/lmangani/following{/other_user}","gists_url":"https://api.github.com/users/lmangani/gists{/gist_id}","starred_url":"https://api.github.com/users/lmangani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmangani/subscriptions","organizations_url":"https://api.github.com/users/lmangani/orgs","repos_url":"https://api.github.com/users/lmangani/repos","events_url":"https://api.github.com/users/lmangani/events{/privacy}","received_events_url":"https://api.github.com/users/lmangani/received_events","type":"User","site_admin":false}],"milestone":null,"comments":6,"created_at":"2016-10-06T00:51:33Z","updated_at":"2016-10-08T22:12:28Z","closed_at":"2016-10-08T22:12:28Z","body":"<!--\r\nThanks for taking time to report an issue. Please try to:\r\n\r\n* Be precise: describe expected results vs. actual results\r\n* Be clear: explain how to reproduce the problem, step by step\r\n* Include only one problem per report\r\n* Include details about your setup/system/os where possible\r\n\r\nThis section will NOT appear in your Issue report!\r\n-->\r\n\r\n\r\n1. Issue Description: Upon uninstall & reinstall of KaaE, a package appears to not fully reinstall correctly, as when a reporter runs, Kibana stops running. \r\n\r\nThe following logs elude to the issue;\r\n\r\nkibana.stdout\r\n\r\n    {\"type\":\"log\",\"@timestamp\":\"2016-10-06T00:21:00Z\",\"tags\":[\"status\",\"info\",\"KaaE\"],\"pid\":28607,\"message\":\"Executing watch: cluster_health_watch Next Round of cluster_health_watch at Wed Oct 05 2016 18:21:00 GMT-0600 (MDT)\"}\r\n    {\"type\":\"log\",\"@timestamp\":\"2016-10-06T00:21:00Z\",\"tags\":[\"status\",\"debug\",\"KaaE\",\"WATCHER DEBUG\"],\"pid\":28607,\"message\":\"{ _index: 'watcher',\\n  _type: 'watch',\\n  _id: 'cluster_health_watch',\\n  _score: 1,\\n  _source: \\n   { trigger: { schedule: [Object] },\\n     input: { search: [Object] },\\n     condition: { script: [Object] },\\n     transform: {},\\n     actions: { report_admin: [Object] } } }\"}\r\n\r\n    {\"type\":\"log\",\"@timestamp\":\"2016-10-06T00:21:00Z\",\"tags\":[\"status\",\"debug\",\"KaaE\"],\"pid\":28607,\"message\":\"Reloading Watchers...\"}\r\n    {\"type\":\"log\",\"@timestamp\":\"2016-10-06T00:21:00Z\",\"tags\":[\"status\",\"info\",\"KaaE\"],\"pid\":28607,\"message\":\"Executing watch: reporter_misses Next Round of reporter_misses at Wed Oct 05 2016 18:21:00 GMT-0600 (MDT)\"}\r\n\r\n    {\"type\":\"log\",\"@timestamp\":\"2016-10-06T00:21:00Z\",\"tags\":[\"status\",\"debug\",\"KaaE\",\"WATCHER DEBUG\"],\"pid\":28607,\"message\":\"{ _index: 'watcher',\\n  _type: 'watch',\\n  _id: 'reporter_misses',\\n  _score: 1,\\n  _source: \\n   { trigger: { schedule: [Object] },\\n     input: { search: [Object] },\\n     condition: {},\\n     transform: {},\\n     actions: { report_admin: [Object] } } }\"}\r\n\r\nkibana.stderr:\r\n\r\n    Unhandled rejection Error: spawn phantomjs ENOENT\r\n        at exports._errnoException (util.js:873:11)\r\n        at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)\r\n        at onErrorNT (internal/child_process.js:344:16)\r\n        at nextTickCallbackWith2Args (node.js:442:9)\r\n        at process._tickDomainCallback (node.js:397:17)\r\n    /opt/kibana/installedPlugins/kaae/server/lib/scheduler.js:93\r\n          var condition = watch.condition.script.script;\r\n                                                ^\r\n\r\n    TypeError: Cannot read property 'script' of undefined\r\n        at watching (/opt/kibana/installedPlugins/kaae/server/lib/scheduler.js:76:51)\r\n        at /opt/kibana/installedPlugins/kaae/server/lib/scheduler.js:64:69\r\n        at [object Object].scheduleTimeout [as _onTimeout] (/opt/kibana/installedPlugins/kaae/node_modules/later/later.js:846:9)\r\n        at Timer.listOnTimeout (timers.js:92:15)\r\n\r\nThe reporter causing the error (although I suspect they all are);\r\n\r\n    {\r\n      \"_index\": \"watcher\",\r\n      \"_type\": \"watch\",\r\n      \"_id\": \"cluster_health_watch\",\r\n      \"_score\": 1,\r\n      \"_source\": {\r\n        \"trigger\": {\r\n          \"schedule\": {\r\n            \"later\": \"every 3 minutes\"\r\n          }\r\n        },\r\n        \"input\": {\r\n          \"search\": {\r\n            \"request\": {\r\n              \"indices\": [\r\n                \"filebeat-*\"\r\n              ],\r\n              \"body\": {\r\n                \"query\": {\r\n                  \"template\": {\r\n                    \"inline\": {\r\n                      \"match\": {\r\n                        \"NginxResponse\": \"{{query_string}}\"\r\n                      }\r\n                    },\r\n                    \"params\": {\r\n                      \"query_string\": \"\\\"MISS\\\"\",\r\n                      \"filter\": {\r\n                        \"range\": {\r\n                          \"@timestamp\": {\r\n                            \"from\": \"now-7d\"\r\n                          }\r\n                        }\r\n                      }\r\n                    }\r\n                  }\r\n                },\r\n                \"aggs\": {\r\n                  \"sum_kbytes\": {\r\n                    \"sum\": {\r\n                      \"field\": \"KBytes\"\r\n                    }\r\n                  },\r\n                  \"avg_kbytes\": {\r\n                    \"avg\": {\r\n                      \"field\": \"KBytes\"\r\n                    }\r\n                  }\r\n                }\r\n              }\r\n            }\r\n          }\r\n        },\r\n        \"condition\": {\r\n          \"script\": {\r\n            \"script\": \"payload.hits.total > 0\"\r\n          }\r\n        },\r\n        \"transform\": {},\r\n        \"actions\": {\r\n          \"report_admin\": {\r\n            \"report\": {\r\n              \"to\": \"me@site.com\",\r\n              \"from\": \"Reports@site.com\",\r\n              \"subject\": \"Misses Test\",\r\n              \"priority\": \"high\",\r\n              \"body\": \"Total Misses: {{payload.hits.total}} , Totalling: {{payload.aggregations.sum_kbytes.value}} KB\",\r\n              \"snapshot\": {\r\n                \"res\": \"1420x1420\",\r\n                \"url\": \"http://google.com\",\r\n                \"path\": \"/tmp/\",\r\n                \"params\": {\r\n                  \"username\": \"username\",\r\n                  \"password\": \"userpass\",\r\n                  \"delay\": 5000,\r\n                  \"crop\": false\r\n                }\r\n              }\r\n            }\r\n          }\r\n        }\r\n      }\r\n    }\r\n\r\n2. Reproducing the Issue step-by-step\r\na. [Install KaaE](https://github.com/elasticfence/kaae#app-installation) \r\nb. [install a few additional npm packages](http://stackoverflow.com/questions/28062060/npm-start-returns-error-127-while-setting-up-angular-seed-application/39840878#39840878) (some snapshots failed to render visualizations until I'd install these)\r\nc. [Update config](https://github.com/elasticfence/kaae/wiki/KAAE-Config-Example#kaae-example-config) including kaae.json \r\nd. [Create a reporter ](https://github.com/elasticfence/kaae/wiki/KAAE-Report-Example#kaae-reports)(as in my case, it successfully ran until I attempted an uninstall/reinstall)\r\ne. [uninstall KaaE](https://github.com/elasticfence/kaae#dev-plugin-remove)\r\nf. reinstall KaaE (using same steps as before), your watchers should automatically show up unless you explicitly deleted them\r\ng. wait for a report to fire, for me, this is when Kibana would tip over\r\n\r\n\r\n3. Expected Results vs. Actual Results\r\n\r\n4. Additional Details\r\nI attempted this on two different machines, with the same result. The reason I initially attempted to reinstall was due to receiving bogus errors with later.js;\r\n\r\n<code>\r\n    Unhandled rejection Error: Missing schedule definition.\r\n    at Object.later.schedule     (/opt/kibana/installedPlugins/kaae/node_modules/later/later.js:622:23)\r\n▽\r\n        at Object.later.setTimeout (/opt/kibana/installedPlugins/kaae/node_modules/later/later.js:810:19)\r\n    at Object.later.setInterval (/opt/kibana/installedPlugins/kaae/node_modules/later/later.js:843:19)\r\n    at /opt/kibana/installedPlugins/kaae/server/lib/scheduler.js:64:45\r\n    at arrayEach (/opt/kibana/node_modules/lodash/index.js:1289:13)\r\n    at Function.<anonymous> (/opt/kibana/node_modules/lodash/index.js:3345:13)\r\n    at /opt/kibana/installedPlugins/kaae/server/lib/scheduler.js:37:9\r\n    at tryCatcher (/opt/kibana/node_modules/bluebird/js/main/util.js:26:23)\r\n    at Promise._settlePromiseFromHandler (/opt/kibana/node_modules/bluebird/js/main/promise.js:503:31)\r\n    at Promise._settlePromiseAt (/opt/kibana/node_modules/bluebird/js/main/promise.js:577:18)\r\n    at Promise._settlePromises (/opt/kibana/node_modules/bluebird/js/main/promise.js:693:14)\r\n    at Async._drainQueue (/opt/kibana/node_modules/bluebird/js/main/async.js:123:16)\r\n    at Async._drainQueues (/opt/kibana/node_modules/bluebird/js/main/async.js:133:10)\r\n    at Immediate.Async.drainQueues [as _onImmediate]     (/opt/kibana/node_modules/bluebird/js/main/async.js:15:14)\r\n    at processImmediate [as _immediateCallback] (timers.js:383:17)\r\n<!code>\r\n\r\n\r\nHowever a reinstall didn't help at all, as that's when I started seeing other issues, such as [watchers not clearing](https://github.com/elasticfence/kaae/issues/33) and this issue.\r\n\r\nOS: Ubuntu 14.04.3\r\nES: 2.4.1\r\nKibana: 4.6.1\r\n\r\nPlease let me know if I can assist in resolving this issue at all, I'm not great with angular.js but I will do my best to assist where I can.\r\n\r\nThanks for a great tool! I'm excited to get it working again. "}}
{"actor":{"display_login":"lmangani"}}