I work with multiple applications that each run different couchbase configuration, so I have to run them in Docker with remapped ports.
I tried to setup an instance with custom ports. I used this command from couchbase-cli:
docker run -d --memory 3200M --name bumblebase \
-p 3456-3461:8091-8096 -p 6575-6576:11210-11211 \
couchbase:community-6.5.1
Then I setup my cluster :
couchbase-cli cluster-init -c 127.0.0.1:3456 \
--cluster-username Administrator --cluster-password password \
--cluster-ramsize 640 --index-storage-setting default \
--cluster-fts-ramsize 512 --cluster-index-ramsize 512 --cluster-eventing-ramsize 512 \
--services data,query,index,fts
I can then connect to localhost:3456 without any problems to create my buckets. The result is shown below :
However, when trying to connect from Go SDK :
c, err := gocb.Connect(
"couchbase://127.0.0.1:3456",
gocb.ClusterOptions{
Username: "Administrator",
Password: "password",
},
)
This doesn’t throw any error at first, but whenever I try to perform any KV operation later, I have this error :
ambiguous timeout | {"InnerError":{"InnerError":{"InnerError":{},"Message":"ambiguous
timeout"}},"OperationID":"Add","Opaque":"0x0","TimeObserved":2501547947,"RetryReasons":null,"RetryAttempts":0,"
LastDispatchedTo":"","LastDispatchedFrom":"","LastConnectionID":""}
This error is only present when I try to connect on my Docker instance. When I try the same code while running Couchbase Server application
c, err := gocb.Connect(
"couchbase://localhost",
gocb.ClusterOptions{
Username: "Administrator",
Password: "password",
},
)
This works fine when I do the same operation again. I also tried replacing 127.0.0.1 with 0.0.0.0 or localhost, without any success