Setting Couchbase hostname to anything other then 127.0.0.1 causes "An unknown N1QL error occurred" in Node.js using n1ql query

Couchbase 4 CE
Node.js SDK 2.1.6 prebuild
AWS

Setting Couchbase hostname to anything other then 12.0.0.1 causes “An unknown N1QL error occurred” in Node.js when using n1ql query, but queries work in Query Workbench.

if you set it to 127.0.0.1 then join a cluster I get “An unknown N1QL error occurred” also.

Using AWS tried setting it to private ip or public ip. They did not work. What is the best practice for setting the hostname? What am i doing wrong?

Hi @rdt_sd,
is this a single node deployment or a cluster deployment?
thanks
-cihan

Hi Cihan,

I found the solution. I was connecting to the servers using the public DNS, but the servers were named using the private IP. This caused issues when using N1QL.

Since I am using AWS, I created an internal hosted zone, and assigned a domain name to each server which I use in my connection strings.

It is a cluster deployment.

Thanks,
Robert

1 Like