Eric Avdey created COUCHDB-2729:
-----------------------------------

             Summary: End-point /db/_compact/design-doc is broken
                 Key: COUCHDB-2729
                 URL: https://issues.apache.org/jira/browse/COUCHDB-2729
             Project: CouchDB
          Issue Type: Bug
      Security Level: public (Regular issues)
            Reporter: Eric Avdey


To reproduce the issue create a database with a view and try to run compaction 
for this view on a non-cluster interface. This results into badmatch for 
illegal_docid:

curl http://tom:foo@localhost:5984/tora -X PUT

curl http://localhost:5984/tora/_design/app -X PUT -H 
'Content-Type:application/json' -d '{"views" : {"str": {"map" : "function(doc) 
{emit(doc.value, null);}"}}}'

curl http://localhost:5984/tora -X POST -H 'Content-Type:application/json' -d 
'{"value" : "aaa"}'

curl http://tom:foo@localhost:5984/tora/_design/app/_view/str
{"total_rows":1,"offset":0,"rows":[
{"id":"41bd6bc2a0ee26f908c839997a000597","key":"aaa","value":null}
]}

curl 
http://localhost:15986/shards%2F80000000-9fffffff%2Ftora.1435267407/_compact/app
 -X POST -H 'Content-Type:application/json'

{"error":"badmatch","reason":"{{illegal_docid,{doc,<<\"_design/app\">>,\n       
              {1,\n                      
[<<219,7,218,181,145,251,198,254,172,16,236,57,104,237,\n                       
  236,21>>]},\n                     {[{<<\"views\">>,\n                        
{[{<<\"str\">>,\n                           {[{<<\"map\">>,\n                   
           <<\"function(doc) {emit(doc.value, null);}\">>}]}}]}}]},\n           
          [],false,[]}},\n [{fabric,docid,1},\n  {fabric,open_doc,3},\n  
{couch_index_server,'-get_index/3-fun-0-',2}]}"}





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to