Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-2744

_all_dbs returns broken response when keys query parameter is used

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 2.0.0
    • 2.0.1
    • HTTP Interface
    • None

    Description

      ~ $ curl -XPUT http://localhost:59840/db
      {"ok":true}
      
      ~ $ curl -XPUT http://localhost:59840/test
      {"ok":true}
      
      ~ $ curl -XGET 'http://localhost:59840/_all_dbs?key="test"'
      ["test"]
      
      ~ $ curl -XGET 'http://localhost:59840/_all_dbs?key="db"'
      ["db"]
      
      ~ $ curl -XGET 'http://localhost:59840/_all_dbs?startkey="db"&endkey="test/"'
      ["db","test"]
      
      ~ $ curl -XGET 'http://localhost:59840/_all_dbs?keys=\["db","test"\]'
      curl: (18) transfer closed with outstanding read data remaining
      
      ~ $ curl  -v -XGET 'http://localhost:59840/_all_dbs?keys=\["db","test"\]'
      *   Trying ::1...
      * connect to ::1 port 59840 failed: Connection refused
      *   Trying 127.0.0.1...
      * Connected to localhost (127.0.0.1) port 59840 (#0)
      > GET /_all_dbs?keys=["db","test"] HTTP/1.1
      > Host: localhost:59840
      > User-Agent: curl/7.43.0
      > Accept: */*
      > 
      < HTTP/1.1 200 OK
      < X-CouchDB-Body-Time: 0
      < X-Couch-Request-ID: e215f1e866
      < Transfer-Encoding: chunked
      < Server: CouchDB/f29e590 (Erlang OTP/18)
      < Etag: "D0LI59O6S1E5P0UV53BZZ7U9"
      < Date: Wed, 08 Jul 2015 23:36:21 GMT
      < Content-Type: text/plain; charset=utf-8
      < Cache-Control: must-revalidate
      < 
      * transfer closed with outstanding read data remaining
      * Closing connection 0
      curl: (18) transfer closed with outstanding read data remaining
      

      Meanwhile in logs:

      2015-07-09 02:39:05.719 [notice] node1@127.0.0.1 <0.14013.3> af9a6ad1a3 127.0.0.1 localhost:59840 GET /_all_dbs?keys=["db","test"] 200 aborted 3
      2015-07-09 02:39:05.719 [error] node1@127.0.0.1 <0.14013.3> Response abnormally terminated: {<<"db">>,database_does_not_exist}
      2015-07-09 02:39:07.657 [error] node1@127.0.0.1 <0.15730.3> _all_docs open error: _dbs db :: {error,database_does_not_exist} [{mem3_shards,load_shards_from_db,[95,100,98,115],[{file,[115,114,99,47,109,101,109,51,95,115,104,97,114,100,115,46,101,114,108]},{line,282}]},{mem3_shards,load_shards_from_disk,1,[{file,[115,114,99,47,109,101,109,51,95,115,104,97,114,100,115,46,101,114,108]},{line,270}]},{mem3_shards,load_shards_from_disk,2,[{file,[115,114,99,47,109,101,109,51,95,115,104,97,114,100,115,46,101,114,108]},{line,286}]},{mem3_shards,for_docid,3,[{file,[115,114,99,47,109,101,109,51,95,115,104,97,114,100,115,46,101,114,108]},{line,85}]},{fabric_doc_open,go,3,[{file,[115,114,99,47,102,97,98,114,105,99,95,100,111,99,95,111,112,101,110,46,101,114,108]},{line,38}]},{fabric_view_all_docs,open_doc_int,4,[{file,[115,114,99,47,102,97,98,114,105,99,95,118,105,101,119,95,97,108,108,95,100,111,99,115,46,101,114,108]},{line,228}]},{fabric_view_all_docs,open_doc,4,[{file,[115,114,99,47,102,97,98,114,105,99,95,118,105,101,119,95,97,108,108,95,100,111,99,115,46,101,114,108]},{line,217}]}]
      2015-07-09 02:39:07.657 [notice] node1@127.0.0.1 <0.15714.3> b19fb3debf 127.0.0.1 localhost:59840 GET /_all_dbs?keys=["db","test"] 200 aborted 2
      2015-07-09 02:39:07.657 [error] node1@127.0.0.1 <0.15714.3> Response abnormally terminated: {<<"db">>,database_does_not_exist}
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            kxepal Alexander Shorin
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: