You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Charlie Andrews <ch...@gmail.com> on 2013/12/02 20:51:01 UTC

Table Creation Error

Hi all,

When I try to create a new table, I get the following error:

cqlsh:userdata> CREATE TABLE "f6f5e6a90a90a7ebb69d84a3d6f807" (item_id uuid PRIMARY KEY);
TSocket read 0 bytes

This error means nothing to me, so I check the logs that were created and I get the error, ‘Cannot modify index name’ multiple times in the stack trace that is spit out: 

 INFO [Thrift:16] 2013-12-02 19:49:58,769 MigrationManager.java (line 231) Create new ColumnFamily: org.apache.cassandra.config.CFMetaData@481b22c4[cfId=78919d85-88fd-358d-884e-c44d913e6642,ksName=userdata,cfName=f6f5e6a90a90a7ebb69d84a3d6f807,cfType=Standard,comparator=org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.UTF8Type),comment=,readRepairChance=0.1,dclocalReadRepairChance=0.0,replicateOnWrite=true,gcGraceSeconds=864000,defaultValidator=org.apache.cassandra.db.marshal.BytesType,keyValidator=org.apache.cassandra.db.marshal.UUIDType,minCompactionThreshold=4,maxCompactionThreshold=32,column_metadata={java.nio.HeapByteBuffer[pos=0 lim=7 cap=7]=ColumnDefinition{name=6974656d5f6964, validator=org.apache.cassandra.db.marshal.UUIDType, type=PARTITION_KEY, componentIndex=null, indexName=null, indexType=null}},compactionStrategyClass=class org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy,compactionStrategyOptions={},compressionOptions={sstable_compression=org.apache.cassandra.io.compress.LZ4Compressor},bloomFilterFpChance=0.01,memtable_flush_period_in_ms=0,caching=KEYS_ONLY,defaultTimeToLive=0,speculative_retry=99.0PERCENTILE,indexInterval=128,populateIoCacheOnFlush=false,droppedColumns={},triggers={}]
 INFO [MigrationStage:1] 2013-12-02 19:49:58,781 ColumnFamilyStore.java (line 734) Enqueuing flush of Memtable-schema_columnfamilies@1837602519(1921/9515 serialized/live bytes, 25 ops)
 INFO [FlushWriter:55] 2013-12-02 19:49:58,782 Memtable.java (line 328) Writing Memtable-schema_columnfamilies@1837602519(1921/9515 serialized/live bytes, 25 ops)
 INFO [FlushWriter:55] 2013-12-02 19:49:58,794 Memtable.java (line 366) Completed flushing /var/lib/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-jb-183-Data.db (852 bytes) for commitlog position ReplayPosition(segmentId=1384553111306, position=32142921)
 INFO [MigrationStage:1] 2013-12-02 19:49:58,796 ColumnFamilyStore.java (line 734) Enqueuing flush of Memtable-schema_columns@842693139(508/2874 serialized/live bytes, 7 ops)
 INFO [FlushWriter:55] 2013-12-02 19:49:58,796 Memtable.java (line 328) Writing Memtable-schema_columns@842693139(508/2874 serialized/live bytes, 7 ops)
 INFO [FlushWriter:55] 2013-12-02 19:49:58,806 Memtable.java (line 366) Completed flushing /var/lib/cassandra/data/system/schema_columns/system-schema_columns-jb-183-Data.db (255 bytes) for commitlog position ReplayPosition(segmentId=1384553111306, position=32142921)
 INFO [MigrationStage:1] 2013-12-02 19:49:58,946 DefsTables.java (line 341) Loading org.apache.cassandra.config.CFMetaData@6c61cd53[cfId=78919d85-88fd-358d-884e-c44d913e6642,ksName=userdata,cfName=f6f5e6a90a90a7ebb69d84a3d6f807,cfType=Standard,comparator=org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.UTF8Type),comment=,readRepairChance=0.1,dclocalReadRepairChance=0.0,replicateOnWrite=true,gcGraceSeconds=864000,defaultValidator=org.apache.cassandra.db.marshal.BytesType,keyValidator=org.apache.cassandra.db.marshal.UUIDType,minCompactionThreshold=4,maxCompactionThreshold=32,column_metadata={java.nio.HeapByteBuffer[pos=0 lim=7 cap=7]=ColumnDefinition{name=6974656d5f6964, validator=org.apache.cassandra.db.marshal.UUIDType, type=PARTITION_KEY, componentIndex=null, indexName=null, indexType=null}},compactionStrategyClass=class org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy,compactionStrategyOptions={},compressionOptions={sstable_compression=org.apache.cassandra.io.compress.LZ4Compressor},bloomFilterFpChance=0.01,memtable_flush_period_in_ms=0,caching=KEYS_ONLY,defaultTimeToLive=0,speculative_retry=99.0PERCENTILE,indexInterval=128,populateIoCacheOnFlush=false,droppedColumns={},triggers={}]
 INFO [MigrationStage:1] 2013-12-02 19:49:58,950 ColumnFamilyStore.java (line 251) Initializing userdata.f6f5e6a90a90a7ebb69d84a3d6f807
