Can the 3.x .Net SDK be used with CE 4.5.x?

I am having trouble accessing a bucket (Couchbase.Management.Buckets.BucketNotFoundException), I know the name is correct and I know the connection IPs and username/password are correct. SO I am wondering if the 3.x version of the .Net SDK works with Couchbase Community Edition 4.5.x.

Thanks,
Mark

No, you’ll need to use the 2.x SDK for compatibility with that version of Couchbase Server. The minimum for 3.x is either 5.5 or 6.0.

1 Like

@marktaylor77 welcome to the forums
In addition to what @btburnett3 had mentioned here is the SDK 3.x compatibility matrix for future reference

Thanks both.

I am certainly getting further using the 2.7.x version of the SDK. However I am still running in to an error when I try to run a query. Here is my code:
public static List Query()
{
var cluster = new Cluster(new ClientConfiguration
{
Servers = new List { new Uri(“http:// server1”),
new Uri(“http:// server2”),
new Uri(“http:// server3”) }
});

        var authenticator = new PasswordAuthenticator("user", "password");
        cluster.Authenticate(authenticator);
        var bucket = cluster.OpenBucket("bucket1");

        var results = bucket.Query<string>("SELECT Top 1 FROM bucket1");

        return results.Rows;
    }

The bucket.Query line is returning an error
results.Exception is “Could not acquire a server” - seems to be a TimeoutException

Any ideas what I am doing wrong?

@marktaylor77 -

It might be environment related; can you try the sdk doctor? In addition, can you enable logging and then we can debug that?

-Jeff

Here is what I got from SDK Doctor:
21:21:53.500 INFO :arrow_forward: Parsing connection string http:// server2
21:21:53.501 WARN :arrow_forward: Connection string is using the deprecated http:// scheme. Use the couchbase:// scheme instead!
21:21:53.502 INFO :arrow_forward: Connection string identifies the following CCCP endpoints:
21:21:53.503 INFO :arrow_forward: 1. server2:11210
21:21:53.503 INFO :arrow_forward: Connection string identifies the following HTTP endpoints:
21:21:53.504 INFO :arrow_forward: 1. server2:8091
21:21:53.504 INFO :arrow_forward: Connection string specifies bucket ``
21:21:53.505 WARN :arrow_forward: Your connection string specifies only a single host. You should consider adding additional static nodes from your cluster to this list to improve your applications fault-tolerance
21:21:53.505 INFO :arrow_forward: Performing DNS lookup for host server2
21:21:53.517 INFO :arrow_forward: Bootstrap host server2 refers to a server with the address 10.X.X.X
21:21:53.517 INFO :arrow_forward: Attempting to connect to cluster via CCCP
21:21:53.517 INFO :arrow_forward: Attempting to fetch config via cccp from server2:11210
21:21:55.533 ERRO :arrow_forward: Failed to fetch configuration via cccp from server2:11210 (error: dial tcp 10.X.X.X:11210: i/o timeout)
21:21:55.533 INFO :arrow_forward: Attempting to connect to cluster via HTTP (Terse)
21:21:55.535 INFO :arrow_forward: Attempting to fetch terse config via http from server2:8091
21:21:55.583 ERRO :arrow_forward: Failed to fetch terse configuration via http from server2:8091 (error: http error (status code: 404))
21:21:55.583 INFO :arrow_forward: Attempting to connect to cluster via HTTP (Full)
21:21:55.585 INFO :arrow_forward: Failed to connect via HTTP (Full), as it is not yet supported by the doctor
21:21:55.586 INFO :arrow_forward: Selected the following network type:
21:21:55.586 ERRO :arrow_forward: All endpoints specified by your connection string were unreachable, further cluster diagnostics are not possible
21:21:55.587 INFO :arrow_forward: Diagnostics completed

Summary:
←[33m[WARN]←[0m Connection string is using the deprecated http:// scheme. Use the couchbase:// scheme instead!
←[33m[WARN]←[0m Your connection string specifies only a single host. You should consider adding additional static nodes from your cluster to this list to improve your applications fault-tolerance
←[31m[ERRO]←[0m Failed to fetch configuration via cccp from server2:11210 (error: dial tcp 10.4.2.92:11210: i/o timeout)
←[31m[ERRO]←[0m Failed to fetch terse configuration via http from server2:8091 (error: http error (status code: 404))
←[31m[ERRO]←[0m All endpoints specified by your connection string were unreachable, further cluster diagnostics are not possible

Found multiple issues, see listing above.

Might not be related to your issue, but top is not a N1QL keyword. Instead use LIMIT

1 Like

If SDK Doctor cannot connect to the server, the SDK will not be able to. I am not a Docker expert, but would check that the ports (11210 and 8091 et al) are reachable from the SDK side.

Using Test-NetConnection, I can connect to 8091 but not 11210. What is 11210 used for? All the connections we currently make to Couchbase seem to be on port 8091.

BTW - if it is relevant, We have Couchbase running on Windows Server 2019 on VMs (not Docker)

11210 is used by memcached protocol for any key/value operations and bootstrapping. 8091 is the management port which you can also bootstrap against. From the SDK Dr output neither of these are reachable. Along with those two ports, there are a number of other ports that are used for various services.

Read network and firewall requirements for details.

Running the code from inside the our QA lab worked so it must be some kind of firewall issue. Thanks for all the help everyone, need to learn my N1QL syntax, but it looks like I have working code.

1 Like