I have tried to use the CreateScope function.
I have Couchbase running as a docker container with the host port as 6091.
When I run this snippet to connect, it does not return an error:
@AV25242 I am using the latest stable version of the SDK(installed github.com/couchbase/gocb/v2
) and a docker container running Couchbase Server 7.0.0.
Hi @aditi the connection refused definitely points to a connectivity issue. You say
I have Couchbase running as a docker container with the host port as 6091.
Was this a typo or have you actually opened 6091 rather than 8091 (which is the port we’d typically expect to see open)?
As a couple of sidenotes - Connect will not return an error if there is an issue with connectively, it only returns an error if there’s an issue validating the settings that you’ve provided (e.g. you’ve used something like notarealscheme://localhost). You can use WaitUntilReady to verify that the SDK can connect to your cluster although it’ll only tell you that it can’t connect (via a timeout error) rather than why. To try get an idea of what the SDK thinks is going on you can enable logging.
Hi @aditi I’m not that well versed on using docker but I’m not sure this will actually work. The SDK actually bootstraps over the memcached protocol i.e. port 11210 which from the looks of that port mapping should be ok.
The problem is going to be that it looks like Couchbase Server is actually running the management port at 8091 but then you’re mapping it to 6091. Couchbase Server won’t know about your mapping to 6091 and so will be advertising to the SDK that it’s running the management port on 8091, the same is true of the other HTTP 80xx ports that you’re mapping to 60xx.