<div dir="ltr">Hello,<div><br></div><div>I need to delete buckets on production. I am using Riak 1.3.0. As <a href="http://docs.basho.com/riak/1.2.1/references/apis/http/#Bucket-Operations">Bucket Operations</a> doesn't provide any API to delete bucket,  I was trying delete_keys reducer available in <a href="https://github.com/basho/riak_function_contrib/blob/master/mapreduce/erlang/delete_keys.erl">contrib</a> directory</div>
<div><br></div><div>I populated a bucket "testing3" and populated it with 100 items</div><div>My MapReduce query looks like</div><div><div><font face="courier new, monospace">{</font></div><div><font face="courier new, monospace">  "inputs": "testing3",</font></div>
<div><font face="courier new, monospace">  "query": [{"map": {"language": "javascript",</font></div><div><font face="courier new, monospace">                     "source": "function(value, keydata, args){return [[value.bucket, value.key]];}"}},</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">           {"reduce": {"language": "erlang",</font></div><div><font face="courier new, monospace">                       "module": "delete_keys",</font></div>
<div><font face="courier new, monospace">                       "function": "delete"}}],</font></div><div><font face="courier new, monospace">  "timeout": 900000</font></div><div><font face="courier new, monospace">}</font></div>
<div><br></div><div style>I have also verified that "delete_keys" module is being included</div><div style><br></div><div style><div><font face="courier new, monospace">(<a href="mailto:dev1@127.0.0.1">dev1@127.0.0.1</a>)1> delete_keys:module_info().</font></div>
<div><font face="courier new, monospace">[{exports,[{module_info,0},{module_info,1},{delete,2}]},</font></div><div><font face="courier new, monospace"> {imports,[]},</font></div><div><font face="courier new, monospace"> {attributes,[{vsn,[308055930713635303025382691973616137846]}]},</font></div>
<div><font face="courier new, monospace"> {compile,[{options,[{outdir,"/Users/kiran/work/riak-work/mapred/erlang"}]},</font></div><div><font face="courier new, monospace">           {version,"4.8.1"},</font></div>
<div><font face="courier new, monospace">           {time,{2013,7,13,17,56,26}},</font></div><div><font face="courier new, monospace">           {source,"/Users/kiran/work/riak-work/mapred/erlang/delete_keys.erl"}]}]</font></div>
<div><br></div></div><div style>But It throws of following error I am quite clueless. Any help will be appreciated</div><div style><br></div><div style><div>html><head><title>500 Internal Server Error</title></head><body><h1>Internal Server Error</h1>The server encountered an error while processing this request:<br><pre>{error,</div>
<div>    {error,</div><div>        {case_clause,</div><div>            {error,</div><div>                {1,</div><div>                 [{module,riak_kv_w_reduce},</div><div>                  {partition,433883298582611803841718934712646521460354973696},</div>
<div>                  {details,</div><div>                      [{fitting,</div><div>                           {fitting,<0.5892.0>,#Ref<0.0.0.33932>,</div><div>                               <<"K�������������������">>,1}},</div>
<div>                       {name,1},</div><div>                       {module,riak_kv_w_reduce},</div><div>                       {arg,{rct,#Fun<delete_keys.delete.2>,none}},</div><div>                       {output,</div>
<div>                           {fitting,<0.5890.0>,#Ref<0.0.0.33932>,sink,</div><div>                               undefined}},</div><div>                       {options,</div><div>                           [{log,sink},</div>
<div>                            {trace,[error]},</div><div>                            {sink,</div><div>                                {fitting,<0.5890.0>,#Ref<0.0.0.33932>,sink,</div><div>                                    undefined}},</div>
<div>                            {sink_type,{fsm,10,infinity}}]},</div><div>                       {q_limit,64}]},</div><div>                  {type,error},</div><div>                  {error,undef},</div><div>                  {input,[<<"testing3">>,<<"84">>]},</div>
<div>                  {modstate,</div><div>                      {state,[],</div><div>                          [[<<"testing3">>,<<"90">>],</div><div>                           [<<"testing3">>,<<"27">>],</div>
<div>                           [<<"testing3">>,<<"8">>],</div><div>                           [<<"testing3">>,<<"88">>],</div><div>                           [<<"testing3">>,<<"11">>],</div>
<div>                           [<<"testing3">>,<<"23">>],</div><div>                           [<<"testing3">>,<<"46">>],</div><div>
                           [<<"testing3">>,<<"12">>],</div><div>                           [<<"testing3">>,<<"77">>],</div><div>                           [<<"testing3">>,<<"15">>],</div>
<div>                           [<<"testing3">>,<<"22">>],</div><div>                           [<<"testing3">>,<<"74">>],</div><div>
                           [<<"testing3">>,<<"86">>],</div><div>                           [<<"testing3">>,<<"85">>],</div><div>                           [<<"testing3">>,<<"6">>],</div>
<div>                           [<<"testing3">>,<<"73">>],</div><div>                           [<<"testing3">>,<<"94">>],</div><div>
                           [<<"testing3">>,<<"13">>],</div><div>                           [<<"testing3">>,<<"89">>]],</div><div>                          19,20,</div>
<div>                          433883298582611803841718934712646521460354973696,</div><div>                          {fitting_details,</div><div>                              {fitting,<0.5892.0>,#Ref<0.0.0.33932>,</div>
<div>                                  <<"K�������������������">>,1},</div><div>                              1,riak_kv_w_reduce,</div><div>                              {rct,#Fun<delete_keys.delete.2>,none},</div>
<div>                              {fitting,<0.5890.0>,#Ref<0.0.0.33932>,sink,</div><div>                                  undefined},</div><div>                              [{log,sink},</div><div>                               {trace,[error]},</div>
<div>                               {sink,</div><div>                                   {fitting,<0.5890.0>,#Ref<0.0.0.33932>,</div><div>                                       sink,undefined}},</div><div>                               {sink_type,{fsm,10,infinity}}],</div>
<div>                              64}}},</div><div>                  {stack,</div><div>                      [{delete_keys,delete,</div><div>                           [[[<<"testing3">>,<<"89">>],</div>
<div>                             [<<"testing3">>,<<"13">>],</div><div>                             [<<"testing3">>,<<"94">>],</div><div>
                             [<<"testing3">>,<<"73">>],</div><div>                             [<<"testing3">>,<<"6">>],</div><div>                             [<<"testing3">>,<<"85">>],</div>
<div>                             [<<"testing3">>,<<"86">>],</div><div>                             [<<"testing3">>,<<"74">>],</div><div>
                             [<<"testing3">>,<<"22">>],</div><div>                             [<<"testing3">>,<<"15">>],</div><div>                             [<<"testing3">>,<<"77">>],</div>
<div>                             [<<"testing3">>,<<"12">>],</div><div>                             [<<"testing3">>,<<"46">>],</div><div>
                             [<<"testing3">>,<<"23">>],</div><div>                             [<<"testing3">>,<<"11">>],</div><div>                             [<<"testing3">>,<<"88">>],</div>
<div>                             [<<"testing3">>,<<"8">>],</div><div>                             [<<"testing3">>,<<"27">>],</div><div>
                             [<<"testing3">>,<<"90">>],</div><div>                             [<<"testing3">>,<<"84">>]],</div><div>
                            none],</div><div>                           []},</div><div>                       {riak_kv_w_reduce,reduce,3,</div><div>                           [{file,"src/riak_kv_w_reduce.erl"},{line,206}]},</div>
<div>                       {riak_kv_w_reduce,maybe_reduce,2,</div><div>                           [{file,"src/riak_kv_w_reduce.erl"},{line,157}]},</div><div>                       {riak_pipe_vnode_worker,process_input,3,</div>
<div>                           [{file,"src/riak_pipe_vnode_worker.erl"},</div><div>                            {line,444}]},</div><div>                       {riak_pipe_vnode_worker,wait_for_input,2,</div><div>
                           [{file,"src/riak_pipe_vnode_worker.erl"},</div><div>                            {line,376}]},</div><div>                       {gen_fsm,handle_msg,7,</div><div>                           [{file,"gen_fsm.erl"},{line,494}]},</div>
<div>                       {proc_lib,init_p_do_apply,3,</div><div>                           [{file,"proc_lib.erl"},{line,227}]}]}]}}},</div><div>        [{riak_kv_wm_mapred,pipe_mapred_nonchunked,3,</div><div>
             [{file,"src/riak_kv_wm_mapred.erl"},{line,180}]},</div><div>         {webmachine_resource,resource_call,3,</div><div>             [{file,"src/webmachine_resource.erl"},{line,183}]},</div><div>
         {webmachine_resource,do,3,</div><div>             [{file,"src/webmachine_resource.erl"},{line,141}]},</div><div>         {webmachine_decision_core,resource_call,1,</div><div>             [{file,"src/webmachine_decision_core.erl"},{line,48}]},</div>
<div>         {webmachine_decision_core,decision,1,</div><div>             [{file,"src/webmachine_decision_core.erl"},{line,481}]},</div><div>         {webmachine_decision_core,handle_request,2,</div><div>             [{file,"src/webmachine_decision_core.erl"},{line,33}]},</div>
<div>         {webmachine_mochiweb,loop,1,</div><div>             [{file,"src/webmachine_mochiweb.erl"},{line,97}]},</div><div>         {mochiweb_http,parse_headers,5,</div><div>* Connection #0 to host 127.0.0.1 left intact</div>
<div>             [{file,"src/mochiweb_http.erl"},{line,180}]}]}}</pre><P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></body></html>* Closing connection #0</div>
</div>-- <br>Kiran Kulkarni</div></div>