bitsensor / elastalert

ElastAlert that exposes REST API's for manipulating rules and alerts
https://bitsensor.io/
Other
367 stars 216 forks source link

Erro on start Elastalert server #145

Open renatofritola opened 4 years ago

renatofritola commented 4 years ago

When trying to start the elastalert server container the following error occurs:

`> @bitsensor/elastalert@2.0.1 start /opt/elastalert-server

sh ./scripts/start.sh 16:45:56.555Z INFO elastalert-server: Server: Stopping server /opt/elastalert-server/src/common/websocket.js:34 wss.clients.forEach(function (ws) { ^ TypeError: Cannot read property 'clients' of null at Timeout._onTimeout (/opt/elastalert-server/src/common/websocket.js:22:7) at listOnTimeout (internal/timers.js:531:17) at processTimers (internal/timers.js:475:7) `

I already reviewed the settings and all are correct.

Could you help me please?

naretto commented 4 years ago

Isn't this the same as https://github.com/bitsensor/elastalert/issues/131?

solution there:

https://github.com/bitsensor/elastalert/blob/2.0.1/src/common/websocket.js#L27 For me increasing of this timeout helped: command: [ "/bin/sh", "-c", "sed -i 's|10000|60000|' src/common/websocket.js && npm start"]

I believe this parameter has to be exposed to the application config instead of hardcoding.

selfisch commented 3 years ago

Hey there,

  1. Jan 2020 :-P I think the mentioned post is no solution, but a workaround.

Any chance to get this as env var to pass at startup or to get the timeout changed entirely?