Latest Couchbase server installed and tested working for inserts from a test Node.js script.
Now I’m trying to run queries with N1QL.
I’ve extracted the N1QL Developer Preview 3 to c:\developer_preview_3 and can successfully run the tutorial.
I then close the tutorial command prompt (necessary to free up the port 8093) and open another command prompt and run cbq-engine in it like:
C:\couchbase_dev_preview_3>cbq-engine -couchbase http://localhost:8091/
I then open another command prompt to run cbq and I get the following results:
C:\couchbase_dev_preview_3>CBQ
CBQ> SELECT * FROM beer-sample
{
"error":
{
"caller": "view_index:200",
"code": 5000,
"key": "Internal Error",
"message": "Bucket beer-sample not found."
}
}
CBQ> SELECT * FROM notrealbucket
{
"error":
{
"caller": "standard:69",
"cause": "Bucket notrealbucket does not exist",
"code": 5000,
"key": "Internal Error",
"message": "Optimizer Error"
}
}
CBQ>
So I get an internal error that says “not found” for a bucket at does in fact exist, and an internal error that says “Optimizer Error” for a bucket that does not exist.
Also, errors are printed out on my running cbq-engine process:
C:\couchbase_dev_preview_3>cbq-engine -couchbase http://localhost:8091/
04:51:31.720722 Info line disabled false
04:51:31.742723 tuqtng started...
04:51:31.743723 version: v0.7.2
04:51:31.745723 site: http://localhost:8091/
04:51:47.468638 ←[31mERROR: Unable to access view - cause: error executing view req at http://127.0.0.1:8092/beer-sample/_all_docs?limit=1001: 400 Bad Request -
{"error":"bad_request","reason":"_all_docs is no longer supported"}
←[0m←[2m -- couchbase.(*viewIndex).ScanRange() at view_index.go:186←[0m
04:51:47.469638 Checking bucket URI: /pools/default/buckets/beer-sample?bucket_uuid=27e71c5f06fea74e37ef2c1501a0ffe2
04:51:47.470639 ←[31mERROR: Get /pools/default/buckets/beer-sample?bucket_uuid=27e71c5f06fea74e37ef2c1501a0ffe2: unsupported protocol scheme ""←[0m←[2m -- couch
base.(*viewIndex).ScanRange() at view_index.go:192←[0m
So what’s going on here?
…
Additionally, when attempting to do an N1QL query from a Node.js app (via couchnode), I get the following error thrown upon attempting to execute a (simple) query which can be found below this error printout:
C:\git\7\savetodb.js:42
throw err; //@TODO
^
Error: lcb error undefined
at Bucket._invoke (C:\git\7\node_modules\couchbase\lib\bucket.js:709:25)
at Bucket._maybeInvoke (C:\git\7\node_modules\couchbase\lib\bucket.js:726:10)
at Bucket.query (C:\git\7\node_modules\couchbase\lib\bucket.js:617:10)
at Bucket.<anonymous> (C:\git\7\savetodb.js:36:18)
at Bucket.emit (events.js:117:20)
at Bucket.<anonymous> (C:\git\7\node_modules\couchbase\lib\bucket.js:178:10)
The code I use to execute the query is:
var query1 = N1qlQuery.fromString("SELECT 'Hello World' AS Greeting");
bucketMessages.query(
query1,
function(err, arrMessageHighestUID) {
if (err) {
console.log("\n\n***Error in function(err, objMessageHighestUID)...\n\n");
throw err; //@TODO
}
}
);
Is the problem I’m having with my code’s query the same problem I’m having with CBQ?
- Austin