The short answer is that there is no function couch_doc:to_json_doc/2
that accepts the arguments ( {not_found, missing}, [] ) gracefully
> {function_clause,
> [{couch_doc,to_json_obj,[{not_found,missing},[]]},
> ...
Some possibilities are
a) couch_doc:to_json_doc/2 should accept that arg and return ???
b) previous fun should never pass that arg to couch_doc:to_json_doc
(possibly bug in previous arg(s)
c) ?
I have not backtracked any further than that.
~Michael
On Fri, Jan 09, 2009 at 05:04:37PM -0800, John Bartak wrote:
> I've setup some tests that generate multiple identical requests to the same
> view at the same time. One of the requests for a view occasionally fails
> while the other one succeeds.
>
> The get request the gets sent to the server is:
> [info] [<0.16662.0>] 192.168.200.1 - - 'GET'
> /fileinttests_20090109_163919_286_1161293461/_view/MultiFieldQuery_type_OwnerId_Name/view?key=%5b%22repository.repositoryfile%22%2c%22ownerid%22%2c%22filename%22%5d&include_docs=true
> 200
>
> The view code is very simple:
> function(doc){
> if (doc.type && doc.OwnerId && doc.Name) {
> emit([(doc.type.toLowerCase) ? doc.type.toLowerCase():
> doc.type,(doc.OwnerId.toLowerCase) ? doc.OwnerId.toLowerCase():
> doc.OwnerId,(doc.Name.toLowerCase) ? doc.Name.toLowerCase(): doc.Name],null);
> }
> }
>
> I'm wondering if I'm doing something wrong or if this is expected behavior or
> if there is a bug in CouchDB?
>
> This is with CouchDB version: 0.9.0a712213
>
> I get the following error:
>
> [error] [<0.17007.0>] {error_report,
> <0.22.0>,
> {<0.17007.0>,
> crash_report,
> [[{pid,<0.17007.0>},
> {registered_name,[]},
> {error_info,
> {function_clause,
> [{couch_doc,to_json_obj,[{not_found,missing},[]]},
> {couch_httpd_view,view_row_obj,3},
> {couch_httpd_view,'-make_view_fold_fun/5-fun-2-',9},
> {couch_view,fold_fun,4},
> {couch_btree,stream_kv_node2,7},
> {couch_btree,fold,5},
> {couch_view,fold,5},
> {couch_httpd_view,output_map_view,5}]}},
> {initial_call,
> {mochiweb_socket_server,
> acceptor_loop,
> [{<0.57.0>,#Port<0.128>,#Fun<mochiweb_http.1.62821608>}]}},
> {ancestors,[couch_httpd,<0.52.0>,couch_server_sup,<0.1.0>]},
> {messages,[]},
> {links,[#Port<0.4336>,<0.57.0>,#Port<0.4331>]},
> {dictionary,
> [{mochiweb_request_qs,
> [{"key",
>
> "[\"autodesk.social.services.files.repository.repositoryfile\",\"ownerid\",\"filename\"]"},
> {"include_docs","true"}]},
> {couch_drv_port,#Port<0.4336>}]},
> {trap_exit,false},
> {status,running},
> {heap_size,4181},
> {stack_size,21},
> {reductions,366135}],
> []]}}
> [error] [<0.57.0>] {error_report,
> <0.22.0>,
> {<0.57.0>,
> std_error,
> {mochiweb_socket_server,
> 235,
> {child_error,
> {function_clause,
> [{couch_doc,to_json_obj,[{not_found,missing},[]]},
> {couch_httpd_view,view_row_obj,3},
> {couch_httpd_view,'-make_view_fold_fun/5-fun-2-',9},
> {couch_view,fold_fun,4},
> {couch_btree,stream_kv_node2,7},
> {couch_btree,fold,5},
> {couch_view,fold,5},
> {couch_httpd_view,output_map_view,5}]}}}}}
>
> =ERROR REPORT==== 9-Jan-2009::16:39:23 ===
> {mochiweb_socket_server,
> 235,
> {child_error,
> {function_clause,
> [{couch_doc,to_json_obj,[{not_found,missing},[]]},
> {couch_httpd_view,view_row_obj,3},
> {couch_httpd_view,'-make_view_fold_fun/5-fun-2-',9},
> {couch_view,fold_fun,4},
> {couch_btree,stream_kv_node2,7},
> {couch_btree,fold,5},
> {couch_view,fold,5},
> {couch_httpd_view,output_map_view,5}]}}}
>
--
Michael McDaniel
Portland, Oregon, USA
http://trip.autosys.us
http://autosys.us