Got error when try to create primary index?

we have Couchbase Version: 4.0.0-4051 Community Edition (build-4051)
we have 3 node cluster with 1 replica and view index replication ON…with 6 buckets…
when we create index for first bucket on node1…we successfully able to create that

query

CREATE PRIMARY INDEX magic-index-1 ON bucket USING GSI WITH {“nodes”:“couchbase01.XXXXXXX.com:8091”};
##########################
then we tried to create index for second node
CREATE PRIMARY INDEX magic-index-2 ON bucket USING GSI WITH {“nodes”:“couchbase02.XXXXXXX.com:8091”};
################################# ERROR################################
{
“code”: 5000,
“msg”: “GSI CreatePrimaryIndex() - cause: Bucket does not exist or temporarily unavaible for creating new index. Please retry the operation at a later time.”
}
#############################################################
CREATE PRIMARY INDEX magic-index-3 ON bucket USING GSI WITH {“nodes”:“couchbase03.XXXXXXX.com:8091”};

this is working fine

############################################################# LOGS############################
node2 logs

##################################1. error.log ###########################

[ns_server:error,2016-08-01T13:36:29.015-04:00,ns_1@couchbase02.XXXXXXX.com:index_stats_collector<0.387.0>:index_rest:get_json:45]Request to http://127.0.0.1:9102/stats?async=true failed: {error,
{econnrefused,
[{lhttpc_client,
send_request,1,
[{file,
"/home/couchbase/jenkins/workspace/sherlock-unix/couchdb/src/lhttpc/lhttpc_client.erl"},
{line,220}]},
{lhttpc_client,
execute,9,
[{file,
"/home/couchbase/jenkins/workspace/sherlock-unix/couchdb/src/lhttpc/lhttpc_client.erl"},
{line,169}]},
{lhttpc_client,
request,9,
[{file,
"/home/couchbase/jenkins/workspace/sherlock-unix/couchdb/src/lhttpc/lhttpc_client.erl"},
{line,92}]}]}}

############################################ indexer.log ###########################

2016-08-01T13:36:25.431Z-04:00 [Info] Indexer started with command line: [/opt/couchbase/bin/indexer -vbuckets=1024 -cluster=127.0.0.1:8091 -adminPort=9100 -scanPort=9101 -httpPort=9102 -streamInitPort=9103 -streamCatchupPort=9104 -streamMaintPort=9105 -storageDir=/opt/couchbase/var/lib/couchbase/data/@2i]
2016-08-01T13:36:25.44Z-04:00 [Info] Indexer::NewIndexer Status INIT
2016-08-01T13:36:28.273Z-04:00 [Info] Setting maxcpus = 4
2016-08-01T13:36:28.273Z-04:00 [Info] Setting buffer block size to 16384 bytes
2016-08-01T13:36:28.273Z-04:00 [Info] Setting log level to Error
2016-08-01T13:36:29.47Z-04:00 [Fatal] KVSender::sendShutdownTopic Unexpected Error During Shutdown Projector couchbase01.XXXXXX.com:9999 Topic MAINT_STREAM_TOPIC_d5:f9:60:50:89:d1:a9:c2. Err projector.topicMissing
2016-08-01T13:36:29.47Z-04:00 [Error] KVSender::closeMutationStream MAINT_STREAM Error Received projector.topicMissing from couchbase01.XXXXXXXXXXX.com:9999
2016-08-01T13:36:29.472Z-04:00 [Fatal] KVSender::sendShutdownTopic Unexpected Error During Shutdown Projector couchbase02.XXXXXX.com:9999 Topic MAINT_STREAM_TOPIC_d5:f9:60:50:89:d1:a9:c2. Err projector.topicMissing
2016-08-01T13:36:29.472Z-04:00 [Error] KVSender::closeMutationStream MAINT_STREAM Error Received projector.topicMissing from couchbase02.XXXXXXX.com:9999
2016-08-01T13:36:29.473Z-04:00 [Fatal] KVSender::sendShutdownTopic Unexpected Error During Shutdown Projector couchbase03.XXXXXXX.com:9999 Topic MAINT_STREAM_TOPIC_d5:f9:60:50:89:d1:a9:c2. Err projector.topicMissing
2016-08-01T13:36:29.473Z-04:00 [Error] KVSender::closeMutationStream MAINT_STREAM Error Received projector.topicMissing from couchbase03.XXXXXXX.com:9999
2016-08-01T13:36:29.516Z-04:00 [Fatal] KVSender::sendShutdownTopic Unexpected Error During Shutdown Projector couchbase01.XXXXXXXX.com:9999 Topic INIT_STREAM_TOPIC_d5:f9:60:50:89:d1:a9:c2. Err projector.topicMissing

###################################### projector.log #############################

2016-08-02T08:16:14.567Z-04:00 [Info] FEED[<=>INIT_STREAM_TOPIC_7:2e:2d:f0:a8:50:8b:1f(127.0.0.1:8091)] ##17 backch *projector.controlStreamEnd {controlStreamEnd, SUCCESS, bucket, 625, 17}
2016-08-02T08:16:14.567Z-04:00 [Info] FEED[<=>INIT_STREAM_TOPIC_7:2e:2d:f0:a8:50:8b:1f(127.0.0.1:8091)] ##17 backch *projector.controlStreamEnd {controlStreamEnd, SUCCESS, bucket, 266, 17}
2016-08-02T08:16:14.567Z-04:00 [Info] FEED[<=>INIT_STREAM_TOPIC_7:2e:2d:f0:a8:50:8b:1f(127.0.0.1:8091)] backch *projector.controlFinKVData {controlFinKVData, bucket}
2016-08-02T08:16:14.567Z-04:00 [Info] KVDT[<-bucket_name<-127.0.0.1:8091 #INIT_STREAM_TOPIC_7:2e:2d:f0:a8:50:8b:1f] ##17 … stopped
2016-08-02T08:16:14.567Z-04:00 [Info] FEED[<=>INIT_STREAM_TOPIC_7:2e:2d:f0:a8:50:8b:1f(127.0.0.1:8091)] ##17 bucket bucket_name removed …
2016-08-02T08:16:14.567Z-04:00 [Warn] FEED[<=>INIT_STREAM_TOPIC_7:2e:2d:f0:a8:50:8b:1f(127.0.0.1:8091)] no more buckets left, closing the feed …
2016-08-02T08:16:14.567Z-04:00 [Info] FEED[<=>INIT_STREAM_TOPIC_7:2e:2d:f0:a8:50:8b:1f(127.0.0.1:8091)] ##17 feed … stopped
2016-08-02T08:16:14.567Z-04:00 [Info] PROJ[:9999] ##19 doDelBuckets() returns …
2016-08-02T09:19:11.761Z-04:00 [Info] pram[:9999] Request "/adminport/delInstancesRequest"
2016-08-02T09:19:11.761Z-04:00 [Info] PROJ[:9999] ##1a doDelInstances() "MAINT_STREAM_TOPIC_7:2e:2d:f0:a8:50:8b:1f"
2016-08-02T09:19:11.764Z-04:00 [Info] KVDT[<-bucket_name<-127.0.0.1:8091 #MAINT_STREAM_TOPIC_7:2e:2d:f0:a8:50:8b:1f] ##1a deleted engine %!q(uint64=8421230313027153753)
2016-08-02T09:19:11.764Z-04:00 [Info] PROJ[:9999] ##1a doDelInstances() returns …

###############################################################################

Couchbase 4.1 community edition has just been released. Would it be possible to try it on 4.1?

If community edition isn’t a requirement, you should try with 4.5.

is there any other way for this?

Did you try restarting your cluster.