Common problems and errors
I get an error 310
There was an error executing the query: error code: 310 error description: Query returned result error. line 0:-1 no viable alternative at input ‘
This means that Cassandra Driver was unable to understand the CQL query. Normally due to lack of url encoding.
For example instead of requesting:
http://127.0.0.1/cgi-bin/cud.py?cluster=127.0.0.1&user=test&password=test&keyspace=test&cql=SELECT * FROM mytable
Pass:
http://127.0.0.1/cgi-bin/cud.py?cluster=127.0.0.1&user=test&password=test&keyspace=test&cql=SELECT+*+FROM+mytable
PHP has a function named urlencode(); use one similar for the language you’re using before submitting the request to the driver.
I get an error 200: can’t connect to cluster
In this case the driver is not able to connect to your Cassandra cluster on 127.0.0.1. Check that the Cassandra is up an running there (ps ax | grep cassandra) and that there is no Firewall blocking the incoming connections.
I can’t see accents, ç ć and other specials characters
This is a common encoding problem. Be sure to send the data as UTF-8.
Be sure to show the data, if is a HTML page in charset UTF-8. That is accomplished by setting the appropriate header:
Content-Type: text/html; charset=utf-8
and with a META tag in HEAD:
<head>
<meta charset=”UTF-8″>
<title>PHP Cassandra Universal Driver Sample</title>
</head>
In the image attached some rows were inserted with a wrong encoding while others where inserted with the right UTF-8 charset.
Ensure your config is correct before going to Production in order to avoid storing garbage.
In the sample rows 1, 2, 5 were created with wrong encoding.