You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Michael Shuler (JIRA)" <ji...@apache.org> on 2014/08/08 21:03:13 UTC

[jira] [Comment Edited] (CASSANDRA-7676) bin/cassandra should complain if $JAVA is empty or not an executable

    [ https://issues.apache.org/jira/browse/CASSANDRA-7676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14091156#comment-14091156 ] 

Michael Shuler edited comment on CASSANDRA-7676 at 8/8/14 7:02 PM:
-------------------------------------------------------------------

Since I poked at a dtest with this build of C*, I don't think this does actually work out correctly
{noformat}
(master)mshuler@hana:~/git/cassandra-dtest$ export MAX_HEAP_SIZE="1G"; export HEAP_NEWSIZE="256M"; NUM_TOKENS=32 PRINT_DEBUG=true nosetests --nocapture --nologcapture --verbosity=3 secondary_indexes_test.py
nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$']
bug3367_test (secondary_indexes_test.TestSecondaryIndexes) ... cluster ccm directory: /tmp/dtest-ajkROw
[node1 ERROR] java is not a valid java executable. Check JAVA_HOME and PATH environment variables.
ERROR
Error saving log: [Errno 2] No such file or directory: '/tmp/dtest-ajkROw/test/node1/logs/system.log'
removing ccm cluster test at: /tmp/dtest-ajkROw
ERROR
test_6924_dropping_cf (secondary_indexes_test.TestSecondaryIndexes) ... cluster ccm directory: /tmp/dtest-mG0pm8
SKIP: 2.0.10 < 2.1
removing ccm cluster test at: /tmp/dtest-mG0pm8
test_6924_dropping_ks (secondary_indexes_test.TestSecondaryIndexes) ... cluster ccm directory: /tmp/dtest-dIh4so
SKIP: 2.0.10 < 2.1
removing ccm cluster test at: /tmp/dtest-dIh4so
test_low_cardinality_indexes (secondary_indexes_test.TestSecondaryIndexes) ... cluster ccm directory: /tmp/dtest-7_IBiy
SKIP: 2.0.10 < 2.1
removing ccm cluster test at: /tmp/dtest-7_IBiy
test_list_indexes (secondary_indexes_test.TestSecondaryIndexesOnCollections) ... cluster ccm directory: /tmp/dtest-gyv2xS
SKIP: 2.0.10 < 2.1
removing ccm cluster test at: /tmp/dtest-gyv2xS
test_map_indexes (secondary_indexes_test.TestSecondaryIndexesOnCollections) ... cluster ccm directory: /tmp/dtest-P_7pxL
[node1 ERROR] java is not a valid java executable. Check JAVA_HOME and PATH environment variables.
ERROR
Error saving log: [Errno 2] No such file or directory: '/tmp/dtest-P_7pxL/test/node1/logs/system.log'
removing ccm cluster test at: /tmp/dtest-P_7pxL
ERROR
test_set_indexes (secondary_indexes_test.TestSecondaryIndexesOnCollections) ... cluster ccm directory: /tmp/dtest-GJJbSB
[node1 ERROR] java is not a valid java executable. Check JAVA_HOME and PATH environment variables.
ERROR
Error saving log: [Errno 2] No such file or directory: '/tmp/dtest-GJJbSB/test/node1/logs/system.log'
removing ccm cluster test at: /tmp/dtest-GJJbSB
ERROR

======================================================================
ERROR: bug3367_test (secondary_indexes_test.TestSecondaryIndexes)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mshuler/git/cassandra-dtest/secondary_indexes_test.py", line 17, in bug3367_test
    cursor = self.patient_cql_connection(node1).cursor()
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 280, in patient_cql_connection
    bypassed_exception=TSocket.TTransportException
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 72, in retry_till_success
    return fun(*args, **kwargs)
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 257, in cql_connection
    con = cql.connect(host, port, keyspace=keyspace, cql_version=version, user=user, password=password)
  File "/home/mshuler/git/cassandra-dbapi2/cql/connection.py", line 143, in connect
    consistency_level=consistency_level, transport=transport)
  File "/home/mshuler/git/cassandra-dbapi2/cql/connection.py", line 59, in __init__
    self.establish_connection()
  File "/home/mshuler/git/cassandra-dbapi2/cql/thrifteries.py", line 163, in establish_connection
    self.transport.open()
  File "/usr/lib/python2.7/dist-packages/thrift/transport/TTransport.py", line 261, in open
    return self.__trans.open()
  File "/usr/lib/python2.7/dist-packages/thrift/transport/TSocket.py", line 99, in open
    message=message)
TTransportException: Could not connect to 127.0.0.1:9160

======================================================================
ERROR: bug3367_test (secondary_indexes_test.TestSecondaryIndexes)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 212, in tearDown
    errors = list(self.__filter_errors([ msg for msg, i in node.grep_log("ERROR")]))
  File "/home/mshuler/git/ccm/ccmlib/node.py", line 238, in grep_log
    with open(self.logfilename()) as f:
