Couchbase Enterprise 7 - Query received 504 error

Hi,

We have 3 servers hosting couchbase version 7. When I click on Query, I get the message that says “Received error 504 when contacting the query service”. I don’t see any meaningful messages in the logs and the host firewalld is turned off on all 3 servers.

Need some assistance in troubleshooting this error please.

Thanks!

It is strange. Make sure ports are open. Check query.log
Also try using curl

curl -v http://user:password@queryhost:8093/query/service -d 'statement=select 1'

Hi, thanks for the reply. The ports are opened and I’ve turned off the firewall. Port 8093 is opened too; however, when I ran the curl command with the argument stated the results came back different between server 1 and server 2 & 3.

For example: from server 1 I got:

super@server1~] curl -v http://super:super@server1:8093/query/service -d ‘statement=select 1’
Trying 192.168.10.11…
TCP_NODELAY set
Connected to server1 (192.168.10.11) port 8093 (# 0)
Server auth using Basic with user ‘super’
POST /query/service HTTP/1.1
Host: server1:8093

Content-Length: 18
Content-Type: application/x-www-form-urlencoded
upload completely sent off: 18 out of 18 bytes
HTTP/1.1 200 OK
Content-Length: 341
Content-Type: application/json; version=7.0.2-N1QL
{
“requestID”: “blah”
“signature”: {“$1”:“number”},
“results”: [
{“$1”:1}
],
“errors”: [{“code”:1080,“msg”:“Timeout 7us exceeded”,“retry”:true}],
“status”: “timeout”,
“metrics”: {“elapsedTime”: “404.662us”,“executionTime”: “352.996us”,“resultCount”:1,“resultSize”: 8, “serviceLoad”: 26,“errorCount”: 1}
}

  • Connection # 0 to host server1 left intact

For Server2 I got:

super@server2~] curl -v http://super:super@server2:8093/query/service -d ‘statement=select 1’
Trying 192.168.10.12…
TCP_NODELAY set
Connected to server1 (192.168.10.12) port 8093 (# 0)
Server auth using Basic with user ‘super’
POST /query/service HTTP/1.1
Host: server2:8093

Content-Length: 18
Content-Type: application/x-www-form-urlencoded
upload completely sent off: 18 out of 18 bytes
HTTP/1.1 200 OK
Content-Length: 255
Content-Type: application/json; version=7.0.2-N1QL
{
“requestID”: “blah”
“signature”: {“$1”:“number”},
“results”: [
{“$1”:1}
],
“status”: “success”,
“metrics”: {“elapsedTime”: “428.226us”,“executionTime”: “354.809us”,“resultCount”:1,“resultSize”: 8, “serviceLoad”: 26}
}

  • Connection # 0 to host server2 left intact

For Server3 I got:

super@server3~] curl -v http://super:super@server3:8093/query/service -d ‘statement=select 1’
Trying 192.168.10.13…
TCP_NODELAY set
Connected to server1 (192.168.10.13) port 8093 (# 0)
Server auth using Basic with user ‘super’
POST /query/service HTTP/1.1
Host: server3:8093

Content-Length: 18
Content-Type: application/x-www-form-urlencoded
upload completely sent off: 18 out of 18 bytes
HTTP/1.1 200 OK
Content-Length: 255
Content-Type: application/json; version=7.0.2-N1QL
{
“requestID”: “blah”
“signature”: {“$1”:“number”},
“results”: [
{“$1”:1}
],
“status”: “success”,
“metrics”: {“elapsedTime”: “427.806us”,“executionTime”: “370.964us”,“resultCount”:1,“resultSize”: 8, “serviceLoad”: 40}
}

  • Connection # 0 to host server3 left intact

The query.log files look benign to me as I don’t see anything obvious …

Thanks again!

Hum server1 saying timeout 7us.
check server 1 query.log (from the end) what value you have for

Query Configuration changed for timeout. New value is xxxx
also timeout= (cbq-engine started …)
cbq-engine started version=7.2.0-local_build ds_version=7.2.0-1830-enterprise datastore=http://127.0.0.1:8091 max-concurrency=12 loglevel=INFO servicers=48 plus-servicers=192 scan-cap=512 pipeline-cap=512 pipeline-batch=16 request-cap=256 request-size-cap=67108864 max-index-api=4 max-parallelism=1 n1ql-feat-ctrl=76 use-cbo=true timeout=0s txtimeout=0s gc-percent=200 node-quota=0

If you can also set the value to 0 in UI Settings===>Advanced Query Settings timeout to 0

Hi, YES! that did the trick. I set the timeout to 0 and I can now query. THANK YOU SO MUCH!

1 Like