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