gocql: Amazon Cassandra : Column family TableIdentifier(ksName=system, cfName=local) is not writable

Please answer these questions before submitting your issue. Thanks!

What version of Cassandra are you using?

Amazon Managed Cassandra - version 3.11.2

What version of Gocql are you using?

v0.0.0-20200103014340-68f928edb90a

What did you do?

Tried to connect to Amazon Managed Cassandra using gocql

clusterConfig := gocql.NewCluster("cassandra.us-east-1.amazonaws.com:9142")
clusterConfig.Authenticator = gocql.PasswordAuthenticator{Username: username, Password: password}
clusterConfig.SslOpts = &gocql.SslOptions{
		CaPath: "AmazonRootCA1.pem",
	}

clusterConfig.Keyspace = "test"
session, err := clusterConfig.CreateSession()

What did you expect to see?

Successful gocql Session creation

What did you see instead?

{“error”: “gocql: unable to create session: control: unable to setup connection: Column family TableIdentifier(ksName=system, cfName=local) is not writable”}


If you are having connectivity related issues please share the following additional information

Describe your Cassandra cluster

please provide the following information

  • output of nodetool status nodetool: Failed to connect to ‘cassandra.us-east-1.amazonaws.com:9142’ - ConnectIOException: ‘non-JRMP server at remote endpoint’.

  • output of SELECT peer, rpc_address FROM system.peers

peer | rpc_address 3.83.170.140 | null 3.83.168.142 | null 3.83.169.141 | null 3.83.170.152 | null 3.83.168.154 | null 3.83.169.153 | null 3.83.168.143 | null 3.83.170.151 | null 3.83.171.143 | null

  • rebuild your application with the gocql_debug tag and post the output

2020-01-13T16:53:55.664-0500 ERROR filter/filter.go:65 error: {“error”: “gocql: unable to create session: control: unable to setup connection: Column family TableIdentifier(ksName=system, cfName=local) is not writable”}

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 28 (13 by maintainers)

Most upvoted comments

Hi, I am from AWS! As @gaurish said, we are aware of the issue and working on a solution. We will update the GitHub issue when the fix has been deployed.

The patch that made it work for for us was:

--- a/session.go
+++ b/session.go
@@ -1016,6 +1016,9 @@ func (q *Query) GetRoutingKey() ([]byte, error) {
 }
 
 func (q *Query) shouldPrepare() bool {
+        if strings.Contains(q.stmt, "system.") {
+           return false;
+        }

So it seems clear that there is something on the server stopping them.

@sagarp-webonise Thank you for following up! I don’t have new information to share at the moment, the team is actively working on the driver support. We will update this issue when the driver support is available.

According to my debugging, when gocql create prepared statement and communicate with MCS, then it failed as below.

row, err := c.query(ctx, "SELECT * FROM system.local WHERE key='local'").rowMap()
=> info, err = c.prepareStatement(ctx, qry.stmt, qry.trace)

However, I’m not sure why creating prepare statement will cause “not writable” error.