Bug #46549
closedModule 'diskprediction_local' has failed: Expected 2D array, got 1D array instead
0%
Description
A few weeks ago, after upgrading our Ceph cluster to 14.2.10, it went into `HEALTH_ERR` with the following ceph-mgr error:
```
2020-07-01 00:04:17.625 7f80b8021700 -1 log_channel(cluster) log [ERR] : Unhandled exception from module 'diskprediction_local' while running on mgr.gp3-c1mon-01: Expected 2D array, got 1D array instead:
2020-07-01 00:04:17.625 7f80b8021700 -1 log_channel(cluster) log [ERR] : array=[].
2020-07-01 00:04:17.625 7f80b8021700 -1 log_channel(cluster) log [ERR] : Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
2020-07-01 00:04:17.625 7f80b8021700 -1 diskprediction_local.serve:
2020-07-01 00:04:17.625 7f80b8021700 -1 Traceback (most recent call last):
File "/usr/share/ceph/mgr/diskprediction_local/module.py", line 99, in serve
self.predict_all_devices()
File "/usr/share/ceph/mgr/diskprediction_local/module.py", line 226, in predict_all_devices
result = self._predict_life_expentancy(devInfo['devid'])
File "/usr/share/ceph/mgr/diskprediction_local/module.py", line 171, in _predict_life_expentancy
predicted_result = obj_predictor.predict(predict_datas)
File "/usr/share/ceph/mgr/diskprediction_local/predictor.py", line 256, in predict
pred = clf.predict(ordered_data)
File "/usr/lib64/python2.7/site-packages/sklearn/svm/base.py", line 548, in predict
y = super(BaseSVC, self).predict(X)
File "/usr/lib64/python2.7/site-packages/sklearn/svm/base.py", line 308, in predict
X = self._validate_for_predict(X)
File "/usr/lib64/python2.7/site-packages/sklearn/svm/base.py", line 439, in _validate_for_predict
X = check_array(X, accept_sparse='csr', dtype=np.float64, order="C")
File "/usr/lib64/python2.7/site-packages/sklearn/utils/validation.py", line 441, in check_array
"if it contains a single sample.".format(array))
ValueError: Expected 2D array, got 1D array instead:
array=[].
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
```