Strange error: connection refused

the doc is like this:

{
“categories”: [
“cat01”,
“cat02”,
“cat03”
],
“mvid”: “mv_01”,
“name”: “LIUKEHONG_Movie 01”,
“objid”: “mv_01”,
“ts”: 1465658900766,
“type”: “mv”
}

and I created index like this:

CREATE INDEX mv_category ON default( DISTINCT ARRAY cat FOR cat IN categories END) WHERE type = “mv” USING GSI;

then I made a query like this several times:

cbq> SELECT mv.mvid, mv.name FROM zop AS mv WHERE mv.type=“mv” AND ANY cat IN mv.categories SATISFIES cat = “cat02” END ;

occasionally, I could get the result as expected as follows:

{
“requestID”: “f8c94f64-b4cf-40ee-bcf8-cced10225ab9”,
“signature”: {
“mvid”: “json”,
“name”: “json”
},
“results”: [
{
“mvid”: “mv_01”,
“name”: “LIUKEHONG_Movie 01”
}
],
“status”: “success”,
“metrics”: {
“elapsedTime”: “52.777861ms”,
“executionTime”: “52.725476ms”,
“resultCount”: 1,
“resultSize”: 81
}
}

BUT, most of time, I got error says:

{
“requestID”: “64ab450f-5b9a-450a-9582-ed1bf8fb6d80”,
“signature”: {
“mvid”: “json”,
“name”: “json”
},
“results”: [
],
“errors”: [
{
“code”: 5000,
“msg”: “dial tcp 127.0.0.1:9101: connection refused from 127.0.0.1:9101 - cause: dial tcp 127.0.0.1:9101: connection refused from 127.0.0.1:9101”
},
{
“code”: 5000,
“msg”: “dial tcp 127.0.0.1:9101: connection refused from 127.0.0.1:9101 - cause: dial tcp 127.0.0.1:9101: connection refused from 127.0.0.1:9101”
}
],
“status”: “errors”,
“metrics”: {
“elapsedTime”: “36.651013ms”,
“executionTime”: “36.594581ms”,
“resultCount”: 0,
“resultSize”: 0,
“errorCount”: 2
}
}

How to get rid of it? thanks in advance.

2 Likes

What platform are you on, and what is the exact command you are issuing to launch cbq shell?

Hi Geraldss, it’s a Ubuntu 16.04 as a guest os in Virtualbox 5.0.20 running on OSX EI Capitan 10.11.5
and the cbq shell command is “/opt/couchbase/bin/cbq”.

Hi @chillaxall,

A couple of things to try.

Try passing an explicit endpoint to cbq shell:

/opt/couchbase/bin/cbq http://localhost:8093

/opt/couchbase/bin/cbq http://127.0.0.1:8093

Make sure your VM is not blocking those ports (8093, 8091, 9101).

Thanks a lot Geraldss, I passed explicit endpoint to cbq shell and there were still “connection refused” errors.
some queries succeed, others failed.
and I noticed another new error says:

“errors”: [
{
“code”: 5000,
“msg”: “Indexer In Bootstrap State. Please retry the request later. from 127.0.0.1:9101 - cause: Indexer In Bootstrap State. Please retry the request later. from 127.0.0.1:9101”
}
],

Ok. Please restart all your Couchbase services. It seems that 9101 is an indexer port.

1 Like

I also got it and restart all service, and i still get the same error.
Also the indexer take a long time till it warm up.

I started to get this problem when my computer suddenly freeze and i did force reboot.
I am working on mac: “macOs sierra”

@roycouch

What is the exact error you get ? Could you also upload your logs ? We can then take a look and see what the issue is.

Thanks
Isha