How to resolve issue in Cassandra "ConfigurationException: Column family ID mismatch" - cassandra

We tried adding a new column to an existing table in Cassandra. It ended up giving an exception "org.apache.cassandra.exceptions.ConfigurationException: Column family ID mismatch".
When we execute the command "describe " --> New columns was added.
when we tried to insert the data --> it throws an exception that "the newly added column does NOT exist".
We tried to recreate the table by dropping it --> Table gets dropped but while recreating it says table already exists.
Seems like some issue with Cassandra sync.
I want this issue to be resolved without any need to restart the Cassandra Nodes.
Can someone suggest the right approach to resolve this?
Thanks.

The rolling restart of the cluster resolved this issue. Thanks.

Flushing memtables (nodetool flush) should resolve the issue.
Flushing does not require restarting cassandra whereas draining does.
See:
Column family ID mismatch during ALTER TABLE

Related

Push in existing local table failure (windows): InvalidRegionNumberException then IllegalArgumentException

I want to push data into an already existing table, single column family, no records.
I am using shc-core:1.1.1-2.1-s_2.11 on a windows machine. I have hbase 1.2.6 installed and use scala 2.11.8.
When I try to push data I got first the following error: org.apache.spark.sql.execution.datasources.hbase.InvalidRegionNumberException: Number of regions specified for new table must be greater than 3.
After following the advice of this link https://github.com/hortonworks-spark/shc/issues/249#issue-318285217, I added: HBaseTableCatalog.newTable -> "5" to my options.
It still failed but with: java.lang.IllegalArgumentException: Can not create a Path from a null string.
Following this link: https://github.com/hortonworks-spark/shc/issues/151#issuecomment-313800739, I added to my catalog: , "tableCoder":"PrimitiveType".
Still facing the same error.
I saw people are expecting some clarification about this issue (https://github.com/hortonworks-spark/shc/issues/249#issuecomment-463528032).
It is known issue and apparently it seems fixed (https://github.com/hortonworks-spark/shc/issues/155#issuecomment-315236736).
I do not know what to do next.
Is there a solution about this?

InvalidRequestException Keyspace keyspace1 does not exist

I'm trying to connect to a Datastax Community Edition server 2.1.2 via JDBC but I keep getting the following error no matter what I try to do, even when issuing a very basic command like select * from system_traces.events;
InvalidRequestException(why:Keyspace 'keyspace1' does not exist)
Issuing that same command via cqlsh works properly, so it seems to be a JDBC issue.
InvalidRequestException(why:Keyspace 'keyspace1' does not exist)
at org.apache.cassandra.cql.jdbc.CassandraConnection.<init>(CassandraConnection.java:229):229
at org.apache.cassandra.cql.jdbc.CassandraDriver.connect(CassandraDriver.java:92):92
at java.sql.DriverManager.getConnection(DriverManager.java:664):664
at java.sql.DriverManager.getConnection(DriverManager.java:270):270
at railo.commons.db.DBUtil.getConnection(DBUtil.java:109):109
at railo.runtime.db.DatasourceConnectionPool.loadDatasourceConnection(DatasourceConnectionPool.java:89):89
at railo.runtime.db.DatasourceConnectionPool.getDatasourceConnection(DatasourceConnectionPool.java:81):81
at railo.runtime.db.DatasourceManagerImpl.getConnection(DatasourceManagerImpl.java:65):65
at railo.runtime.tag.Query.executeDatasoure(Query.java:696):696 ...
Any ideas? TIA!
InvalidRequestException(why:Keyspace 'keyspace1' does not exist)
This exception means you are trying to query for a keyspace (in this case "Keyspace1") that hasn't yet been added to Cassandra. Try creating the keyspace before querying it.
You're probably doing a select (SELECT * FROM "Keyspace1"."Standard1") that you're not seeing or passing initialisation parameters to JDBC telling it to connect to Keyspace1. Verify that your code isn't looking for the non-existent keyspace by searching through the queries you have, specifically looking for Keyspace1 (or "Keyspace1" since in this case the keyspace name is case-sensitive).
On a side-note, "Keyspace1"."Standard1" tend to be the standard ks.cf pair used for cassandra examples so it would be good to scan your code for them to make sure that they are created before they are queried.

Apache Cassandra. UnavailableException While Trying to insert a record

I am very new to Cassandra, and some how configured it. I was following This Link
.
Everything was fine. But in the end when I am trying to insert a record, it gives me the following exception. Today since afternoon I am trying to fix this. Googled a lot, but could not reach anywhere.
Any help on this will be greatly appretiated.
[default#DEMO] set Users[1234][name] = scott;
null
UnavailableException()
at org.apache.cassandra.thrift.Cassandra$insert_result.read(Cassandra.java:16077)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
at org.apache.cassandra.thrift.Cassandra$Client.recv_insert(Cassandra.java:801)
at org.apache.cassandra.thrift.Cassandra$Client.insert(Cassandra.java:785)
at org.apache.cassandra.cli.CliClient.executeSet(CliClient.java:909)
at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:222)
at org.apache.cassandra.cli.CliMain.processStatementInteractive(CliMain.java:201)
at org.apache.cassandra.cli.CliMain.main(CliMain.java:328)
[default#DEMO]
Thank you
Achyuth
this is old one, I want to share my experience.
I had same issue when I was setting the qa environment. Every thing configured fine: including : cassandra-topology.properties. But the nodetool ring display the unknown DC value for all nodes since the default is set UNKNOWN. That told me that the cassandra-topology.properties is not right in some way. After tried several things still no luck, I decided to create my own cassandra-topology.properties file and re-type every thing with vi, then it starts fine.
So if you have issue, run nodetool ring first to see if the DC set is what it should be.

Unable to create keyspace in cassandra-cli

I have a simple single node cassandra setup (1.1.0) (default settings). Whenever I try to create a keyspace in cassandra-cli, I get the error:
[default#unknown] create keyspace tax;
org.apache.thrift.transport.TTransportException
In cassandra server log, the exception stacktrace:
ERROR 12:15:04,722 Exception in thread Thread[MigrationStage:1,5,main]
java.lang.AssertionError
at org.apache.cassandra.db.DefsTable.updateKeyspace(DefsTable.java:441)
at org.apache.cassandra.db.DefsTable.mergeKeyspaces(DefsTable.java:339)
at org.apache.cassandra.db.DefsTable.mergeSchema(DefsTable.java:269)
at org.apache.cassandra.service.MigrationManager$1.call(MigrationManager.java:214)
I tried deleting the contents in ./var/lib/cassandra/data and restarting the server and my mac, but still ending up with same issue.
Looks like the system keyspace was corrupted. Removing the data files from
/var/lib/cassandra/data
/var/lib/cassandra/commitlog
/var/lib/cassandra/saved_caches
and restarting the cassandra server fixed the issue. (The above directories are defined in $CASSANDRA_HOME/conf/cassandra.yaml)
Following is the flow while adding the keyspace to Cassandra.(As per comments in Cassandrda source code. Correct me if I am getting it wrong)
1) At first step it check if any new keyspaces were added.
2) At second step we check if there were any keyspaces re-created, in this context
re-created means that they were previously deleted but still exist in the low-level schema as empty keys
3) At final step we updating modified keyspaces and saving keyspaces drop them later.
While modifying Keyspace it calls to function "updateKeyspace" and here it seems if the keyspace metadata is corrupt it throws assertion error.
SO in your case it might be that you have deleted the same Keyspace and trying to recreate which was causing this issue or as you mentioned It was a Metadata corruption.

int object has no attribute replace when trying to run a CQL command in cassandra

I have a counter column family in cassandra. When i try to view the data from CQL i get an error even though there is data in the column family.
SELECT * from userstats;
Generates the following error:
'int' object has no attribute 'replace'
I can confirm that the data is in the column family and is working properly since I can view the data with the Datastax Opscenter data explorer.
It sounds like you're using an older version of cqlsh. Upgrading it (just copying the bin/cqlsh file from the Cassandra 1.1 branch head, along with everything under the pylib directory, into place) ought to solve this.
If it doesn't, running cqlsh with --debug would help a lot in diagnosing the problem.

Resources