Not able to Query

n1ql
#1

Hi,

I have installed Couch base Version: 4.1.0-4908 Enterprise Edition (build-4908)

I am trying to query on Couch base but getting following errors.

cbq.exe> select * from Mukesh ;
{
“requestID”: “f071ebd5-2f7d-42b8-a110-306fb84939bf”,
“errors”: [
{
“code”: 4000,
“msg”: “No primary index on keyspace Mukesh. Use CREATE PRIMARY INDE
X to create one.”
}
],
“status”: “fatal”,
“metrics”: {
“elapsedTime”: “1.0001ms”,
“executionTime”: “1.0001ms”,
“resultCount”: 0,
“resultSize”: 0,
“errorCount”: 1
}
}

cbq.exe> CREATE PRIMARY INDEX ON Mukesh USING GSI;
{
“requestID”: “f3ab5294-6ab4-4e08-9ef7-243404f7819b”,
“signature”: null,
“results”: [
],
“errors”: [
{
“code”: 5000,
“msg”: “GSI CreatePrimaryIndex() - cause: Terminate Request due to s
erver termination”
}
],
“status”: “errors”,
“metrics”: {
“elapsedTime”: “755ms”,
“executionTime”: “755ms”,
“resultCount”: 0,
“resultSize”: 0,
“errorCount”: 1
}
}

As you can see got error for primary index but index got created. with build in progress 0%

The primary index creation query was successful after appending WITH {“defer_build”:true}

cbq.exe> CREATE PRIMARY INDEX ON Mukesh USING GSI WITH {“defer_build”:true};

cbq.exe> select * from Mukesh ;
{
“requestID”: “ec2cedaf-9c46-4567-8a74-db46f2d8b781”,
“errors”: [
{
“code”: 4000,
“msg”: “Primary index #primary not online.”
}
],
“status”: “fatal”,
“metrics”: {
“elapsedTime”: “29ms”,
“executionTime”: “29ms”,
“resultCount”: 0,
“resultSize”: 0,
“errorCount”: 1
}
}

cbq.exe> BUILD INDEX ON Mukesh (#primary) USING GSI;
{
“requestID”: “c3f66b8e-1505-4e90-b39e-0e5418100db9”,
“signature”: null,
“results”: [
],
“errors”: [
{
“code”: 5000,
“msg”: “BuildIndexes - cause: Terminate Request due to server termin
ation”
}
],
“status”: “errors”,
“metrics”: {
“elapsedTime”: “140ms”,
“executionTime”: “140ms”,
“resultCount”: 0,
“resultSize”: 0,
“errorCount”: 1
}
}

cbq.exe> SELECT * FROM system:indexes ;
{
“requestID”: “9e251b97-a487-4acf-bd19-777219e07f14”,
“signature”: {
"": ""
},
“results”: [
{
“indexes”: {
“datastore_id”: “http://127.0.0.1:8091”,
“id”: “7a0ba2c615ca219e”,
“index_key”: [],
“is_primary”: true,
“keyspace_id”: “ION_Rajeev”,
“name”: “ION_Rajeev_Primary”,
“namespace_id”: “default”,
“state”: “pending”,
“using”: “gsi”
}
},
{
“indexes”: {
“datastore_id”: “http://127.0.0.1:8091”,
“id”: “5ee4e0372d2a0848”,
“index_key”: [],
“is_primary”: true,
“keyspace_id”: “Mukesh”,
“name”: “#primary”,
“namespace_id”: “default”,
“state”: “pending”,
“using”: “gsi”
}
}
],
“errors”: [
{
“code”: 12014,
“msg”: “error: Inconsistent Internal State. Index ION_TEST_PRIMARY([
]). Index state: pending”
}
],
“status”: “errors”,
“metrics”: {
“elapsedTime”: “201ms”,
“executionTime”: “201ms”,
“resultCount”: 2,
“resultSize”: 824,
“errorCount”: 1
}
}

Can you please give solutions for these errors.

Thanks in Advance
Mukesh Raghuwanshi

#2

Hi Sorry you are having issues with CREATE INDEX.
could you take a look at the logs tab in the admin console (http://…:8091) and send the indexer.log file from /opt/couchbase/var/lib/couchbase/logs. I am at cihan@couchbase.com

thanks
-cihan

#3

Or maybe just file at issues.couchbase.com so you can track the progress on it as well!

#4

Hi,

Thanks for the reply.

As I am new user so unable to upload here.

I have mailed you the indexer.log file on cihan@couchbase.com

Thanks
Mukesh

#5

thanks. the node that is running the indexer has some other process that grabbed port:9105. Indexer cannot listen on this port. Could you make sure that the port isn’t taken by some other process?

2015-11-23T17:51:12.908+05:30 [Error] DATP[->dataport “:9105”] failed starting ! listen tcp :9105: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.

#6

Thanks this solution works,The Antivirus service was using that port.
After stopping that service index has created successfully and all queries are working.

Is there any other way to change the port from 9105 to another,since the antivirus by default takes this port and I have to manually change this in all my systems?

Thanks
Mukesh

#7

Hi,

I tried by stopping my antivirus and my problem is solved but whenever my machine restarts the Antivirus by default takes port “9105”.

Can you please suggest me any permanent solution for this?

Thanks
Mukesh