charveasna / couchdb-python

Automatically exported from code.google.com/p/couchdb-python
Other
0 stars 0 forks source link

couchdb-load does not work with username and password: 'You are not a db or server admin.' #197

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Make a backup with couchdb-dump
2. Create a new database with Futon
3. Make sure you are not in admin-party, setup one or more admins
4. Issue the command "couchdb-load -u serveradminusername -p 
serveradminpassword --input=backup20110530.bin 
http://127.0.0.1:5984/databasename"

What is the expected output? What do you see instead?
- I was expecting a list of document ids while the documents are being loaded.
- I did get instead:

---- start output ----
Loading document '_design/main'
Traceback (most recent call last):
  File "/usr/bin/couchdb-load", line 5, in <module>
    load.main()
  File "/usr/lib/pymodules/python2.6/couchdb/tools/load.py", line 88, in main
    password=options.password, ignore_errors=options.ignore_errors)
  File "/usr/lib/pymodules/python2.6/couchdb/tools/load.py", line 51, in load_db
    db[docid] = doc
  File "/usr/lib/pymodules/python2.6/couchdb/client.py", line 327, in __setitem__
    resp, data = self.resource.put(id, content=content)
  File "/usr/lib/pymodules/python2.6/couchdb/client.py", line 989, in put
    **params)
  File "/usr/lib/pymodules/python2.6/couchdb/client.py", line 1035, in _request
    raise ServerError((status_code, error))
couchdb.client.ServerError: (401, ('unauthorized', 'You are not a db or server 
admin.'))
---- end output ----

What version of the product are you using?
python-couchdb 0.6.1
couchdb 1.0.1-0ubuntu3

On what operating system?
MoonOs (ubuntu-based)

Please provide any additional information below.

I also tried the command "couchdb-load --input=backup20110530.bin
http://admin:password@127.0.0.1:5984/databasename

This gives me another error message:
---- start output2 ----
Loading document '_design/main'
Traceback (most recent call last):
  File "/usr/bin/couchdb-load", line 5, in <module>
    load.main()
  File "/usr/lib/pymodules/python2.6/couchdb/tools/load.py", line 88, in main
    password=options.password, ignore_errors=options.ignore_errors)
  File "/usr/lib/pymodules/python2.6/couchdb/tools/load.py", line 51, in load_db
    db[docid] = doc
  File "/usr/lib/pymodules/python2.6/couchdb/client.py", line 327, in __setitem__
    resp, data = self.resource.put(id, content=content)
  File "/usr/lib/pymodules/python2.6/couchdb/client.py", line 989, in put
    **params)
  File "/usr/lib/pymodules/python2.6/couchdb/client.py", line 1014, in _request
    resp, data = _make_request()
  File "/usr/lib/pymodules/python2.6/couchdb/client.py", line 1009, in _make_request
    body=body, headers=headers)
  File "/usr/lib/python2.6/dist-packages/httplib2/__init__.py", line 1129, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/usr/lib/python2.6/dist-packages/httplib2/__init__.py", line 901, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/usr/lib/python2.6/dist-packages/httplib2/__init__.py", line 865, in _conn_request
    raise ServerNotFoundError("Unable to find the server at %s" % conn.host)
httplib2.ServerNotFoundError: Unable to find the server at 
admin:password@127.0.0.1
---- end output2 ----

Original issue reported on code.google.com by haa...@gmail.com on 5 Sep 2011 at 2:57

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Have you tried to update couchdb-python to at least 0.8 release? 0.6.1 was 
released two years ago and mostly out of dated. One of major changes was 
removing httplib2 from dependencies and support modern features. Latest release 
should work for you, but you should known about issue 179 and issue 194 to work 
around those problems.

Original comment by kxepal on 6 Sep 2011 at 11:40

GoogleCodeExporter commented 8 years ago
Looks like a WORKSFORME.

Original comment by djc.ochtman on 21 Sep 2012 at 8:12