ERROR [MigrationStage:1] 2013-12-02 19:49:58,953 CassandraDaemon.java (line 187) Exception in thread Thread[MigrationStage:1,5,main]
java.lang.RuntimeException: org.apache.cassandra.exceptions.ConfigurationException: Cannot modify index name
	at org.apache.cassandra.config.CFMetaData.reload(CFMetaData.java:983)
	at org.apache.cassandra.db.DefsTables.updateColumnFamily(DefsTables.java:377)
	at org.apache.cassandra.db.DefsTables.mergeColumnFamilies(DefsTables.java:318)
	at org.apache.cassandra.db.DefsTables.mergeSchema(DefsTables.java:183)
	at org.apache.cassandra.service.MigrationManager$2.runMayThrow(MigrationManager.java:305)
	at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
Caused by: org.apache.cassandra.exceptions.ConfigurationException: Cannot modify index name
	at org.apache.cassandra.config.ColumnDefinition.apply(ColumnDefinition.java:274)
	at org.apache.cassandra.config.CFMetaData.apply(CFMetaData.java:1040)
	at org.apache.cassandra.config.CFMetaData.reload(CFMetaData.java:979)
	... 10 more
ERROR [Thrift:16] 2013-12-02 19:49:58,953 CustomTThreadPoolServer.java (line 212) Error occurred during processing of message.
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: org.apache.cassandra.exceptions.ConfigurationException: Cannot modify index name
	at org.apache.cassandra.utils.FBUtilities.waitOnFuture(FBUtilities.java:413)
	at org.apache.cassandra.service.MigrationManager.announce(MigrationManager.java:287)
	at org.apache.cassandra.service.MigrationManager.announceNewColumnFamily(MigrationManager.java:232)
	at org.apache.cassandra.cql3.statements.CreateTableStatement.announceMigration(CreateTableStatement.java:114)
	at org.apache.cassandra.cql3.statements.SchemaAlteringStatement.execute(SchemaAlteringStatement.java:71)
	at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:129)
	at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:145)
	at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:136)
	at org.apache.cassandra.thrift.CassandraServer.execute_cql3_query(CassandraServer.java:1936)
	at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResult(Cassandra.java:4394)
	at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResult(Cassandra.java:4378)
	at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
	at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
	at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:194)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: org.apache.cassandra.exceptions.ConfigurationException: Cannot modify index name
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:188)
	at org.apache.cassandra.utils.FBUtilities.waitOnFuture(FBUtilities.java:409)
	... 16 more
Caused by: java.lang.RuntimeException: org.apache.cassandra.exceptions.ConfigurationException: Cannot modify index name
	at org.apache.cassandra.config.CFMetaData.reload(CFMetaData.java:983)
	at org.apache.cassandra.db.DefsTables.updateColumnFamily(DefsTables.java:377)
	at org.apache.cassandra.db.DefsTables.mergeColumnFamilies(DefsTables.java:318)
	at org.apache.cassandra.db.DefsTables.mergeSchema(DefsTables.java:183)
	at org.apache.cassandra.service.MigrationManager$2.runMayThrow(MigrationManager.java:305)
	at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	... 3 more
Caused by: org.apache.cassandra.exceptions.ConfigurationException: Cannot modify index name
	at org.apache.cassandra.config.ColumnDefinition.apply(ColumnDefinition.java:274)
	at org.apache.cassandra.config.CFMetaData.apply(CFMetaData.java:1040)
	at org.apache.cassandra.config.CFMetaData.reload(CFMetaData.java:979)
	... 10 more


Has anyone ever seen this behavior before? and if so, what was your solution?

Thanks,
Charlie

Re: Table Creation Error

Posted by Robert Coli <rc...@eventbrite.com>.
On Mon, Dec 2, 2013 at 12:24 PM, Charlie Andrews <
charlieandrews.cwa@gmail.com> wrote:

> Just out of curiosity, what do you think occurred to cause this problem? I
> thought it was quite strange that I didn’t get a useable error since my
> experience with this project has always been pretty helpful errors.
>