IOError: [Errno 2] No such file or directory: '/tmp/dtest-ajkROw/test/node1/logs/system.log'

======================================================================
ERROR: test_map_indexes (secondary_indexes_test.TestSecondaryIndexesOnCollections)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mshuler/git/cassandra-dtest/secondary_indexes_test.py", line 404, in test_map_indexes
    cursor = self.patient_cql_connection(node1).cursor()
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 280, in patient_cql_connection
    bypassed_exception=TSocket.TTransportException
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 72, in retry_till_success
    return fun(*args, **kwargs)
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 257, in cql_connection
    con = cql.connect(host, port, keyspace=keyspace, cql_version=version, user=user, password=password)
  File "/home/mshuler/git/cassandra-dbapi2/cql/connection.py", line 143, in connect
    consistency_level=consistency_level, transport=transport)
  File "/home/mshuler/git/cassandra-dbapi2/cql/connection.py", line 59, in __init__
    self.establish_connection()
  File "/home/mshuler/git/cassandra-dbapi2/cql/thrifteries.py", line 163, in establish_connection
    self.transport.open()
  File "/usr/lib/python2.7/dist-packages/thrift/transport/TTransport.py", line 261, in open
    return self.__trans.open()
  File "/usr/lib/python2.7/dist-packages/thrift/transport/TSocket.py", line 99, in open
    message=message)
TTransportException: Could not connect to 127.0.0.1:9160

======================================================================
ERROR: test_map_indexes (secondary_indexes_test.TestSecondaryIndexesOnCollections)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 212, in tearDown
    errors = list(self.__filter_errors([ msg for msg, i in node.grep_log("ERROR")]))
  File "/home/mshuler/git/ccm/ccmlib/node.py", line 238, in grep_log
    with open(self.logfilename()) as f:
IOError: [Errno 2] No such file or directory: '/tmp/dtest-P_7pxL/test/node1/logs/system.log'

======================================================================
ERROR: test_set_indexes (secondary_indexes_test.TestSecondaryIndexesOnCollections)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mshuler/git/cassandra-dtest/secondary_indexes_test.py", line 312, in test_set_indexes
    cursor = self.patient_cql_connection(node1).cursor()
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 280, in patient_cql_connection
    bypassed_exception=TSocket.TTransportException
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 72, in retry_till_success
    return fun(*args, **kwargs)
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 257, in cql_connection
    con = cql.connect(host, port, keyspace=keyspace, cql_version=version, user=user, password=password)
  File "/home/mshuler/git/cassandra-dbapi2/cql/connection.py", line 143, in connect
    consistency_level=consistency_level, transport=transport)
  File "/home/mshuler/git/cassandra-dbapi2/cql/connection.py", line 59, in __init__
    self.establish_connection()
  File "/home/mshuler/git/cassandra-dbapi2/cql/thrifteries.py", line 163, in establish_connection
    self.transport.open()
  File "/usr/lib/python2.7/dist-packages/thrift/transport/TTransport.py", line 261, in open
    return self.__trans.open()
  File "/usr/lib/python2.7/dist-packages/thrift/transport/TSocket.py", line 99, in open
    message=message)
TTransportException: Could not connect to 127.0.0.1:9160

======================================================================
ERROR: test_set_indexes (secondary_indexes_test.TestSecondaryIndexesOnCollections)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 212, in tearDown
    errors = list(self.__filter_errors([ msg for msg, i in node.grep_log("ERROR")]))
  File "/home/mshuler/git/ccm/ccmlib/node.py", line 238, in grep_log
    with open(self.logfilename()) as f:
IOError: [Errno 2] No such file or directory: '/tmp/dtest-GJJbSB/test/node1/logs/system.log'

----------------------------------------------------------------------
Ran 7 tests in 32.037s

FAILED (SKIP=4, errors=6)
(master)mshuler@hana:~/git/cassandra-dtest$ echo $JAVA_HOME

(master)mshuler@hana:~/git/cassandra-dtest$ echo $PATH
/home/mshuler/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/mshuler/git/cassandra/bin:/home/mshuler/git/cassandra/tools/bin:/home/mshuler/git/automaton/bin:/home/mshuler/git/ccm
(master)mshuler@hana:~/git/cassandra-dtest$ java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
(master)mshuler@hana:~/git/cassandra-dtest$ which java
/usr/bin/java
(master)mshuler@hana:~/git/cassandra-dtest$
{noformat}

So in the above case, I'm hitting the second conditional.  Prior to that, the java check is properly getting {{JAVA=java}}.  The check is looking to see if {{./java}} is executable, which it is not, since it's not there.


