2013-09-30 25 views
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}] 

要分號和錯誤消失後加空格解決這個問題我所做的就是,我更新視圖源代碼。添加空間或任何不違反JavaScript語法的字符(即在視圖源代碼中向註釋添加字母)將恢復上述錯誤,並且Couch DB將返回數據。如果我恢復更改,它將再次開始提供上述錯誤。不幸的是,我所做的改變這個錯誤沒有意義。我嘗試重新啓動Couch DB並檢查了Couchdb .couch文件的權限。任何幫助將不勝感激。

更新:這是我用來從DB

function(doc) { 
    if (doc.documentType == 'com.acme.Order' && (doc.lock != null)) { 
    emit(doc.documentObject.createdTime, doc); 
    } 
} 
+0

你可以包含視圖的代碼嗎?什麼是觸發這個HTTP請求?什麼是你使用的couchdb版本? –

+0

我正在使用沙發數據庫1.3.0。 GET請求用於從視圖中獲取結果。函數(doc)if(doc.documentType =='com.acme.Order'&&(doc.lock!= null)){emit(doc.documentObject.createdTime,doc); } } – Bunti

回答

0

好取的數據集,讓我來猜猜視圖內容。你的文件是相當大的東西嗎?我想你可能會遇到執行mapdoc的視圖服務器的超時。我想嘗試改變你的看法不將文件發出的值,然後重試,就像這樣:

-emit(doc.documentObject.createdTime, doc); 
+emit(doc.documentObject.createdTime, null); 

這將節省您大量的磁盤空間視圖索引文件,你會讓它更快的方式更快創造。

要獲取文檔體,請將include_docs = true添加到您的查看查詢中。