hastic-zzz / hastic-server

Hastic data management server for analyzing patterns and anomalies from Grafana
GNU General Public License v3.0
330 stars 23 forks source link

Websocket connectivity between server and analytics #814

Closed jonyrock-back closed 4 years ago

jonyrock-back commented 4 years ago

It's hard to support zmq on node.js side because of many reasons. last version zeromq.js supports only Node.js v.10.2+

all debug / production connectivity is removed and only websocket connection is available.

It fixes #753, #812 and #852 (closing port part)

Changes

Server

Analytics

Notes

Known issues

rozetko commented 4 years ago

Tried to test it, but failed. There are at least 2 problems:

Tested with 2 node versions:

python3.6 --version
Python 3.6.7

node -v
v11.15.0
python3.6 --version
Python 3.6.7

node -v
v8.16.0
jonyrock-back commented 4 years ago

@rozetko was it dev or prod build?

rozetko commented 4 years ago

@jonyrock-back dev

jonyrock-back commented 4 years ago

Looks like I have this issue here: https://github.com/babel/babel-loader/issues/170

rozetko commented 4 years ago

More logs from analytics:

2020-03-04 20:57:30,477 [Analytics] [DEBUG]  client - event = eof_received()
2020-03-04 20:57:30,534 [Analytics] [DEBUG]  Start handle_analytic_task with analytic unit: nv3eCrznaqm2yhJ6
2020-03-04 20:57:30,536 [Analytics] [DEBUG]  client - event = connection_lost(None)
2020-03-04 20:57:30,536 [Analytics] [DEBUG]  Analytics get task with type: LEARN for unit: nv3eCrznaqm2yhJ6
2020-03-04 20:57:30,537 [Analytics] [DEBUG]  client - state = CLOSED
2020-03-04 20:57:30,553 [Analytics] [DEBUG]  client x code = 1005, reason = [no reason]
2020-03-04 20:57:30,558 [Analytics] [DEBUG]  Start method fit for analytic unit nv3eCrznaqm2yhJ6
2020-03-04 20:57:30,587 [Analytics] [ERROR]  Task exception was never retrieved
future: <Task finished coro=<ServerService._on_message_to_thread() done, 
defined at bin/../analytics/services/server_service.py:87> exception=ConnectionClosedError('code = 1005 (no status code [internal]), no reason',)>Traceback (most recent call last):
  File "bin/../analytics/services/server_service.py", line 88, in _on_message_to_thread
    await self.__server_socket.send(message)
  File "/home/rozetko/.local/lib/python3.6/site-packages/websockets/protocol.py", line 555, in send
    await self.ensure_open()
  File "/home/rozetko/.local/lib/python3.6/site-packages/websockets/protocol.py", line 803, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1005 (no status code 
[internal]), no reason