I was having issues running this in a multi-datacenter environment using cassandra 2.1.13. I think the regex pattern was missing a colon, since '?:' specifies a non-capturing group but the pattern misses the fact that there is a colon in the output of nodetool gossipinfo:
akonkol@cass01dv2:~/cassandra_range_repair/src$ ./range_repair.py --keyspace=casshub --verbose --debug --workers=1 --datacenter=datacenter1 --logfile=pyrepair
Traceback (most recent call last):
File "./range_repair.py", line 401, in
main()
File "./range_repair.py", line 397, in main
repair(options)
File "./range_repair.py", line 278, in repair
tokens = Token_Container(options)
File "./range_repair.py", line 38, in init
self.check_for_MD5_tokens()
File "./range_repair.py", line 75, in check_for_MD5_tokens
if not self.ring_tokens[0] < 0:
IndexError: list index out of range
2016-06-01 23:08:29,525 - DEBUG - Determining local ring members
2016-06-01 23:08:29,525 - DEBUG - run_command: nodetool -h cass01dv2 gossipinfo
2016-06-01 23:08:30,754 - INFO - Local nodes:
2016-06-01 23:08:30,755 - DEBUG - run_command: nodetool -h cass01dv2 info -T
2016-06-01 23:08:32,093 - DEBUG - 32 host tokens found
2016-06-01 23:08:32,093 - INFO - running nodetool ring, this will take a little bit of time
2016-06-01 23:08:32,094 - DEBUG - run_command: nodetool -h cass01dv2 ring
2016-06-01 23:08:33,392 - DEBUG - ring tokens found, creating ring token list...
2016-06-01 23:08:33,393 - DEBUG - Discarding:
--cut--
016-06-01 23:08:33,399 - DEBUG - Discarding:
2016-06-01 23:08:33,399 - INFO - Found 0 tokens
I was having issues running this in a multi-datacenter environment using cassandra 2.1.13. I think the regex pattern was missing a colon, since '?:' specifies a non-capturing group but the pattern misses the fact that there is a colon in the output of nodetool gossipinfo:
Original regex New regex
akonkol@cass01dv2:~/cassandra_range_repair/src$ ./range_repair.py --keyspace=casshub --verbose --debug --workers=1 --datacenter=datacenter1 --logfile=pyrepair Traceback (most recent call last): File "./range_repair.py", line 401, in
main()
File "./range_repair.py", line 397, in main
repair(options)
File "./range_repair.py", line 278, in repair
tokens = Token_Container(options)
File "./range_repair.py", line 38, in init
self.check_for_MD5_tokens()
File "./range_repair.py", line 75, in check_for_MD5_tokens
if not self.ring_tokens[0] < 0:
IndexError: list index out of range
2016-06-01 23:08:29,525 - DEBUG - Determining local ring members 2016-06-01 23:08:29,525 - DEBUG - run_command: nodetool -h cass01dv2 gossipinfo 2016-06-01 23:08:30,754 - INFO - Local nodes: 2016-06-01 23:08:30,755 - DEBUG - run_command: nodetool -h cass01dv2 info -T 2016-06-01 23:08:32,093 - DEBUG - 32 host tokens found 2016-06-01 23:08:32,093 - INFO - running nodetool ring, this will take a little bit of time 2016-06-01 23:08:32,094 - DEBUG - run_command: nodetool -h cass01dv2 ring 2016-06-01 23:08:33,392 - DEBUG - ring tokens found, creating ring token list... 2016-06-01 23:08:33,393 - DEBUG - Discarding: --cut-- 016-06-01 23:08:33,399 - DEBUG - Discarding: 2016-06-01 23:08:33,399 - INFO - Found 0 tokens