When i tried to call query return error 4000

I am trying to get document id using a query statement and called query but it return error 4000

var query = “select id from mybucket where id like ‘%docs%’”;
var result = Bucket.Query(query);
actually i am using 127.0.01:8091 but its is calling 127.0.0.1:8093 how to overcome this issue

error: remote server not found

@pavang14

  1. Make sure that your node has the Query and Index services running on it.

  2. Make sure you have ports 8092 and 8093 open on the node’s firewall. These are the ports used for index and query services.

Brant

i have checked node has query
I have added port like this but showing error “The remote server returned an error: (404) Not Found”

add uri="http://127.0.0.1:8091"
add uri=“http://127.0.0.1:8092

how to check ports open or not in nodes firewall

Can you run plain restful queries against the cluster? You could try using the “cbq” command line utility to run queries and see if they’re working.

http://developer.couchbase.com/documentation/server/4.1/n1ql/n1ql-intro/cbq.html#concept_s5k_qtx_1t

However, I will say that you should only add one instance of the server, using port 8091. The client automatically knows about other ports it needs to use for other services.

Brant

@pavang14 -

Can you post the actual code you are you using to initialize the cluster? The entire configuration,etc…

For bootstrapping you should only add URI’s with port 8091, the SDK will do the rest for you and lookup the services that you have enabled on your cluster.

-Jeff

public class Global : System.Web.HttpApplication
{

    protected void Application_Start(object sender, EventArgs e)
    {
        ClusterHelper.Initialize("couchbase/couchbase");
    }

web.config

configuration
configSections
sectionGroup name="couchbase"
section name=“couchbase” type=“Couchbase.Configuration.Client.Providers.CouchbaseClientSection, Couchbase.NetClient”/>

sectionGroup      

configSections
couchbase
couchbase useSsl="false"
servers
add uri=“http://127.0.0.1:8091”/
servers
buckets
add name=“secondbucket” useSsl=“false” password="welcome@123"
connectionPool name=“custom” maxSize=“10” minSize=“5” sendTimeout=“12000” connectionPool
add
buckets
couchbase
couchbase

public class myRepository :Repository<BO_Rstr>
{

    public myRepository (IBucket bucket): base(bucket)
    {

    }

    internal  List<customer> GetAllDocId(string id)
    {
        
     var results = List<customer> (n1qlQuery);
     }

results return error 404 remote server not found

i need help on this issue, can any one post solution this as soon as possible

@pavang14 -

Assuming you have Couchbase 4.1 installed locally, the only reason I would suspect you would get a 404 is if the query service wasn’t installed and/or you haven’t setup a primary index.

In order to dig deeper, try enabling logging: http://developer.couchbase.com/documentation/server/4.0/sdks/dotnet-2.2/setting-up-logging.html

Once you have done so, attach the logs and i’ll take a look.

-Jeff