was (Author: mshuler):
Since I poked at a dtest with this build of C*, I don't think this does actually work out correctly
{noformat}
(master)mshuler@hana:~/git/cassandra-dtest$ export MAX_HEAP_SIZE="1G"; export HEAP_NEWSIZE="256M"; NUM_TOKENS=32 PRINT_DEBUG=true nosetests --nocapture --nologcapture --verbosity=3 secondary_indexes_test.py
nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$']
bug3367_test (secondary_indexes_test.TestSecondaryIndexes) ... cluster ccm directory: /tmp/dtest-ajkROw
[node1 ERROR] java is not a valid java executable. Check JAVA_HOME and PATH environment variables.
ERROR
Error saving log: [Errno 2] No such file or directory: '/tmp/dtest-ajkROw/test/node1/logs/system.log'
removing ccm cluster test at: /tmp/dtest-ajkROw
ERROR
test_6924_dropping_cf (secondary_indexes_test.TestSecondaryIndexes) ... cluster ccm directory: /tmp/dtest-mG0pm8
SKIP: 2.0.10 < 2.1
removing ccm cluster test at: /tmp/dtest-mG0pm8
test_6924_dropping_ks (secondary_indexes_test.TestSecondaryIndexes) ... cluster ccm directory: /tmp/dtest-dIh4so
SKIP: 2.0.10 < 2.1
removing ccm cluster test at: /tmp/dtest-dIh4so
test_low_cardinality_indexes (secondary_indexes_test.TestSecondaryIndexes) ... cluster ccm directory: /tmp/dtest-7_IBiy
SKIP: 2.0.10 < 2.1
removing ccm cluster test at: /tmp/dtest-7_IBiy
test_list_indexes (secondary_indexes_test.TestSecondaryIndexesOnCollections) ... cluster ccm directory: /tmp/dtest-gyv2xS
SKIP: 2.0.10 < 2.1
removing ccm cluster test at: /tmp/dtest-gyv2xS
test_map_indexes (secondary_indexes_test.TestSecondaryIndexesOnCollections) ... cluster ccm directory: /tmp/dtest-P_7pxL
[node1 ERROR] java is not a valid java executable. Check JAVA_HOME and PATH environment variables.
ERROR
Error saving log: [Errno 2] No such file or directory: '/tmp/dtest-P_7pxL/test/node1/logs/system.log'
removing ccm cluster test at: /tmp/dtest-P_7pxL
ERROR
test_set_indexes (secondary_indexes_test.TestSecondaryIndexesOnCollections) ... cluster ccm directory: /tmp/dtest-GJJbSB
[node1 ERROR] java is not a valid java executable. Check JAVA_HOME and PATH environment variables.
ERROR
Error saving log: [Errno 2] No such file or directory: '/tmp/dtest-GJJbSB/test/node1/logs/system.log'
removing ccm cluster test at: /tmp/dtest-GJJbSB
ERROR

======================================================================
ERROR: bug3367_test (secondary_indexes_test.TestSecondaryIndexes)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mshuler/git/cassandra-dtest/secondary_indexes_test.py", line 17, in bug3367_test
    cursor = self.patient_cql_connection(node1).cursor()
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 280, in patient_cql_connection
    bypassed_exception=TSocket.TTransportException
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 72, in retry_till_success
    return fun(*args, **kwargs)
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 257, in cql_connection
    con = cql.connect(host, port, keyspace=keyspace, cql_version=version, user=user, password=password)
  File "/home/mshuler/git/cassandra-dbapi2/cql/connection.py", line 143, in connect
    consistency_level=consistency_level, transport=transport)
  File "/home/mshuler/git/cassandra-dbapi2/cql/connection.py", line 59, in __init__
    self.establish_connection()
  File "/home/mshuler/git/cassandra-dbapi2/cql/thrifteries.py", line 163, in establish_connection
    self.transport.open()
  File "/usr/lib/python2.7/dist-packages/thrift/transport/TTransport.py", line 261, in open
    return self.__trans.open()
  File "/usr/lib/python2.7/dist-packages/thrift/transport/TSocket.py", line 99, in open
    message=message)
TTransportException: Could not connect to 127.0.0.1:9160

======================================================================
ERROR: bug3367_test (secondary_indexes_test.TestSecondaryIndexes)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 212, in tearDown
    errors = list(self.__filter_errors([ msg for msg, i in node.grep_log("ERROR")]))
  File "/home/mshuler/git/ccm/ccmlib/node.py", line 238, in grep_log
    with open(self.logfilename()) as f:
IOError: [Errno 2] No such file or directory: '/tmp/dtest-ajkROw/test/node1/logs/system.log'

