Bug 1417881

Summary: Metricd: TypeError: unique() got an unexpected keyword argument 'return_counts'
Product: Red Hat OpenStack Reporter: Yurii Prokulevych <yprokule>
Component: openstack-gnocchiAssignee: Mehdi ABAAKOUK <mabaakou>
Status: CLOSED ERRATA QA Contact: Sasha Smolyak <ssmolyak>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 11.0 (Ocata)CC: akrzos, apevec, fbaudin, jdanjou, jschluet, lhh, mabaakou, mburns, pkilambi
Target Milestone: betaKeywords: Triaged
Target Release: 11.0 (Ocata)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-gnocchi-3.1.2-3.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-17 19:44:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1432551    
Bug Blocks:    

Description Yurii Prokulevych 2017-01-31 11:09:34 UTC
Description of problem:
-----------------------
Traceback in gnocchi/metricd.log

2017-01-31 11:04:28.057 282641 DEBUG gnocchi.storage._carbonara [-] Processing measures for d7144bb9-8ac9-440f-964f-e45708a29b41 process_new_measures /usr/lib/python2.7/site-packages/gnocchi/storage/_carbonara.py:458
2017-01-31 11:04:28.064 282641 DEBUG gnocchi.storage._carbonara [-] Metric d7144bb9-8ac9-440f-964f-e45708a29b41 locked during 0.01 seconds process_new_measures /usr/lib/python2.7/site-packages/gnocchi/storage/_carbonara.py:466
2017-01-31 11:04:28.064 282641 ERROR gnocchi.storage._carbonara [-] Error processing new measures
2017-01-31 11:04:28.064 282641 ERROR gnocchi.storage._carbonara Traceback (most recent call last):
2017-01-31 11:04:28.064 282641 ERROR gnocchi.storage._carbonara   File "/usr/lib/python2.7/site-packages/gnocchi/storage/_carbonara.py", line 461, in process_new_measures
2017-01-31 11:04:28.064 282641 ERROR gnocchi.storage._carbonara     self._compute_and_store_timeseries(metric, measures)
2017-01-31 11:04:28.064 282641 ERROR gnocchi.storage._carbonara   File "/usr/lib/python2.7/site-packages/gnocchi/storage/_carbonara.py", line 538, in _compute_and_store_timeseries
2017-01-31 11:04:28.064 282641 ERROR gnocchi.storage._carbonara     ignore_too_old_timestamps=True)
2017-01-31 11:04:28.064 282641 ERROR gnocchi.storage._carbonara   File "/usr/lib/python2.7/site-packages/gnocchi/carbonara.py", line 229, in set_values
2017-01-31 11:04:28.064 282641 ERROR gnocchi.storage._carbonara     before_truncate_callback(self)
2017-01-31 11:04:28.064 282641 ERROR gnocchi.storage._carbonara   File "/usr/lib/python2.7/site-packages/gnocchi/storage/_carbonara.py", line 533, in _map_add_measures
2017-01-31 11:04:28.064 282641 ERROR gnocchi.storage._carbonara     for aggregation in agg_methods))
2017-01-31 11:04:28.064 282641 ERROR gnocchi.storage._carbonara   File "/usr/lib/python2.7/site-packages/gnocchi/storage/_carbonara.py", line 650, in _map_no_thread
2017-01-31 11:04:28.064 282641 ERROR gnocchi.storage._carbonara     return list(itertools.starmap(method, list_of_args))
2017-01-31 11:04:28.064 282641 ERROR gnocchi.storage._carbonara   File "/usr/lib/python2.7/site-packages/gnocchi/storage/_carbonara.py", line 332, in _add_measures
2017-01-31 11:04:28.064 282641 ERROR gnocchi.storage._carbonara     for key, split in ts.split():
2017-01-31 11:04:28.064 282641 ERROR gnocchi.storage._carbonara   File "/usr/lib/python2.7/site-packages/gnocchi/carbonara.py", line 470, in split
2017-01-31 11:04:28.064 282641 ERROR gnocchi.storage._carbonara     keys, counts = numpy.unique((ix // freq) * freq, return_counts=True)
2017-01-31 11:04:28.064 282641 ERROR gnocchi.storage._carbonara TypeError: unique() got an unexpected keyword argument 'return_counts'
2017-01-31 11:04:28.064 282641 ERROR gnocchi.storage._carbonara 



Version-Release number of selected component (if applicable):
-------------------------------------------------------------
puppet-gnocchi-10.1.0-0.20170121054618.765ff3f.el7ost.noarch
openstack-gnocchi-api-3.1.0-0.20170121210255.d06792b.el7ost.noarch
python-gnocchiclient-2.8.2-0.20170118224916.f14fe0e.el7ost.noarch
openstack-gnocchi-indexer-sqlalchemy-3.1.0-0.20170121210255.d06792b.el7ost.noarch
openstack-gnocchi-common-3.1.0-0.20170121210255.d06792b.el7ost.noarch
openstack-gnocchi-statsd-3.1.0-0.20170121210255.d06792b.el7ost.noarch
python-gnocchi-3.1.0-0.20170121210255.d06792b.el7ost.noarch
openstack-gnocchi-metricd-3.1.0-0.20170121210255.d06792b.el7ost.noarch


Steps to Reproduce:
-------------------
1. Deploy RHOS-11 (build 2017-01-24.2)
2. Set metricd workers and restart openstack-gnocchi-metricd
3. Create a resource with metrics
4. Start sending measures to metrics

Comment 1 Mehdi ABAAKOUK 2017-01-31 12:39:38 UTC
Gnocchi requires numpy>=1.9.0, if return_counts is not present this means numpy version is incorrect.

Comment 2 Yurii Prokulevych 2017-01-31 12:44:06 UTC
Packages from controller:

numpy-1.7.1-11.el7.x86_64
numpy-f2py-1.7.1-11.el7.x86_64

Comment 3 Mehdi ABAAKOUK 2017-01-31 12:54:59 UTC
When numpy 1.9 you can fall into: ERROR gnocchi.storage._carbonara ValueError: format number 1 of "<?, <d" is not recognized

We workaround that upstream in: https://review.openstack.org/#/c/425695/

Comment 4 Franck Baudin 2017-02-02 15:10:40 UTC
*** Bug 1416842 has been marked as a duplicate of this bug. ***

Comment 5 Julien Danjou 2017-02-07 15:14:26 UTC
The fix has been merged upstream and is in Gnocchi 3.1.0, so rebasing the package should fix it.

Comment 11 errata-xmlrpc 2017-05-17 19:44:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:1245