Details
-
Bug
-
Resolution: Fixed
-
Major
-
6.0.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.5.1, 6.6.0, 6.6.1, 6.6.2, 6.5.2, 6.5.0, 6.6.3, 6.6.4, 6.6.5, 7.0.0, 7.0.1, 7.0.2, 7.0.3, 7.0.4
-
Untriaged
-
1
-
No
Description
What's the issue?
The 'cbrecovery' command does not correctly use the source/sink usernames/passwords resulting in it using the wrong credentials to communicate with the clusters.
host, port, user, pwd, path = \
|
pump.parse_spec(opts, sink, 8091)
|
|
#retrieve a list of missing vbucket
|
cmd = "startRecovery"
|
url = "/pools/default/buckets/%s/controller/%s" % (self.sink_bucket, cmd)
|
err, conn, response = \
|
pump.rest_request(host, int(port), user, pwd,
|
url, method='POST', reason='start_recovery')
|
The important thing in this code snippet is:
- We're communicating to the sink cluster
- We're using 'opts' to get the username
def get_username(username):
|
return username or os.environ.get('CB_REST_USERNAME', '')
|
|
...
|
|
username = get_username(opts.username)
|
Looking further down, we see the problem; we're using the same username option ('opts.username') when communicating to the source/sink cluster; the same applies to the password.
Why haven't we noticed until now?
I suspect during development both clusters had the same username/password.
What's the fix?
We should use the correct credentials when communicating with the source/sink clusters.
Is there a workaround?
Yes, use the same user on the source/sink cluster. This could be a temporary user if required.
Steps to reproduce
- Create two, two node clusters a and b (with different usernames/passwords)
- Create bucket a on cluster a (disable replicas)
- Create bucket b on cluster b (disable replicas)
- Set XDCR from cluster a to cluster b (bucket a -> b)
- Load data into bucket a on cluster a (wait for XDCR to catch up)
- Hard failover one of the nodes on cluster a (causing half vBuckets to be lost)
- Use cbrecovery to recover vBuckets from b, to a
Attachments
For Gerrit Dashboard: MB-52782 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
177091,4 | MB-52782 Use the correct credentials for sink REST requests | neo | couchbase-cli | Status: MERGED | +2 | +1 |
177188,1 | Merge branch 'neo' into master | master | couchbase-cli | Status: MERGED | +2 | +1 |