neerajk22 avatar image
neerajk22 asked Erick Ramirez answered

Cassandra.InvalidQueryException: 'unconfigured table'

Getting error Cassandra.InvalidQueryException: 'unconfigured table

Getting this exception while doing select operation, Insert operation works fine from code (Using latest cassandra C# driver and Apache Cassandra

Few observations around same.

1. This is observed for newly created. New tables are created in the same way as that of old tables.

2. Already checked case sensitivity.

3. tried with keyspace.tablename as well

4. preparing simple statement query - Select * from tableName. (Same code base works for old created tables but getting error for new tables.)

5. Query works fine from any editor/database explorer , issue with c# code only.

csharp driver
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered

In my experience, the most common cause of this exception:

InvalidQueryException: 'unconfigured table'

is when a node (or multiple nodes) has a stale or mismatched schema.

If you are programatically creating tables, there' a good chance that either:

  • the cluster gets into a schema disagreement because multiple DDL changes are executed in parallel, or
  • a node gets queried before the new table schema got the chance to propagate via gossip.

Schema changes are not immediate -- they get propagated to all nodes in the cluster via gossip so it takes several seconds (maybe up to 1 or 2 minutes) for all the nodes to agree on the new version. You need to make sure that all nodes in the cluster are in agreement for every single DDL statement before making another change.

If multiple developers/operators are performing schema changes, they need to coordinate amongst themselves to make sure they are not doing it in parallel. Cheers!

10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.