Problems in minimal.c

I have met a problem just like follow:

create_options.version = 3; = “”;
create_options.v.v0.user = “Administrator”;
create_options.v.v0.passwd = “******”;
create_options.v.v0.bucket = “Administrator”;

I wanna connect to, it stop at “Will wait for storage operation to complete” all the time.
I doubt If the host field is signed incorrectly?
And what problems could make this?


  1. If you use version=3 then you should use the fields in v.v3 within the structure. The various v.vXXX are arranged as a union. The version field indicates which field is valid
  2. It appears you are trying to connect to the administrative interface. You would need to set the type field to LCB_TYPE_CLUSTER, and remove the bucket field.

For solutions:

  1. The host field is no longer present in the v3 struct; you should use the connstr field, in which case you would do
  2. Do not use the bucket field

See for the link to the creation structure.

Thanks for your patient answer.

Our sever version is 2.2.
Is that mean I should sign version = 2,and use the fields in v.v2 within the structure ?

And there are localhost IP and server IP, which IP I should sign connstr field?

And the Server IP port is 8091, the program just request port 11210, why?

example; the localhost is, and the Server IP is,which one is signed v.v3.connstr?
Is “couchbase://” right?

No, the version field in the struct has nothing to do with the server version. It simply indicates which form of the union to use within the structure. Thus for any number n, you would set version=n and then use the fields available in

Secondly, the client will by default try to bootstrap from port 11210 and if that fails, will try port 8091. Why is it so important that you client must connect to 8091*? - simply do not specify a port number, and the client will do the correct thing in determining where to connect to;

putting it all together

struct lcb_create_st crst { 0 };
crst.version = 3;
crst.v.v3.connstr = "couchbase://

*Note that if you specify port 8091, the client will ignore it and assume you have made a mistake and you don’t really want to only use port 8091, but rather just connect to whatever the default port is on that specified server.

I think too much so that I go a wrong way.
Turn out which caused my problem is that I can not connect
I’m going to find another way to solve my problem.
Thank you one more time! :smile: