Create index or Alter replica cannot proceed

I’m running Enterprise Edition 6.6.0 build 7909. After deleting a GSI index and then trying to recreate it I have been getting the following response:

    "code": 5000,
    "msg": "GSI CreatePrimaryIndex() - cause: Create index or Alter replica cannot proceed due to rebalance in progress, another concurrent create index request, network partition, node failover, indexer failure, or presence of duplicate index name.",
    "query": "CREATE INDEX `idx_my_index` ON `my-bucket`(...)"

idx_my_index doesn’t doesn’t exist, I deleted it, and it doesn’t show up in system:indexes, yet clearly there is some service that thinks it does and is continuing to operate against it.

This is a single server, running in docker, with a single bucket.

How do I 1) recover from this condition and 2) prevent it from happening in the future?

Hi @schleg,

Which Edition of Couchbase server are you using? Is it community edition or enterprise edition.

This error can mean one of the following possibilities (as it says in the message)

  1. Another concurrent DDL is ongoing in the cluster OR
  2. One of the index service nodes is not accessible at the moment OR
  3. Index service rebalance operation is ongoing OR
  4. Index with same name exists in the cluster.

As you are saying there isn’t any index with same name, one of the other scenarios might be happening. Also, as you are saying there is only one node in the cluster, ongoing index service rebalance is unlikely use case.

Do you see any concurrent DDLs (create index or alter index) are happening in the cluster?

If the above explanation doesn’t help, please share the query.log and indexer.log files from all the nodes in the cluster.

If this is happening due to one or more processes / applications trying to create (or alter) indexes at the same time, then, in Couchbase Server 7.0, we are planning to allow this. Please check following links.