Very strange behavior of using couchbase cluster credential to call couchbase REST API

I have an installation of community server version 2.2.0-build 837 on an AWS machine. Everything works fine until last week AWS patch the Linux VM (CentOS 6.5 64 bits) and restart the machine. After that, this strange thing happened:
I can login use my admin username/password into the management web UI. Assuming the username is admin, password is ‘passwd’. If I login to the couchbase AWS VM, and run this on the VM:
cd /opt/couchbase/bin
./couchbase-cli bucket-list -c localhost:8091 -u admin -p passwd
ERROR: unable to access the REST API - please check your username (-u) and password (-p)

I have asked several of my colleague to check with me about the username and password I typed and they are correct. I have no idea why the same credential can work in management Web UI but not this couchbase-cli.

I am not sure whether it is related, but our Java CouchbaseClient code also suddenly failed to read data at this point.

I wonder what could be the reason for such thing?

What log that I can look into to get more info when I run the couchbase-cli command or login to the management Web UI?

Thanks for helping

Did the CLI ever work, or did it just stop working after reboot? This sounds a lot like some sort of firewall is in place, but I can’t say for certain.

I’d recommend doing a network capture on port 8091 from the cluster side and see what is happening at that level. Is the traffic just not happening when using the CLI, or is it somehow sending a different Authorization header than the browser would.

Hi, I am seeing the same issue on RHEL 6.6 x86_64 with CB 3.0.1. I can log in to the web console with the same credentials but get the following message when using couchbase-cli:

ERROR: unable to access the REST API - please check your username (-u) and password (-p)

For anyone ever coming across this, check your password for characters that need escaping, which was our fix to this issue

1 Like