CouchDB: 401 on `padrino rake seed` #804

Closed
argent-smith opened this Issue Mar 11, 2012 · 2 comments

Comments

Projects
None yet
2 participants

Hi guys, I can't seed the database after admin generation. Rake fail with error 401. Here's my config:

config/database.rb

...

CouchRest::Model::Base.configure do |conf|
  conf.model_type_key = 'type' # compatibility with CouchModel 1.1
  conf.database = CouchRest.database!(db_name)
  conf.environment = Padrino.env
  conf.connection = {
    :protocol => 'http',
    :host     => 'localhost',
    :port     => '5984',
    :prefix   => 'padrino',
    :suffix   => nil,
    :join     => '_',
    :username => 'tester',
    :password => 'tester'
  }
end

Here's couchdb's log:

[debug] [<0.20942.0>] 'PUT' /mirnaya_development {1,1} from "127.0.0.1"
Headers: [{'Accept',"application/json"},
          {'Accept-Encoding',"gzip, deflate"},
          {'Content-Type',"application/json"},
          {'Host',"127.0.0.1:5984"},
          {'User-Agent',"Ruby"}]
[Sun, 11 Mar 2012 13:54:57 GMT] [debug] [<0.20942.0>] 'PUT' /mirnaya_development {1,1} from "127.0.0.1"
Headers: [{'Accept',"application/json"},
          {'Accept-Encoding',"gzip, deflate"},
          {'Content-Type',"application/json"},
          {'Host',"127.0.0.1:5984"},
          {'User-Agent',"Ruby"}]
[debug] [<0.20942.0>] OAuth Params: []
[Sun, 11 Mar 2012 13:54:57 GMT] [debug] [<0.20942.0>] OAuth Params: []
[debug] [<0.20942.0>] Minor error in HTTP request: {unauthorized,
                                                    <<"Authentication required.">>}
[Sun, 11 Mar 2012 13:54:57 GMT] [debug] [<0.20942.0>] Minor error in HTTP request: {unauthorized,
                                                    <<"Authentication required.">>}
[debug] [<0.20942.0>] Stacktrace: [{io_lib_pretty,cind_tag_tuple,7},
                                   {io_lib_pretty,while_fail,3},
                                   {io_lib_pretty,print,6},
                                   {io_lib_format,build,3},
                                   {io_lib_format,build,3},
                                   {io_lib_format,build,3},
                                   {io_lib_format,build,3},
                                   {io_lib_format,build,3}]
[Sun, 11 Mar 2012 13:54:57 GMT] [debug] [<0.20942.0>] Stacktrace: [{io_lib_pretty,cind_tag_tuple,7},
                                   {io_lib_pretty,while_fail,3},
                                   {io_lib_pretty,print,6},
                                   {io_lib_format,build,3},
                                   {io_lib_format,build,3},
                                   {io_lib_format,build,3},
                                   {io_lib_format,build,3},
                                   {io_lib_format,build,3}]
[info] [<0.20942.0>] 127.0.0.1 - - 'PUT' /mirnaya_development 401
[Sun, 11 Mar 2012 13:54:57 GMT] [info] [<0.20942.0>] 127.0.0.1 - - 'PUT' /mirnaya_development 401
[debug] [<0.20942.0>] httpd 401 error response:
 {"error":"unauthorized","reason":"Authentication required."}

[Sun, 11 Mar 2012 13:54:57 GMT] [debug] [<0.20942.0>] httpd 401 error response:
 {"error":"unauthorized","reason":"Authentication required."}

It looks like padrino code doesn't try to authenticate at all. What am I doing wrong?

This all was due to config misunderstanding. Solved.

@argent-smith - how did you resolve this? I'm experiencing the same issue right now. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment