Small issue with couchbase-cli (server 4.0.0 community)

Had an issue this morning that cost me a fair bit of time, that would be quite easy to resolve with a slight change to couchbase-cli and some documentation.

This thread indicates that after a cluster is provisioned, you can’t later change what services that cluster offers:

On the other hand, if you run couchbase-cli with a running cluster, and give it --services=index,query,data – it will report back success.

Further, if you run couchbase-cli and you give it --services=OBVIOUSLYWRONG, it will happily report success back.

This is a bit of a problem, since shell scripts and docker setup materials rely on exit codes and such to signal success/failure of an operation, and makes for very hard to spot bugs.

That is indeed a problem, though it was fixed between 4.1 and 4.5.

4.1 reports no error:

couchbase-cli cluster-edit --services=foobar --cluster=http://localhost:9000 -u Administrator -p pass

4.5, on the other hand, does report a error.:

couchbase-cli cluster-edit --services=foobar --cluster=http://localhost:9000 -u Administrator -p pass
ERROR: invalid service: foobar

-Eben

Well, I’m looking forward to upgrading to 4.5 as soon as it’s widely available; we’re hoping that couchbase puts out docker images for it as they’ve done for 4.0.0 community, etc.

The example you give of service “foobar” on the cluster is part of what I was reporting – the other part is that couchbase-cli takes spurious arguments, e.g. you can specify services on editing a bucket (which to my understanding is not how it works) and the argument will be accepted. In our shell scripting this gave the mistaken impression that it was changing something about the services when it wasn’t. What it was probably doing was silently ignoring the --services argument when it was on a bucket-edit command.

Indeed, argument handling in our command line tools is not done in the best way. Even in 4.5 you can specify inappropriate arguments and they end up being ignored (rather than flagged as an error). I hope that will get fixed in a future version, we’ll see!