tonysun83 commented on issue #1789: New Feature: Database Partitions URL: https://github.com/apache/couchdb/pull/1789#issuecomment-451832094 When creating a mango json/text index, and the user doesn't specify`"ddoc" : "<partitionname>:<design_docid>"`, we get a 500 error (instead of a 400). ``` { "error": "error_saving_ddoc", "reason": "Unknown error while saving the design document: unknown_error", "ref": 452476559 } ``` We know mango automatically creates the ddocid when not provided so it's not conforming to the partition format. I think the error message isn't handled correctly somewhere leading to a gen_server crash and thus it doesn't get propagated up. ``` [info] 2019-01-07T06:06:47.415090Z [email protected] <0.24733.0> 9108cd090a 9108cd090a 127.0.0.1 localhost:5984 POST /partitiondb/_index 500 ok 8 [error] 2019-01-07T06:06:47.414666Z [email protected] <0.11851.0> -------- gen_server <0.11851.0> terminated with reason: bad return value {illegal_docid,<<"Doc id must be of form partition:id">>} last msg: {update_docs,<0.24906.0>,[[{doc,<<"_design/c1d29e81d94c805422e8b27d5891b97c0fa0a0d2">>,{1,[<<218,118,244,112,98,6,119,52,117,157,178,147,84,93,101,169>>]},[<<128,0,0,225>>,<<245,194,40,241,77,161,96,237,110,110,181,149,3,122,8,42>>,<<131,104,2,109,0,0,0,207,1,174,2,88,131,104,1,108,0,0,0,3,104,2,109,0,0,0,8,108,97,110,103,117,97,103,101,1,13,20,5,113,117,101,114,121,9,25,20,5,118,105,101,119,115,9,44,0,1,9,19,36,9,102,111,111,45,105,110,100,101,120,9,23,13,67,12,3,109,97,112,9,17,0,2,9,40,20,6,102,105,101,108,100,54,60,0,4,1,97,1,97,16,3,97,115,99,106,9,37,104,23,112,97,114,116,105,97,108,95,102,105,108,116,101,114,95,115,101,108,101,99,116,111,114,104,1,106,13,34,20,6,114,101,100,117,99,5,153,24,6,95,99,111,117,110,116,9,58,28,7,111,112,116,105,111,110,115,9,116,13,156,12,3,100,101,102,50,17,0,13,133,1,235,0,1,1,123,8,1,97,106,1,1,106,67,0,0,11,5,146,56,116,105,111,110,101,100,100,0,4,116,114,117,101,106,106,109,0,0,0,5,1,2,4,131,106>>],[],false,[{comp_body,<<1,174,2,88,131,104,1,108,0,0,0,3,104,2,109,0,0,0,8,108,97,110,103,117,97,103,101,1,13,20,5,113,117,101,114,121,9,25,20,5,118,105,101,119,115,9,44,0,1,9,19,36,9,102,111,111,45,105,110,100,101,120,9,23,13,67,12,3,109,97,112,9,17,0,2,9,40,20,6,102,105,101,108,100,54,60,0,4,1,97,1,97,16,3,97,115,99,106,9,37,104,23,112,97,114,116,105,97,108,95,102,105,108,116,101,114,95,115,101,108,101,99,116,111,114,104,1,106,13,34,20,6,114,101,100,117,99,5,153,24,6,95,99,111,117,110,116,9,58,28,7,111,112,116,105,111,110,115,9,116,13,156,12,3,100,101,102,50,17,0,13,133,1,235,0,1,1,123,8,1,97,106,1,1,106,67,0,0,11,5,146,56,116,105,111,110,101,100,100,0,4,116,114,117,101,106,106>>},{size_info,[]},{atts_stream,nil},{ejson_size,387},{ref,#Ref<0.2404497343.1436811265.145848>}]}]],[],false,true} state: {db,1,<<"shards/20000000-3fffffff/partitiondb.1546826084">>,"/Users/tonysun/github/cloudant/partitiondb/dev/lib/node3/data/dbs/shards/20000000-3fffffff/partitiondb.1546826084.couch",{couch_bt_engine,{st,"/Users/tonysun/github/cloudant/partitiondb/dev/lib/node3/data/dbs/shards/20000000-3fffffff/partitiondb.1546826084.couch",<0.11852.0>,#Ref<0.2404497343.1436811269.53299>,[before_header,after_header,on_file_open],{db_header,7,0,0,nil,nil,{12448,[],326},nil,nil,4253,1000,<<"d947ffdbbb88cfcceec1aa1dfa8ee453">>,[{'[email protected]',0}],0,1000,0},false,{btree,<0.11852.0>,nil,#Fun<couch_bt_engine.id_tree_split.1>,#Fun<couch_bt_engine.id_tree_join.2>,undefined,#Fun<couch_bt_engine.id_tree_reduce.2>,snappy},{btree,<0.11852.0>,nil,#Fun<couch_bt_engine.seq_tree_split.1>,#Fun<couch_bt_engine.seq_tree_join.2>,undefined,#Fun<couch_bt_engine.seq_tree_reduce.2>,snappy},{btree,<0.11852.0>,{12448,[],326},#Fun<couch_bt_engine.local_tree_split.1>,#Fun<couch_bt_engine.local_tree_join.2>,undefined,nil,snappy},snappy,{btree,<0.11852.0>,nil,#Fun<couch_bt_engine.purge_tree_split.1>,#Fun<couch_bt_engine.purge_tree_join.2>,undefined,#Fun<couch_bt_engine.purge_tree_reduce.2>,snappy},{btree,<0.11852.0>,nil,#Fun<couch_bt_engine.purge_seq_tree_split.1>,#Fun<couch_bt_engine.purge_seq_tree_join.2>,undefined,#Fun<couch_bt_engine.purge_tree_reduce.2>,snappy}}},<0.11851.0>,nil,0,<<"1546840571318289">>,{user_ctx,null,[],undefined},[],undefined,nil,nil,nil,[{default_security_object,[]},{create_if_missing,true},{props,[{partitioned,true},{hash,[couch_partition,hash,[]]}]}],undefined} ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
