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

Unable to hastic-server or analytics : can't send message Request failed with status code 426 #937

Open gogovan-vincentngai opened 3 years ago

gogovan-vincentngai commented 3 years ago

Hey guys

Here is my dk-compose file in my mac

`version: '2.1' services: server: image: hastic/server:latest environment: HASTIC_API_KEY: eyJrIjoiVHlPaXZ6S2ljZmQxaWFWV3IyYTF3eGw4QThnd2I0U0ciLCJuIjoidGVtcCIsImlkIjoxfQ== GRAFANA_URL: http://192.168.1.173 HASTIC_ALERT_TYPE: ${HASTIC_ALERT_TYPE} HASTIC_ALERTMANAGER_URL: ${HASTIC_ALERTMANAGER_URL} HASTIC_WEBHOOK_URL: http://0.0.0.0:8002 HASTIC_INSTANCE_NAME: ${HASTIC_INSTANCE_NAME} HASTIC_ALERT_IMAGE: ${HASTIC_ALERT_IMAGE} HASTIC_DB_CONNECTION_STRING: ${HASTIC_DB_CONNECTION_STRING} HASTIC_DB_CONNECTION_TYPE: ${HASTIC_DB_CONNECTION_TYPE} HASTIC_TIMEZONE_OFFSET: ${HASTIC_TIMEZONE_OFFSET} HASTIC_SERVER_URL: ws://0.0.0.0:8002 HASTIC_PORT: 8000 ports:

volumes: data-volume:

networks: hastic-network:`

When i startup , it seems able to connect between server and analytics However it just say can't send message Request failed with status code 426

server_1 | Creating websocket server ... ws://0.0.0.0:8002 server_1 | Server is running on :8000 server_1 | starting data puller with [] analytic units server_1 | data puller started analytics_1 | 2020-11-12 09:05:17,528 [Analytics] [INFO ] Ok analytics_1 | 2020-11-12 09:05:17,528 [Analytics] [INFO ] Starting services... analytics_1 | 2020-11-12 09:05:17,528 [Analytics] [INFO ] Server... analytics_1 | 2020-11-12 09:05:17,531 [Analytics] [INFO ] Binding to ws://server:8002 ... analytics_1 | 2020-11-12 09:05:17,531 [Analytics] [INFO ] Ok analytics_1 | 2020-11-12 09:05:17,534 [Analytics] [INFO ] Data service... analytics_1 | 2020-11-12 09:05:17,534 [Analytics] [INFO ] Ok analytics_1 | 2020-11-12 09:05:17,534 [Analytics] [INFO ] Analytic unit manager... analytics_1 | 2020-11-12 09:05:17,534 [Analytics] [INFO ] Ok analytics_1 | 2020-11-12 09:05:17,535 [Analytics] [INFO ] Analytics process is running server_1 | Got new analytic connection server_1 | Start analytics pinger... server_1 | Analytics pinger started server_1 | Analytics is up server_1 | can't send message Request failed with status code 426

What am i missing ?

gogovan-vincentngai commented 3 years ago

I am not sure is it correct setup but somehow even it say cant send message

螢幕截圖 2020-11-12 下午6 00 05 螢幕截圖 2020-11-12 下午6 05 30

erver_1 | LEARNING started for d3WxbJUoJLY7BEWl server_1 | query time range: from Thu Nov 12 2020 08:58:20 GMT+0000 (UTC) to Thu Nov 12 2020 10:17:52 GMT+0000 (UTC) server_1 | run LEARN task, id:d3WxbJUoJLY7BEWl analytics_1 | 2020-11-12 10:18:07,380 [Analytics] [INFO ] Got LEARN task with id JVDOWE0kQSrPovZs, analyticUnitId d3WxbJUoJLY7BEWl analytics_1 | 2020-11-12 10:18:07,389 [Analytics] [ERROR] handle_analytic_task Exception: 'Traceback (most recent call last): analytics_1 | File "bin/../analytics/analytic_unit_manager.py", line 89, in handle_analytic_task analytics_1 | result_payload = await self.__handle_analytic_task(task) analytics_1 | File "bin/../analytics/analytic_unit_manager.py", line 72, in __handle_analytic_task analytics_1 | return await worker.do_train(segments, data, payload['cache']) analytics_1 | File "bin/../analytics/analytic_unit_worker.py", line 42, in do_train analytics_1 | new_cache: ModelCache = await asyncio.wait_for(self._training_future, timeout = config.LEARNING_TIMEOUT) analytics_1 | File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for analytics_1 | return fut.result() analytics_1 | File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run analytics_1 | result = self.fn(*self.args, **self.kwargs) analytics_1 | File "bin/../analytics/detectors/pattern_detector.py", line 58, in train analytics_1 | new_cache: models.ModelState = self.model.fit(dataframe, segments, self.analytic_unit_id) analytics_1 | File "bin/../analytics/models/model.py", line 160, in fit analytics_1 | self.find_segment_center analytics_1 | File "bin/../analytics/models/model.py", line 66, in __init__ analytics_1 | self.pattern_timestamp = dataframe['timestamp'][self.center_index] analytics_1 | File "/usr/local/lib/python3.6/site-packages/pandas/core/series.py", line 601, in __getitem__ analytics_1 | result = self.index.get_value(self, key) analytics_1 | File "/usr/local/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2474, in get_value analytics_1 | k = self._convert_scalar_indexer(k, kind='getitem') analytics_1 | File "/usr/local/lib/python3.6/site-packages/pandas/core/indexes/numeric.py", line 142, in _convert_scalar_indexer analytics_1 | ._convert_scalar_indexer(key, kind=kind)) analytics_1 | File "/usr/local/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 1319, in _convert_scalar_indexer analytics_1 | return self._invalid_indexer('label', key) analytics_1 | File "/usr/local/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 1519, in _invalid_indexer analytics_1 | kind=type(key))) analytics_1 | TypeError: cannot do label indexing on <class 'pandas.core.indexes.range.RangeIndex'> with these indexers [nan] of <class 'float'> analytics_1 | ' server_1 | Error: TypeError("cannot do label indexing on <class 'pandas.core.indexes.range.RangeIndex'> with these indexers [nan] of <class 'float'>",) server_1 | at /var/www/server/dist/server.js:11:164028 server_1 | at Generator.next (<anonymous>) server_1 | at s (/var/www/server/dist/server.js:11:158766) server_1 | at <anonymous>

jonyrock commented 3 years ago

we will try to research this next week....