2

I'm trying to run cassandra's cqlsh under cygwin, and it exits without displaying an error:

/c/apps/apache-cassandra-2.0.9
>./bin/cqlsh

>

It looks like a python script:

#!/bin/sh
# -*- mode: Python -*-

...

# bash code here; finds a suitable python interpreter and execs this file.
# prefer unqualified "python" if suitable:
python -c 'import sys; sys.exit(not (0x020500b0 < sys.hexversion < 0x03000000))' 2>/dev/null \
    && exec python "$0" "$@"
for pyver in 2.6 2.7 2.5; do
    which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@"
done
echo "No appropriate python interpreter found." >&2
exit 1
":"""

I do have the python interpreter installed:

>python -V
Python 2.7.5

Is there a way to tell if there's some python library missing, or in some way see an error message that indicates what the problem is?

EDIT:

Output from bash -x:

>bash -x ./bin/cqlsh
+ :
+ python -c 'import sys; sys.exit(not (0x020500b0 < sys.hexversion < 0x03000000))'
+ exec python ./bin/cqlsh

EDIT: Value of sys.hexversion:

>python -c "import sys; print sys.hexversion"
34014704

EDIT:

>python -v ./bin/cqlsh 2>&1 | grep -v "^#" | grep -v "^import"
Python 2.7.5 (default, Oct  2 2013, 22:34:09)
[GCC 4.8.1] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
dlopen("/usr/lib/python2.7/lib-dynload/itertools.dll", 2);
dlopen("/usr/lib/python2.7/lib-dynload/_functools.dll", 2);
dlopen("/usr/lib/python2.7/lib-dynload/_ctypes.dll", 2);
dlopen("/usr/lib/python2.7/lib-dynload/_struct.dll", 2);

EDIT: strace results:

>strace -o /usr/bin/python ./bin/cqlsh
strace.exe: can't open /usr/bin/python: Permission denied

>ll /usr/bin/python2.7.exe
-rwxr-xr-x 1 dabrans2 Domain Users 7187 Oct  2  2013 /usr/bin/python2.7.exe*

strace -o /usr/bin/python ./bin/cqlsh
strace.exe: can't open /usr/bin/python: Permission denied

After that, I opened Explorer and double-clicked on python2.7.exe. Windows said, "C:\sygwin64\bin\python2.7.exe is not a valid Win32 application." However, python3.2m.exe runs just fine with a double-click. Perhaps uninstalling python 2.7 will fix the issue.

Don Branson
  • 13,631
  • 10
  • 59
  • 101
  • 1
    Try posting the output of `bash -x ./bin/cqlsh`. – the paul Jul 22 '14 at 14:36
  • @thepaul Done. Also printed the value of sys.hexversion. Is the script refusing to execute because the version of python is too new? If so, an error message would be nice. :) – Don Branson Jul 22 '14 at 17:02
  • Nope, that's all working right. sys.hexversion == 34014704 == 0x20705f0, which is an acceptable version. The check is only making sure it's not older than 2.5.0 or later than Python 3.0. So that behavior is bizarre. Try with `python -v ./bin/cqlsh` ? – the paul Jul 22 '14 at 17:10
  • For some reason, I expected that hexversion would be printed in hex. :) Okay, gathering more output... – Don Branson Jul 22 '14 at 17:12
  • with -v, it prints about 100 lines and quits. It's mostly imports and comments, but no errors. Shall I share all of it, or is there something specific I can look for? – Don Branson Jul 22 '14 at 17:14
  • I guess the part right before the clear/restore/cleanup lines would be the most interesting. I think I remember Cygwin also providing an `strace` tool that works like the Linux one; maybe also try running under that for some clues about why the process is just dying. – the paul Jul 22 '14 at 17:17
  • @thepaul I don't see any lines mentioning clear/restore/cleanup, so I've included everything but the comments and imports for starters. I'll add the strace output shortly... – Don Branson Jul 22 '14 at 17:33
  • Added strace output and some discovery... – Don Branson Jul 22 '14 at 17:42
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/57780/discussion-between-the-paul-and-don-branson). – the paul Jul 22 '14 at 17:45
  • Outcome of the discussion - i downgraded to cygwin32 and all seems to be working fine now. – Don Branson Jul 22 '14 at 21:03

0 Answers0