replace
operation without couchbase transactions.
some sample code below...
cOpts := gocb.ClusterOptions{
Authenticator: gocb.PasswordAuthenticator{
Username: "user",
Password: "pw",
},
}
cluster, err := gocb.Connect("couchbase://my.dev.server.net/", cOpts)
if err != nil {
panic(err)
}
qOpts := gocb.QueryOptions{}
// create query
queryStr := "SELECT * FROM myBucket WHERE id = '123456789'"
rows, err := cluster.Query(queryStr, &qOpts)
if err != nil {
panic(err)
}
fmt.Printf("rows: %v\n", rows)
for rows.Next() {
var intfc interface{}
err = rows.Row(&intfc)
if err != nil {
panic(err)
}
fmt.Printf("interface result: %v\n", intfc)
}
The couchbase server is on 5.1.
I am either getting...
panic: ambiguous timeout | {"statement":"SELECT * FROM myBucketName WHERE id = '123456789'","client_context_id":"cdd52a06-c7a5-4d3d-8r26-99fg806d559e"}
...when I run the above code.
OR
If I put in the following lines after the gocb.Connect(...
I get the error that is after that.
err = cluster.WaitUntilReady(25*time.Second, &gocb.WaitUntilReadyOptions{DesiredState: gocb.ClusterStateOnline})
if err != nil {
panic(err)
}
...error...
panic: unambiguous timeout | {"InnerError":{"InnerError":{"InnerError":{},"Message":"unambiguous timeout"}},"OperationID":"WaitUntilReady","Opaque":"","TimeObserved":25000263891,"RetryReasons":["NOT_READY"],"RetryAttempts":105,"LastDispatchedTo":"","LastDispatchedFrom":"","LastConnectionID":""}
NOTE: I changed the Username
, Password
, Server/connStr
, bucket
, and the id
just for example purposes here.
What am I missing here?
I was able to figure out my issue...
I guess I needed to add the bucket in the code, though it would not be used...so just after the error check I would have to do this...
_ = cluster.Bucket("myBucket")
I also found out that this server has horrible resources so queries take a while and I had to up the timeouts on things. Additionally, the query I was using was not taking advantage of the indexes at all, so I had to do that as well, I just assumed that ID was indexed, but I come from a relational db background and this was my first foray into Couchbase. I later found out there is another method for getting data based on the document id as well. So there is that.
Hi, I am trying to deploy Couchbase Operator with the official Helm Chart in my EKS but I am getting this error:
Error: UPGRADE FAILED: template: couchbase-operator/templates/couchbase-tls.yaml:2:22: executing "couchbase-operator/templates/couchbase-tls.yaml" at <include "couchbase-cluster.tls" .>: error calling include: template: couchbase-operator/templates/_helpers.tpl:432:59: executing "couchbase-cluster.tls" at <include "couchbase-cluster.tls.ca-secret" .>: error calling include: template: couchbase-operator/templates/_helpers.tpl:401:4: executing "couchbase-cluster.tls.ca-secret" at <first .Values.cluster.networking.tls.rootCAs>: error calling first: runtime error: invalid memory address or nil pointer dereference
The certs for the server and CA are autogenerated and I a put this in the networking side in the values.conf:
networking:
tls:
secretSource:
clientSecretName: couchbase-operator-tls
#serverSecretName: couchbase-server-tls
clientCertificatePolicy: mandatory
clientCertificatePaths:
- path: subject.cn
- path: san.email
delimiter: "@"
Anyone had this error?