No idea, haven't looked into it in detail. The advice given is my generic
advice for "it seems like my schema is stuck", if your schema is not in
fact stuck (or it's not trivial for you to reset the schema) then you *may*
be able to debug and figure out what is wrong. My assertion is that this is
probably not worth your time, in many cases. If you are running 2.0.x,
hopefully you are not in production, etc...

=Rob

Re: Table Creation Error

Posted by Charlie Andrews <ch...@gmail.com>.
Just out of curiosity, what do you think occurred to cause this problem? I thought it was quite strange that I didn’t get a useable error since my experience with this project has always been pretty helpful errors.

Thanks,
Charlie

On Dec 2, 2013, at 3:20 PM, Robert Coli <rc...@eventbrite.com> wrote:

> On Mon, Dec 2, 2013 at 12:14 PM, Charlie Andrews <ch...@gmail.com> wrote:
> Maybe a stupid question, but doesn’t dropping a keyspace drop all data? Or is the keyspace schema separate from the data it describes?
> 
> Lol, sorry, yes. You will have to restore the data from the automatically created snapshot.
> 
> 1) echo "DESCRIBE KEYSPACE <keyspace_name>;" | cqlsh > keyspace_name.schema.cqlsh
> 2) DROP KEYSPACE <keyspace_name>;
> 3) restore keyspace's data from the snapshots created automatically when you DROP
> 4) use the contents of keyspace_name.schema.cqlsh to re-create your schema
> 5) rolling restart of all nodes (or use "nodetool refresh")
>  
> =Rob
> 


Re: Table Creation Error

Posted by Robert Coli <rc...@eventbrite.com>.
On Mon, Dec 2, 2013 at 12:14 PM, Charlie Andrews <
charlieandrews.cwa@gmail.com> wrote:

> Maybe a stupid question, but doesn’t dropping a keyspace drop all data? Or
> is the keyspace schema separate from the data it describes?
>

Lol, sorry, yes. You will have to restore the data from the automatically
created snapshot.

1) echo "DESCRIBE KEYSPACE <keyspace_name>;" | cqlsh >
keyspace_name.schema.cqlsh
2) DROP KEYSPACE <keyspace_name>;
3) restore keyspace's data from the snapshots created automatically when
you DROP
4) use the contents of keyspace_name.schema.cqlsh to re-create your schema
5) rolling restart of all nodes (or use "nodetool refresh")

=Rob

Re: Table Creation Error

Posted by Charlie Andrews <ch...@gmail.com>.
Maybe a stupid question, but doesn’t dropping a keyspace drop all data? Or is the keyspace schema separate from the data it describes?

-Charlie

On Dec 2, 2013, at 3:10 PM, Robert Coli <rc...@eventbrite.com> wrote:

> On Mon, Dec 2, 2013 at 11:54 AM, Charlie Andrews <ch...@gmail.com> wrote:
> I am on version 2.0.2. Do you have any resources on how to dump and reload the schema?
> 
> I guess I should write a blog post on this guy, but the rough outline is :
> 
> 1) echo "DESCRIBE KEYSPACE <keyspace_name>;" | cqlsh > keyspace_name.schema.cqlsh
> 2) DROP KEYSPACE <keyspace_name>;
> 3) use the contents of keyspace_name.schema.cqlsh to re-create your schema
> 
> For step 3 you can probably do it en masse via another pipe through cqlsh, but I would probably do it manually unless I had a huge amount of schema. You should probably keep a schema dump in general, for recovery purposes.
> 
> =Rob
> PS - thx to devdazed for testing out the cqlsh syntax, I only use cassandra-cli in my current deploys..


Re: Table Creation Error

Posted by Robert Coli <rc...@eventbrite.com>.
On Mon, Dec 2, 2013 at 11:54 AM, Charlie Andrews <
charlieandrews.cwa@gmail.com> wrote:

> I am on version 2.0.2. Do you have any resources on how to dump and reload
> the schema?
>

I guess I should write a blog post on this guy, but the rough outline is :

1) echo "DESCRIBE KEYSPACE <keyspace_name>;" | cqlsh >
keyspace_name.schema.cqlsh
2) DROP KEYSPACE <keyspace_name>;
3) use the contents of keyspace_name.schema.cqlsh to re-create your schema

For step 3 you can probably do it en masse via another pipe through cqlsh,
but I would probably do it manually unless I had a huge amount of schema.
You should probably keep a schema dump in general, for recovery purposes.

=Rob
PS - thx to devdazed for testing out the cqlsh syntax, I only use
cassandra-cli in my current deploys..

Re: Table Creation Error

Posted by Charlie Andrews <ch...@gmail.com>.
I am on version 2.0.2. Do you have any resources on how to dump and reload the schema?

On Dec 2, 2013, at 2:52 PM, Robert Coli <rc...@eventbrite.com> wrote:

> On Mon, Dec 2, 2013 at 11:51 AM, Charlie Andrews <ch...@gmail.com> wrote:
> Has anyone ever seen this behavior before?
> 
> No.
> 
> What version of Cassandra? Easiest fix is probably to dump-and-reload schema.
> 
> =Rob 


Re: Table Creation Error

Posted by Robert Coli <rc...@eventbrite.com>.
On Mon, Dec 2, 2013 at 11:51 AM, Charlie Andrews <
charlieandrews.cwa@gmail.com> wrote:

> Has anyone ever seen this behavior before?
>

No.

What version of Cassandra? Easiest fix is probably to dump-and-reload
schema.

=Rob