Couchdb Coach DB在视图更改时出现奇怪的异常

Couchdb Coach DB在视图更改时出现奇怪的异常,couchdb,Couchdb,我在本地数据库上运行沙发视图。由于一些奇怪的怪癖,其中一个视图开始发送包含以下内容的错误报告 {error_report,<0.31.0>, {<0.11889.0>,crash_report, [[{initial_call,{couch_file,init,['Argument__1']}}, {pid,<0.11889.0>},

我在本地数据库上运行沙发视图。由于一些奇怪的怪癖,其中一个视图开始发送包含以下内容的错误报告

{error_report,<0.31.0>,
                   {<0.11889.0>,crash_report,
                    [[{initial_call,{couch_file,init,['Argument__1']}},
                      {pid,<0.11889.0>},
                      {registered_name,[]},
                      {error_info,
                       {exit,
                        {{badmatch,{error,eacces}},
                         [{couch_file,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}]}},
                      {ancestors,[<0.11888.0>,<0.11887.0>]},
                      {messages,[]},
                      {links,[#Port<0.5466>,<0.11888.0>]},
                      {dictionary,[]},
                      {trap_exit,true},
                      {status,running},
                      {heap_size,377},
                      {stack_size,24},
                      {reductions,575}],
                     [{neighbour,
                       [{pid,<0.11887.0>},
                        {registered_name,[]},
                        {initial_call,{erlang,apply,2}},
                        {current_function,{proc_lib,sync_wait,2}},
                        {ancestors,[]},
                        {messages,[]},
                        {links,[<0.11869.0>,<0.11888.0>]},
                        {dictionary,[]},
                        {trap_exit,false},
                        {status,waiting},
                        {heap_size,233},
                        {stack_size,8},
                        {reductions,15}]},
                      {neighbour,
                       [{pid,<0.11888.0>},
                        {registered_name,[]},
                        {initial_call,{couch_index,init,['Argument__1']}},
                        {current_function,{proc_lib,sync_wait,2}},
                        {ancestors,[<0.11887.0>]},
                        {messages,
                         [{ack,<0.11889.0>,
                           {error,
                            {{badmatch,{error,eacces}},
                             [{couch_file,init,1},
                              {gen_server,init_it,6},
                              {proc_lib,init_p_do_apply,3}]}}}]},
                        {links,[<0.11887.0>,<0.11889.0>]},
                        {dictionary,[]},
                        {trap_exit,false},
                        {status,runnable},
                        {heap_size,4181},
                        {stack_size,33},
                        {reductions,1748}]}]]}}
 [error] [<0.11869.0>] ** Generic server couch_index_server terminating 
** Last message in was {'EXIT',<0.11887.0>,
                           {{badmatch,{error,eacces}},
                            [{couch_file,init,1},
                             {gen_server,init_it,6},
                             {proc_lib,init_p_do_apply,3}]}}
** When Server state == {st,"/var/lib/couchdb/1.3.0"}
** Reason for termination == 
** {{badmatch,{error,eacces}},
[{couch_file,init,1},{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]}
[Mon, 30 Sep 2013 06:03:40 GMT] [error] [<0.11869.0>] {error_report,<0.31.0>,
                      {<0.11869.0>,crash_report,
                       [[{initial_call,
                             {couch_index_server,init,['Argument__1']}},
                         {pid,<0.11869.0>},
                         {registered_name,couch_index_server},
                         {error_info,
                             {exit,
                                 {{badmatch,{error,eacces}},
                                  [{couch_file,init,1},
                                   {gen_server,init_it,6},
                                   {proc_lib,init_p_do_apply,3}]},
                                 [{gen_server,terminate,6},
                                  {proc_lib,init_p_do_apply,3}]}},
                         {ancestors,
                             [couch_secondary_services,couch_server_sup,
                              <0.32.0>]},
                         {messages,[]},
                         {links,[<0.11870.0>,<0.8687.0>]},
                         {dictionary,[]},
                         {trap_exit,true},
                         {status,running},
                         {heap_size,987},
                         {stack_size,24},
                         {reductions,495}],
                        [{neighbour,
                             [{pid,<0.11870.0>},
                              {registered_name,[]},
                              {initial_call,
                                  {couch_event_sup,init,['Argument__1']}},
                              {current_function,{gen_server,loop,6}},
                              {ancestors,
                                  [couch_index_server,
                                   couch_secondary_services,
                                   couch_server_sup,<0.32.0>]},
                              {messages,[]},
                              {links,[<0.11869.0>,<0.8682.0>]},
                              {dictionary,[]},
                              {trap_exit,false},
                              {status,waiting},
                              {heap_size,233},
                              {stack_size,9},
                              {reductions,32}]}]]}}
[Mon, 30 Sep 2013 06:03:40 GMT] [error] [<0.8687.0>] {error_report,<0.31.0>,
                     {<0.8687.0>,supervisor_report,
                      [{supervisor,{local,couch_secondary_services}},
                       {errorContext,child_terminated},
                       {reason,
                           {{badmatch,{error,eacces}},
                            [{couch_file,init,1},
                             {gen_server,init_it,6},
                             {proc_lib,init_p_do_apply,3}]}},
                       {offender,
                           [{pid,<0.11869.0>},
                            {name,index_server},
                            {mfargs,{couch_index_server,start_link,[]}},
                            {restart_type,permanent},
                            {shutdown,brutal_kill},
                            {child_type,worker}]}]}}
[Mon, 30 Sep 2013 06:03:40 GMT] [error] [<0.11069.0>] Uncaught error in HTTP request: {exit,
                                                   {{{badmatch,
                                                      {error,eacces}},
                                                     [{couch_file,init,1},
                                                      {gen_server,
                                                       init_it,6},
                                                      {proc_lib,
                                                       init_p_do_apply,
                                                       3}]},
                                                    {gen_server,call,
                                                     [couch_index_server,
                                                      {get_index,
                                                       {couch_mrview_index,
                                                        {mrst,
                                                         <<117,203,135,163,
                                                           183,160,137,85,
                                                           158,17,190,127,
                                                           58,84,144,172>>,
                                                         nil,undefined,
                                                         <<"kri008">>,
                                                         <<"_design/order">>,
                                                         <<"javascript">>,
                                                         [],
                                                         {[]},
                                                         [{mrview,0,0,0,
                                                           [<<"getAllOpen">>],
                                                           [],
 --------------------------------------------------------

[Mon, 30 Sep 2013 06:03:40 GMT] [info] [<0.11069.0>] Stacktrace: [{gen_server,call,3},
                              {couch_index_server,get_index,4},
                              {couch_mrview_util,get_view,4},
                              {couch_mrview,query_view,6},
                              {couch_httpd,etag_maybe,2},
                              {couch_mrview_http,design_doc_view,5},
                              {couch_httpd_db,do_db_req,2},
                              {couch_httpd,handle_request_int,5}]

好吧,让我随便猜一猜。您的文档是否相当大?我认为您可能会遇到视图服务器执行mapdoc的超时。我会尝试更改您的视图,不将文档作为值发送,然后重试,如下所示:

-emit(doc.documentObject.createdTime, doc);
+emit(doc.documentObject.createdTime, null);
这将为视图索引文件节省大量磁盘空间,并使其创建速度更快


要获取文档正文,请将include_docs=true添加到视图查询中。

好的,让我大胆猜测一下。您的文档是否相当大?我认为您可能会遇到视图服务器执行mapdoc的超时。我会尝试更改您的视图,不将文档作为值发送,然后重试,如下所示:

-emit(doc.documentObject.createdTime, doc);
+emit(doc.documentObject.createdTime, null);
这将为视图索引文件节省大量磁盘空间,并使其创建速度更快


要获取文档正文,请将include\u docs=true添加到视图查询中。

是否可以包含视图的代码?触发此操作的http请求是什么?您使用的couchdb版本是什么?我使用的是Coach DB 1.3.0。GET请求用于从视图中获取结果。函数(doc){if(doc.documentType=='com.acme.Order'&&(doc.lock!=null)){emit(doc.documentObject.createdTime,doc);}}您可以包括视图的代码吗?触发此操作的http请求是什么?您使用的couchdb版本是什么?我使用的是Coach DB 1.3.0。GET请求用于从视图中获取结果。函数(doc){if(doc.documentType='com.acme.Order'&&(doc.lock!=null)){emit(doc.documentObject.createdTime,doc);}