Search code examples
javacassandracqlcql3cqlsh

CQLSH Protocol Error proceeding from apparent version conflicts


I am running Cassandra 3.7 on an Ubuntu Server 16.04 LTS 32bit machine that I'm re-purposing from storage. I managed to properly configure the JVM to operate within the 32 bit environment. Nodetool status works fine. But I am having a hard time getting CQLSH to work. I end up with the following error:

('Unable to connect to any servers', {'127.0.0.1': ProtocolError("cql_version '3.4.2' is not supported by remote (w/ native protocol). Supported versions: [u'3.4.0']",)})

Obviously there is some version conflict here but I'm confused as to why and how to fix it. I had a previous 3.0 install of Cassandra that I configured cassanda-env.sh to properly start the JVM. I kept that .sh file when I installed up to 3.7. I updated cassandra.yaml with the new install.

So my question here is: does Cassandra 3.7 support CQL 3.4.2? If not then why does it appear to ship with it? If it does not, what do I need to do to downgrade to CQL 3.4.0? If it does support it and my configuration files are wrong then what's the error and how do I fix it? Or, is there another configuration that I'm completely missing here?

Here are my current configurations:

cassandra-env.sh: https://www.dropbox.com/s/dcs99hgry5behqd/cassandra-env.sh?dl=0 cassandra.yaml:https://www.dropbox.com/s/boi8bh7gin0390f/cassandra.yaml?dl=0

Any assistance greatly appreciated.

EDIT: Figured out, with the help of the first answer, that I had an older instance of the server running. I couldn't get it to start with the correct version...so then I deleted cassandra from /etc/init.d and now I can't get the debian package to automatically register the service.

EDIT2: Downloaded cassandra script from git repo and now cassandra will start again after rebooting. Now cassandra -v shows me:

3.7

Which what I wanted to see and solved my issue pertaining to the version conflict. But now unfortunately I see a new error:

Connection error: ('Unable to connect to any servers', {'127.0.0.1': TypeError('ref() does not take keyword arguments',)})

This problem is addressed in: cqlsh connection error: 'ref() does not take keyword arguments'


Solution

  • It looks like you're running the 3.7 cqlsh against an older server instance. First, be sure you are actually running Cassandra 3.7 (you can probably just check the jar path or look in the logs).

    If you want to connect using the advertised cql_version there is a command line option: https://github.com/apache/cassandra/blob/cassandra-3.7/bin/cqlsh.py#L222

    select release_version, cql_version from system.local;
    

    (or just look at the cqlsh welcome header) to see what these parameters are.