When trying to upgrade some datebases on a ubunt 14.04 machine couchup always returns with
{"error":"unauthorized","reason":"unauthorized to access or create database http://127.0.0.1:5986/acra-db/"}
before that there is an error:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(self.__args, *self.__kwargs)
File "./couchup", line 92, in _watch_replication
raise Exception('Cannot retrieve {} doc_count!'.format(db))
Is there something I am missing?
Were you able to resolve this on your own?
Can you get us copies of the couch log files from these machines when this happens?
I had the same problem, the following worked for me.
/opt/couchdb/bin/couchup replicate -a --login admin --password {ADMIN_PASSWORD}
I suggest looking at code of 'couchup' tool for more useful arguments.
Yes, if you don't specify the correct login and password arguments, couchup won't work.
Well that might have been the problem. I deleted the database as it was not important so there is no way to reproduce it now :(
couchup replicate -a --login admin --password {ADMIN_PASSWORD}
This needs to be mentioned in couchup documentation: http://docs.couchdb.org/en/latest/install/upgrading.html#couchup-utility
@paulocoghi pull requests on https://github.com/apache/couchdb-documentation are welcome!
@wohali I am still getting same error. Same meaning without providing --login and --password it doesn't work, and the password may need to be presented in a different manner.
# /opt/couchdb/bin/couchup replicate -a --login admin --password whateverisadminpassword
Starting replication for configuration...
Traceback (most recent call last):
File "/opt/couchdb/bin/couchup", line 508, in <module>
main(sys.argv)
File "/opt/couchdb/bin/couchup", line 502, in main
args.func(args)
File "/opt/couchdb/bin/couchup", line 223, in _replicate
auth = 'Basic ' + base64.b64encode(':'.join(args['creds']))
File "/usr/lib/python3.6/base64.py", line 58, in b64encode
encoded = binascii.b2a_base64(s, newline=False)
TypeError: a bytes-like object is required, not 'str'
@wohali I am still getting same error. Same meaning without providing --login and --password it doesn't work, and the password may need to be presented in a different manner.
# /opt/couchdb/bin/couchup replicate -a --login admin --password whateverisadminpassword Starting replication for configuration... Traceback (most recent call last): File "/opt/couchdb/bin/couchup", line 508, in <module> main(sys.argv) File "/opt/couchdb/bin/couchup", line 502, in main args.func(args) File "/opt/couchdb/bin/couchup", line 223, in _replicate auth = 'Basic ' + base64.b64encode(':'.join(args['creds'])) File "/usr/lib/python3.6/base64.py", line 58, in b64encode encoded = binascii.b2a_base64(s, newline=False) TypeError: a bytes-like object is required, not 'str'
@SohamChakraborty
I was having the same problem, and correct this by using python2 to run the couchup.
To run you will have to correct an error on the couchup script, the alternative to python2 (inside the exept) must be:
from urllib import quote
Most helpful comment
I had the same problem, the following worked for me.
/opt/couchdb/bin/couchup replicate -a --login admin --password {ADMIN_PASSWORD}
I suggest looking at code of 'couchup' tool for more useful arguments.