riptano / ccm

A script to easily create and destroy an Apache Cassandra cluster on localhost
Apache License 2.0
1.22k stars 303 forks source link

ccm json - Couldn't change permissions to use sstable2json #610

Open dins2k2 opened 7 years ago

dins2k2 commented 7 years ago

Getting this error while trying to see the json output of a sstable.

ccm node1 json -k test -c test "C:\Users\user1\Desktop\testjson.txt"

running WARN: Couldn't change permissions to use sstable2json. WARN: If it didn't work, you will have to do so manually. ['C:\Users\user1\.ccm\c2\node1\data0\test\test-71ff922070dc11e7864b5ff09c5396dc\mb-1-big-Data.db'] -- mb-1-big-Data.db ----- Traceback (most recent call last): File "E:\Studies\Cassandra\ccm\ccm-master\ccm.py", line 74, in cmd.run() File "E:\Studies\Cassandra\ccm\ccm-master\ccmlib\cmds\node_cmds.py", line 487, in run enumerate_keys=self.options.enumerate_keys) File "E:\Studies\Cassandra\ccm\ccm-master\ccmlib\node.py", line 885, in run_sstable2json subprocess.call(args, env=env, stdout=out_file) File "C:\Program Files\Python27\lib\subprocess.py", line 522, in call return Popen(*popenargs, **kwargs).wait() File "C:\Program Files\Python27\lib\subprocess.py", line 710, in init errread, errwrite) File "C:\Program Files\Python27\lib\subprocess.py", line 958, in _execute_child startupinfo) WindowsError: [Error 2] The system cannot find the file specified

Python 2.7, Windows 10

Thanks, Dinesh

ptnapoleon commented 7 years ago

What version of Cassandra is your ccm cluster?

dins2k2 commented 7 years ago

C* version 3.7

ptnapoleon commented 7 years ago

Cassandra 3.7 doesn't have sstable2json anymore, you'll want to use sstabledump. I'll change the command to print a warning to the user, when they try to run ccm node json on a cluster w/o the tool.

dins2k2 commented 7 years ago

I see ccm command shows

json - Call sstable2json/sstabledump on the sstables of this node

I do see the sstabledump tool under C:\Users\user1\.ccm\repository\3.7\tools\bin, still not getting the json output of a sstable.

But, I don't see the sstabledump tool under C:\Users\user1\.ccm\c2\node1\bin Am I missing something?

ptnapoleon commented 7 years ago

Okay, I see the issue now. ccm should be trying to run sstabledump out of .ccm\repository\3.7\tools\bin if sstable2json does not exist. The check if sstable2json exists, must be flawed in some way on Windows.

dins2k2 commented 7 years ago

I don't see sstable2json under .ccm\repository\3.7\tools\bin since it's been deprecated. So, it should try running with sstabledump. Are you planning fix this?

ptnapoleon commented 7 years ago

I don't see sstable2json under .ccm\repository\3.7\tools\bin since it's been deprecated. So, it should try running with sstabledump.

Yes, I agree, sorry if I was unclear.

Are you planning fix this?

It's a valid bug that should be fixed, but since it seems to only happen on Windows, and I don't have a windows box at the moment, it's not something I'm going to personally fix anytime soon. I would review/merge a PR that fixed it though, and will be keeping this issue open.

dins2k2 commented 7 years ago

Thanks Philip!

I copied the old C* version's (2.2.8) sstable2json files(sstable2json, sstable2json.bat) into .ccm\repository\3.7\tools\bin and tried running the ccm node json command, it worked.

I will consider this as a temporary workaround till you fix it.

ptnapoleon commented 7 years ago

I think the better workaround is just to run sstabledump directly. There's no guarantee that sstable2json will work on a post 3.0 cluster.

dins2k2 commented 7 years ago

Ok. I know it's a silly question. How should I run sstabledump directly through ccm on windows?

ptnapoleon commented 7 years ago

As you said in your original comment, the tool can be found at C:\Users\user1\.ccm\repository\3.7\tools\bin\sstabledump