2 questions about cbbackupwrapper

Hello!
4.6.0, src-based

1. Could you please clarify, is it possible to perform a backup with read-only user ?

There was a topic about that (Readonly User can backup?), but last comment in filed bug (Loading...) sounds really weird:

Read only user could run backup only on default bucket or any bucket with empty password.
Bucket with password protested, read only user could not run backup."

As a result of backup with credentials of read-only user I see this line in stdout

Error with backup for running “/opt/couchbase/bin/cbbackup” -v -t 1 --vbucket-list=[0,1,2, …

And auth-error in particular-backup-err-log (bucket_name is a name of bucket that is password-protected):

error: SASL auth failed: host_name:11210, user: bucket_name

So, is last comment in Loading... correct, and if it is, don’t you think, that such behavior is … at least “weird” and, probably, should be a subject to change ? @ingenthr, @mikew ?

2. What is a good criteria to post-check cbbackupwrapper output and ensure that backup is completed without errors ?

For example, with read-only user i see “Error”-containing-lines, but, anyway, the last stdout line is “SUCCESSFULLY COMPLETED!”. So, what should i rely on (when checking output) to be sure, that “backup is completed without errors” ? (this is needed for deferred automated check)

+UPDATE: very often (too often) backup ends with (or shows-in-process) messages like:

Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File “/usr/lib/python2.7/threading.py”, line 810, in __bootstrap_inner
File “/usr/lib/python2.7/threading.py”, line 763, in run
File “/opt/couchbase/lib/python/cbbackupwrapper”, line 238, in consumer
File “/usr/lib/python2.7/Queue.py”, line 174, in get
< type ‘exceptions.TypeError’ >: ‘NoneType’ object is not callable

is it normal ?
Yes, i can use -P 1, but of course i would like to use more threads then 1 :wink:

  1. Yes, this is weird behavior given what the average user would be expecting when using a read only user. We’ve been going through a few iterations of user management and that’s why things are the way they are.

Our first version had just a single full administrator user. Then, we added a single read-only user. Then, in Couchbase 4.5 we added some other users (cluster admin, bucket admin, etc.) in the EE version only. The one problem is that these users where only for configuration management and did not affect who could access data in the cluster. In our 5.0 release this will change and user roles will limit access to data.

In 4.6 the only thing blocking a read only user from accessing data is the bucket password. which it doesn’t have access to. But if there is no password then the bucket can be accessed.

This is something that will be fixed soon.

  1. I would look for the success message to ensure a backup completed successfully. Also, I’ve filed a bug for the threading issue you mentioned. You can track it here: MB-22325.

This is something that will be fixed soon.

Glad to hear, +1!

I’ve filed a bug for the threading issue you mentioned. You can track it here: MB-22325

Thanks!

BTW, now logic is “stdout has no error-string and has success-string”; this, at least, allows to determine threading-problem and re-run backup if needed.