graphite-project / carbonate

Utilities for managing graphite clusters
MIT License
516 stars 80 forks source link

call to ConsistentHashRing with wrong args #85

Closed ikod closed 7 years ago

ikod commented 7 years ago

carbonate 1.0.2, carbon - master

# carbon-lookup abc
Traceback (most recent call last):
  File "/usr/local/bin/carbon-lookup", line 10, in <module>
    load_entry_point('carbonate==1.0.2', 'console_scripts', 'carbon-lookup')()
  File "/usr/local/lib/python2.7/dist-packages/carbonate/cli.py", line 85, in carbon_lookup
    cluster = Cluster(config, args.cluster)
  File "/usr/local/lib/python2.7/dist-packages/carbonate/cluster.py", line 36, in __init__
    r.ring = ConsistentHashRing(hash_type=config.hashing_type(cluster))
TypeError: __init__() takes at least 2 arguments (2 given)

The problem is in lines (carbonate/cluster.py)

34         args = inspect.getargspec(ConsistentHashRing.__init__).args
35         if 'hash_type' in args:
36             r.ring = ConsistentHashRing(hash_type=config.hashing_type(cluster))

while in master carbon (/opt/graphite/lib/carbon/hashing.py):

26 class ConsistentHashRing:
27   def __init__(self, nodes, replica_count=100, hash_type='carbon_ch'):
28     self.ring = []

As workaround I commented out lines 35,36 in cluster.py It it problem in my setup or in carbonite?

Thanks!

olevchyk commented 7 years ago

got the same error. proposed fix in https://github.com/graphite-project/carbonate/pull/87 not sure if we can pass nodes as empty list but it seems to be working.

deniszh commented 7 years ago

Should be fixed now, thanks to @olevchyk