Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.1
-
None
-
Apple OS X 10.6, CouchDB 1.1.0, Erlang R14B03
Description
Couchdb 1.1.0 throws an exception when passing a null doc_ids. This error does not happen in 1.0.2. Here's an example:
$ curl -H "content-type: application/json" -XPUT "http://127.0.0.1:5984/couchrest-test"
$ curl -H "content-type: application/json" -XPUT "http://127.0.0.1:5984/couchrest-test-replication"
$ curl -H "content-type: application/json" -XPOST -d "
{\"doc_ids\":null,\"target\":\"couchrest-test-replication\",\"create_target\":false,\"continuous\":false,\"source\":\"http://127.0.0.1:5984/couchrest-test\"}" "http://127.0.0.1:5984/_replicate"
{"error":"case_clause","reason":"{error,\n {{{badmatch,\n {error,\n {{case_clause,null},\n [
The couchdb log file reports:
[Fri, 12 Aug 2011 23:30:24 GMT] [info] [<0.6901.0>] 127.0.0.1 - - 'HEAD' /couchrest-test/ 200
[Fri, 12 Aug 2011 23:30:24 GMT] [info] [<0.6902.0>] 127.0.0.1 - - 'GET' /couchrest-test/ 200
[Fri, 12 Aug 2011 23:30:24 GMT] [info] [<0.6904.0>] 127.0.0.1 - - 'GET' /couchrest-test/_local/f88508b53ee0a5ccd49aa64197f385ae 404
[Fri, 12 Aug 2011 23:30:24 GMT] [info] [<0.6905.0>] 127.0.0.1 - - 'GET' /couchrest-test/_local/95173aa20da0c34f68b0ae173cf37d1e 404
[Fri, 12 Aug 2011 23:30:24 GMT] [error] [<0.6928.0>] {error_report,<0.328.0>,
{<0.6928.0>,crash_report,
[[{initial_call,
{couch_rep_changes_feed,init,['Argument__1']}},
{pid,<0.6928.0>},
{registered_name,[]},
{error_info,
{exit,
{{case_clause,null},
[{couch_rep_changes_feed,init,1}
,
{proc_lib,init_p_do_apply,3}]},
[{gen_server,init_it,6}
,
{ancestors, [<0.6919.0>,couch_rep_sup, couch_primary_services,couch_server_sup, <0.329.0>]},
{messages,[]},
{links,[<0.6919.0>]},
{dictionary,[]},
{trap_exit,true},
{status,running},
{heap_size,610},
{stack_size,24},
{reductions,134}],
[]]}}
[Fri, 12 Aug 2011 23:30:24 GMT] [error] [<0.6919.0>] {error_report,<0.328.0>,
{<0.6919.0>,crash_report,
[[{initial_call,{couch_rep,init,['Argument__1']}},
{pid,<0.6919.0>},
{registered_name,[]},
{error_info,
{exit,
{{badmatch,
{error,
{{case_clause,null},
[{couch_rep_changes_feed,init,1},
{gen_server,init_it,6},
{proc_lib,init_p_do_apply,3}
]}}},
[
,
{gen_server,init_it,6},
{proc_lib,init_p_do_apply,3}]},
[{gen_server,init_it,6},
{proc_lib,init_p_do_apply,3}]}},
{ancestors, [couch_rep_sup,couch_primary_services, couch_server_sup,<0.329.0>]},
{messages,
[{'EXIT',<0.6928.0>,
{{case_clause,null},
[{couch_rep_changes_feed,init,1},
{gen_server,init_it,6},
{proc_lib,init_p_do_apply,3}]}}]},
{links,[<0.379.0>]},
{dictionary,[]},
{trap_exit,true},
{status,running},
{heap_size,2584},
{stack_size,24},
{reductions,3370}],
[]]}}
[Fri, 12 Aug 2011 23:30:24 GMT] [error] [<0.6900.0>] Uncaught error in HTTP request: {error,
{case_clause,
{error,
{{{badmatch,
{error,
{{case_clause,
null},
[{couch_rep_changes_feed, init,1},
{gen_server, init_it,6},
{proc_lib, init_p_do_apply, 3}]}}},
[{couch_rep, do_init,1},
{couch_rep,init,1}
,
,
]},
{child,undefined,
"f88508b53ee0a5ccd49aa64197f385ae",
{gen_server,
start_link,
[couch_rep,
["f88508b53ee0a5ccd49aa64197f385ae",
{[
,
,
,
,
]},
{user_ctx,null,
[<<"_admin">>],
<<"
">>}],
[]]},
temporary,1,worker,
[couch_rep]}}}}}
[Fri, 12 Aug 2011 23:30:24 GMT] [info] [<0.6900.0>] Stacktrace: [
,
,
,
{io_lib_format,build,3}
,
{io_lib_format,build,3}
,
]
[Fri, 12 Aug 2011 23:30:24 GMT] [info] [<0.6900.0>] 127.0.0.1 - - 'POST' /_replicate 500
In comparison, here's the replication without null doc_ids:
$ curl -H "content-type: application/json" -XPOST -d "
{\"target\":\"couchrest-test-replication\",\"create_target\":false,\"continuous\":false,\"source\":\"http://127.0.0.1:5984/couchrest-test\"}" "http://127.0.0.1:5984/_replicate"
{"ok":true,"no_changes":true}