Could not run any N1QL

Hello,
I installed couchbase 4.5 on one server.
frist i tried to create primay index using gsi, but it raised error, any way i ran

create primary index on default using view;

after that i ran

select * from `default`;

and wait near one hour without any result, could you please assist me to find the reason?

Thanks.

It works in my env.
can you post the result of the following N1QL

explain select * from `default`;

The following is the result in my env

[
  {
    "plan": {
      "#operator": "Sequence",
      "~children": [
        {
          "#operator": "PrimaryScan",
          "index": "#primary",
          "keyspace": "default",
          "namespace": "default",
          "using": "view"
        },
        {
          "#operator": "Parallel",
          "~child": {
            "#operator": "Sequence",
            "~children": [
              {
                "#operator": "Fetch",
                "keyspace": "default",
                "namespace": "default"
              },
              {
                "#operator": "InitialProject",
                "result_terms": [
                  {
                    "expr": "self",
                    "star": true
                  }
                ]
              },
              {
                "#operator": "FinalProject"
              }
            ]
          }
        }
      ]
    },
    "text": "select * from `default`"
  }
]

salam thanks for reply
this is the reply
my bucket name is ShomaraDB

  {
    "plan": {
      "#operator": "Sequence",
      "~children": [
        {
          "#operator": "PrimaryScan",
          "index": "Account_Id",
          "keyspace": "ShomaraDB",
          "namespace": "default",
          "using": "view"
        },
        {
          "#operator": "Parallel",
          "~child": {
            "#operator": "Sequence",
            "~children": [
              {
                "#operator": "Fetch",
                "keyspace": "ShomaraDB",
                "namespace": "default"
              },
              {
                "#operator": "InitialProject",
                "result_terms": [
                  {
                    "expr": "self",
                    "star": true
                  }
                ]
              },
              {
                "#operator": "FinalProject"
              }
            ]
          }
        }
      ]
    },
    "text": "Select * From `ShomaraDB`;"
  }
]

Why you don’t use GSI as index

create primary index `pidx`on `ShomaraDB` using GSI;

And how about the following N1QL

Select * From `ShomaraDB` limit 1;

i tried that but i got below eeror

{
“requestID”: “5bfe6a08-ef15-4c90-93d5-3e3b1dc29d63”,
“signature”: null,
“results”: [
],
“errors”: [
{
“code”: 5000,
“msg”: “GSI CreatePrimaryIndex() - cause: Request timed out. Index server may still be processing this request. Please check the status after sometime or retry.”
}
],
“status”: “errors”,
“metrics”: {
“elapsedTime”: “2m0.464620004s”,
“executionTime”: “2m0.46451958s”,
“resultCount”: 0,
“resultSize”: 0,
“errorCount”: 1
}
}

i could not solve this problem.
also i setup new couchbase-server first cerate GSI primary index and ran XDCR, then tried that qury but the same result(i mean no result).

try to create index withdefer_build flag
FYI

CREATE PRIMARY INDEX `ShomaraDB-primary-index` ON `ShomaraDB` USING GSI   WITH {"defer_build":true};	
SELECT * FROM system:indexes WHERE name="ShomaraDB-primary-index";
BUILD INDEX ON `ShomaraDB`(`ShomaraDB-primary-index`) USING GSI;
SELECT * FROM system:indexes WHERE name="ShomaraDB-primary-index";

the state of index should be online

many thanks for your tracking.
the same result when i run frist line:

[
{
“code”: 5000,
“msg”: “GSI CreatePrimaryIndex() - cause: Request timed out. Index server may still be processing this request. Please check the status after sometime or retry.”,
“query_from_user”: “CREATE PRIMARY INDEX ShomaraDB-primary-index ON ShomaraDB USING GSI WITH {“defer_build”:true};”
}
]

regarding

line, i did it before, when i ran

create  primary index on `ShomaraDB`;

so run

SELECT * FROM system:indexes WHERE name="ShomaraDB-primary-index"; 

the state will be

online

but after one day for only 20,000,000 records, i could not find index in regarding tab and could not run any query.

out of disk space?
maybe @geraldss can give some advise.

out of disk space !!??
no, there are not any space issues.

is there any error logs in Log tag in admin console?

yes

Client-side error-report for user undefined on node ‘ns_1@213.233.161.137’:
User-Agent:Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0
Got unhandled javascript error:
name: TypeError;
message: can’t assign to properties of (new String(“Gateway Timeout”)): not an object;
fileName: http://213.233.161.137:8091/ui/app.min.js;
lineNumber: 230;
columnNumber: 412;
stack: getViewResult/</<@http://213.233.161.137:8091/ui/app.min.js:230:412
f/<@http://213.233.161.137:8091/ui/libs/angular.min.js:119:129
lf/this.$get</r.prototype.$eval@http://213.233.161.137:8091/ui/libs/angular.min.js:133:309
lf/this.$get</r.prototype.$digest@http://213.233.161.137:8091/ui/libs/angular.min.js:130:404
lf/this.$get</r.prototype.$apply@http://213.233.161.137:8091/ui/libs/angular.min.js:134:76
g@http://213.233.161.137:8091/ui/libs/angular.min.js:87:442
T@http://213.233.161.137:8091/ui/libs/angular.min.js:92:50
Uf/</w.onload@http://213.233.161.137:8091/ui/libs/angular.min.js:93:78
;

Module Code menelaus_web 102
Server Node ns_1@213.233.161.137
Time 6:58:03 PM
Wed Sep 14, 2016

Hi, I means the error logs in
http://127.0.0.1:8091/ui/index.html#/logs

How many documents do your bucket have?
is there any memory issue?

that was over there. i copied last one.
about 21,000,000 records and no any ram issue.
18000 for coucbase-server and 10180 for this bucket and only one bucket(also beer-sample).

may be you can post the collect_info here, couchbase guys can help.

cbcollect_info nodename.zip
1 Like