======================================================================
ERROR: test_map_indexes (secondary_indexes_test.TestSecondaryIndexesOnCollections)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mshuler/git/cassandra-dtest/secondary_indexes_test.py", line 404, in test_map_indexes
    cursor = self.patient_cql_connection(node1).cursor()
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 280, in patient_cql_connection
    bypassed_exception=TSocket.TTransportException
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 72, in retry_till_success
    return fun(*args, **kwargs)
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 257, in cql_connection
    con = cql.connect(host, port, keyspace=keyspace, cql_version=version, user=user, password=password)
  File "/home/mshuler/git/cassandra-dbapi2/cql/connection.py", line 143, in connect
    consistency_level=consistency_level, transport=transport)
  File "/home/mshuler/git/cassandra-dbapi2/cql/connection.py", line 59, in __init__
    self.establish_connection()
  File "/home/mshuler/git/cassandra-dbapi2/cql/thrifteries.py", line 163, in establish_connection
    self.transport.open()
  File "/usr/lib/python2.7/dist-packages/thrift/transport/TTransport.py", line 261, in open
    return self.__trans.open()
  File "/usr/lib/python2.7/dist-packages/thrift/transport/TSocket.py", line 99, in open
    message=message)
TTransportException: Could not connect to 127.0.0.1:9160

======================================================================
ERROR: test_map_indexes (secondary_indexes_test.TestSecondaryIndexesOnCollections)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 212, in tearDown
    errors = list(self.__filter_errors([ msg for msg, i in node.grep_log("ERROR")]))
  File "/home/mshuler/git/ccm/ccmlib/node.py", line 238, in grep_log
    with open(self.logfilename()) as f:
IOError: [Errno 2] No such file or directory: '/tmp/dtest-P_7pxL/test/node1/logs/system.log'

======================================================================
ERROR: test_set_indexes (secondary_indexes_test.TestSecondaryIndexesOnCollections)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mshuler/git/cassandra-dtest/secondary_indexes_test.py", line 312, in test_set_indexes
    cursor = self.patient_cql_connection(node1).cursor()
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 280, in patient_cql_connection
    bypassed_exception=TSocket.TTransportException
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 72, in retry_till_success
    return fun(*args, **kwargs)
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 257, in cql_connection
    con = cql.connect(host, port, keyspace=keyspace, cql_version=version, user=user, password=password)
  File "/home/mshuler/git/cassandra-dbapi2/cql/connection.py", line 143, in connect
    consistency_level=consistency_level, transport=transport)
  File "/home/mshuler/git/cassandra-dbapi2/cql/connection.py", line 59, in __init__
    self.establish_connection()
  File "/home/mshuler/git/cassandra-dbapi2/cql/thrifteries.py", line 163, in establish_connection
    self.transport.open()
  File "/usr/lib/python2.7/dist-packages/thrift/transport/TTransport.py", line 261, in open
    return self.__trans.open()
  File "/usr/lib/python2.7/dist-packages/thrift/transport/TSocket.py", line 99, in open
    message=message)
TTransportException: Could not connect to 127.0.0.1:9160

======================================================================
ERROR: test_set_indexes (secondary_indexes_test.TestSecondaryIndexesOnCollections)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mshuler/git/cassandra-dtest/dtest.py", line 212, in tearDown
    errors = list(self.__filter_errors([ msg for msg, i in node.grep_log("ERROR")]))
  File "/home/mshuler/git/ccm/ccmlib/node.py", line 238, in grep_log
    with open(self.logfilename()) as f:
IOError: [Errno 2] No such file or directory: '/tmp/dtest-GJJbSB/test/node1/logs/system.log'

----------------------------------------------------------------------
Ran 7 tests in 32.037s

FAILED (SKIP=4, errors=6)
(master)mshuler@hana:~/git/cassandra-dtest$ echo $JAVA_HOME

(master)mshuler@hana:~/git/cassandra-dtest$ echo $PATH
/home/mshuler/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/mshuler/git/cassandra/bin:/home/mshuler/git/cassandra/tools/bin:/home/mshuler/git/automaton/bin:/home/mshuler/git/ccm
(master)mshuler@hana:~/git/cassandra-dtest$ java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
(master)mshuler@hana:~/git/cassandra-dtest$ which java
/usr/bin/java
(master)mshuler@hana:~/git/cassandra-dtest$
{noformat}

> bin/cassandra should complain if $JAVA is empty or not an executable
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-7676
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7676
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Robert Stupp
>            Assignee: Robert Stupp
>            Priority: Trivial
>         Attachments: java_not_found-fix.txt
>
>
> If JAVA_HOME points to a non-existing directory, bin/cassandra just complains with {{[node1 ERROR] /Users/snazy/.ccm/test/node1/bin/cassandra: line 151: exec: : not found}} (via ccm).
> Patch checks if {{$JAVA}} is empty or does not point to an executable and prints appropriate error message.
> (Patch against trunk)



--
This message was sent by Atlassian JIRA
(v6.2#6252)