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

Error list index out of range AND max() arg is an empty sequence #212

Closed sankerust closed 6 years ago

sankerust commented 6 years ago

General model error image

Error message image


  File "D:\Projects\hastic-server\analytics\analytic_unit_manager.py", line 35, in handle_analytic_task
    result_payload = await worker.do_learn(payload['segments'], data, payload['cache'])
  File "D:\Projects\hastic-server\analytics\analytic_unit_worker.py", line 19, in do_learn
    return await self.detector.train(data, segments, cache)
  File "D:\Projects\hastic-server\analytics\detectors\pattern_detector.py", line 40, in train
    new_cache = self.model.fit(dataframe, segments, cache)
  File "D:\Projects\hastic-server\analytics\models\model.py", line 34, in fit
    self.do_fit(dataframe, segments)
  File "D:\Projects\hastic-server\analytics\models\general_model.py", line 50, in do_fit
    self.model_gen = utils.get_av_model(patterns_list)
  File "D:\Projects\hastic-server\analytics\utils\__init__.py", line 215, in get_av_model
    if len(patterns_list[1]) != x:
IndexError: list index out of range
'
2018-10-26 20:47:42,559 [Analytics] [INFO ]  Command is OK
2018-10-26 20:47:42,610 [Analytics] [ERROR]  handle_analytic_task exception: 'Traceback (most recent call last):
  File "D:\Projects\hastic-server\analytics\analytic_unit_manager.py", line 37, in handle_analytic_task
    result_payload = await worker.do_predict(data, payload['cache'])
  File "D:\Projects\hastic-server\analytics\analytic_unit_worker.py", line 22, in do_predict
    return await self.detector.predict(data, cache)
  File "D:\Projects\hastic-server\analytics\detectors\pattern_detector.py", line 47, in predict
    predicted = self.model.predict(dataframe, cache)
  File "D:\Projects\hastic-server\analytics\models\model.py", line 41, in predict
    result = self.do_predict(dataframe)
  File "D:\Projects\hastic-server\analytics\models\general_model.py", line 96, in do_predict
    y = max(pat_data)
ValueError: max() arg is an empty sequence```
jonyrock commented 6 years ago

@VargBurz Explanation why it happened necessary for closing task. Also tests.

VargBurz commented 6 years ago

https://github.com/hastic/hastic-server/issues/191

VargBurz commented 6 years ago

Fixed in https://github.com/hastic/hastic-server/pull/217