CouchDB 0.8.0 on 9.04 seems broken

Bug #474360 reported by Morten Siebuhr
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
couchdb (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: couchdb

When installing and trying to use views, CouchDB returns strange and little-usable errors:

Install:
> sudo apt-get install couchdb

Create DB and design document:
> curl -X PUT http://127.0.0.1:5984/test
> curl -X PUT http://127.0.0.1:5984/test/_design/example -d '{"_id": "_design/example","views": {"foo":{"map": "function(doc)emit(doc._id, doc._rev)}"}}}'

Insert a few dummy pages:
> curl -X POST http://127.0.0.1:5984/test -d '{}'
> curl -X POST http://127.0.0.1:5984/test -d '{}'
> curl -X POST http://127.0.0.1:5984/test -d '{}'

Query of 'foo' view fails:
> curl http://127.0.0.1:5984/basic/_design/example/_view/foo
{'EXIT',
                        {function_clause,
                         [{couch_httpd,handle_db_request,
                           [{mochiweb_request,#Port<0.1161>,'GET',
                             "/basic/_design/example/_view/foo",
                             {1,1},
                             {3,
                              {"user-agent",
                               {'User-Agent',
                                "curl/7.18.2 (i486-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.10"},
                               {"host",
                                {'Host',"127.0.0.1:5984"},
                                {"accept",{'Accept',"*/*"},nil,nil},
                                nil},
                               nil}}},
                            'GET',
                            {"basic",<0.80.0>,
                             ["_design","example","_view","foo"]}]},
                          {couch_httpd,handle_request,2},
                          {mochiweb_http,headers,4},
                          {proc_lib,init_p_do_apply,3}]}}

The exact same sequence of commands works on CouchDB 0.10.0 (under Ubuntu 9.10).

Revision history for this message
Morten Siebuhr (msiebuhr) wrote :

The query should be 'curl http://127.0.0.1:5984/test/_design/example/_view/foo' (use the 'test' database instead of the 'basic'; I tried testing on several databases - cut&paste error on my part)

Revision history for this message
Roman Yepishev (rye) wrote :

Thanks for reporting this bug.

It looks like you have the syntax error in your map function:
function(doc)emit(doc._id, doc._rev)}
There should be opening brace before emit() call.

Additionally the view needs to be called as:
$ curl http://127.0.0.1:5984/test/_view/example/foo
{"total_rows":3,"offset":0,"rows":[
{"id":"092dd64e04afa25833a276a9873c92cb","key":"092dd64e04afa25833a276a9873c92cb","value":"215513193"},
{"id":"0a8bb6310a6d47c34a16f539018245f4","key":"0a8bb6310a6d47c34a16f539018245f4","value":"972520306"},
{"id":"40525dbd40ef1ed7989fedc65f45e48d","key":"40525dbd40ef1ed7989fedc65f45e48d","value":"328236368"}
]}

Marking this bug as Invalid since the server appears to be working fine.
Tested with couchdb 0.8.0-2 on Ubuntu 9.04

Changed in couchdb (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.