gyselroth / kube-icinga

Monitor kubernetes services / resources using icinga2 (including autodiscovery support)
MIT License
35 stars 4 forks source link

UnhandledPromiseRejectionWarning: TypeError: result is not iterable #15

Closed aderumier closed 5 years ago

aderumier commented 5 years ago

Hi, I try to use kube-icinga, but pod is crashing at start with

info: start cleanup, removing all kubernetes objects from icinga
(node:1) UnhandledPromiseRejectionWarning: TypeError: result is not iterable
at Icinga.<anonymous> (/opt/kube-icinga/build/icinga.js:201:43)
at Generator.next (<anonymous>)
at /opt/kube-icinga/build/icinga.js:7:71
at new Promise (<anonymous>)
at __awaiter (/opt/kube-icinga/build/icinga.js:3:12)
at icingaClient.getServiceFiltered (/opt/kube-icinga/build/icinga.js:199:119)
at IncomingMessage.<anonymous> (/opt/kube-icinga/node_modules/icinga2-api/index.js:147:24)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:1) UnhandledPromiseRejectionWarning: TypeError: result is not iterable
at Icinga.<anonymous> (/opt/kube-icinga/build/icinga.js:209:40)
at Generator.next (<anonymous>)
at /opt/kube-icinga/build/icinga.js:7:71
at new Promise (<anonymous>)
at __awaiter (/opt/kube-icinga/build/icinga.js:3:12)
at icingaClient.getHostFiltered (/opt/kube-icinga/build/icinga.js:207:113)
at IncomingMessage.<anonymous> (/opt/kube-icinga/node_modules/icinga2-api/index.js:110:24)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

I'm seeing api call coming to incinga2 api, user/pass is ok. This inciga2 server is also use to monitor others servers not related to kubernetes

Environment

aderumier commented 5 years ago

ok, sorry, it's working with 2.0.1. It seem than the latest tag is yet on 2.0.1.

raffis commented 5 years ago

Thanks for the hint, i've pushed the latest tag and fixed an error in the travis build regarding the latest tag. (Note: you should use specific versions instead the latest tag anyway).