incubator-couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Loshkarev (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COUCHDB-1444) missing_named_view error on existing javascript design doc and view
Date Tue, 24 Jul 2012 10:12:35 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-1444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13421302#comment-13421302
] 

Alexey Loshkarev commented on COUCHDB-1444:
-------------------------------------------

I'm encounting such problem almost every day on my couchdb 1.2.0 installation.

The problem is in 2 databases with 8-10 design docs there.

All this databases configured to be compacted every day:

exhaust_orders = [{db_fragmentation, "50%"}, {view_fragmentation, "30%"}]
exhaust = [{db_fragmentation, "30%"}, {view_fragmentation, "30%"}]

My last logged problem description:

First - I received notification from cron-daemon, doing view indexing every 1 minute for every
databases (pinger).

Notification is about "missing_named_view"

There are log message (couchdb.log):

[Tue, 24 Jul 2012 07:37:34 GMT] [info] [<0.24555.62>] 10.0.0.41 - - GET /exhaust_events/_design/driver/_view/events?limit=11&reduce=false
404

I opened to Futon page with this view and press "compact view" button.

Surprisingly, view compaction started for another view, not mine!
Here are running process:

View compaction	exhaust_events, _design/events	2012-07-24 10:55:47	2012-07-24 10:56:07	<0.24784.62>
Progress 12%

But couchdb.log show me, as compaction was started for correct view:

[Tue, 24 Jul 2012 07:55:47 GMT] [info] [<0.24555.62>] 10.0.0.41 - - POST /exhaust_events/_compact/driver
202

No other compaction requests in log for that time period.

Latelly, at compaction end, I see in couchdb.log:

[Tue, 24 Jul 2012 07:58:39 GMT] [info] [<0.939.0>] View index compaction still behind
for exhaust_events _design/events -- current: 6473109 compact: 6473081
[Tue, 24 Jul 2012 07:58:39 GMT] [info] [<0.939.0>] View index compaction complete for
exhaust_events _design/events
[Tue, 24 Jul 2012 07:58:39 GMT] [error] [<0.939.0>] ** Generic server <0.939.0>
terminating 
** Last message in was {compact_done,
                        {group,
                         <<255,131,167,66,53,46,245,243,22,92,235,227,135,59,
                           95,56>>,
                         <0.24781.62>,<<"_design/events">>,<<"javascript">>,
                         [],
                         [{view,0,6473119,0,
                           [<<"list">>],
                           <<"function(doc) {\n    emit([doc.date, doc.facility], null);\n}">>,
                           {btree,<0.24781.62>,
                            {308295893,{5879466,[]},154301438},
                            #Fun<couch_btree.3.71804109>,
                            #Fun<couch_btree.4.115144917>,
                            #Fun<couch_view.less_json_ids.2>,
                            #Fun<couch_view_group.10.26766604>,snappy},
                           [],[]}],
                         {[]},
                         {btree,<0.24781.62>,
                          {308292754,[],152742682},
                          #Fun<couch_btree.3.71804109>,
                          #Fun<couch_btree.4.115144917>,
                          #Fun<couch_btree.5.93788370>,nil,snappy},
                         6473119,0,nil,nil}}
** When Server state == {group_state,undefined,<<"exhaust_events">>,
                         {"/var/lib/couchdb",<<"exhaust_events">>,
                          {group,
                           <<255,131,167,66,53,46,245,243,22,92,235,227,135,59,
                             95,56>>,
                           nil,<<"_design/events">>,<<"javascript">>,[],
                           [{view,0,0,0,
                             [<<"list">>],
                             <<"function(doc) {\n    emit([doc.date, doc.facility],
null);\n}">>,
                             nil,[],[]}],
                           {[]},
                           nil,0,0,nil,nil}},
                         {group,
                          <<255,131,167,66,53,46,245,243,22,92,235,227,135,59,
                            95,56>>,
                          <0.940.0>,<<"_design/events">>,<<"javascript">>,[],
                          [{view,0,6473109,0,
                            [<<"list">>],
                            <<"function(doc) {\n    emit([doc.date, doc.facility], null);\n}">>,
                            {btree,<0.940.0>,
                             {578555333,{5879456,[]},161851847},
                             #Fun<couch_btree.3.71804109>,
                             #Fun<couch_btree.4.115144917>,
                             #Fun<couch_view.less_json_ids.2>,
                             #Fun<couch_view_group.10.26766604>,snappy},
                            [],[]}],
                          {[]},
                          {btree,<0.940.0>,
                           {578551416,[],157784808},
                           #Fun<couch_btree.3.71804109>,
                           #Fun<couch_btree.4.115144917>,
                           #Fun<couch_btree.5.93788370>,nil,snappy},
                          6473109,0,nil,nil},
                         nil,nil,false,[],<0.942.0>,false}
** Reason for termination == 
** {badarg,[{erlang,unlink,[nil]},
            {couch_view_group,handle_call,3},
            {gen_server,handle_msg,5},
            {proc_lib,init_p_do_apply,3}]}

[Tue, 24 Jul 2012 07:58:39 GMT] [error] [<0.939.0>] {error_report,<0.32.0>,
                        {<0.939.0>,crash_report,
                         [[{initial_call,
                               {couch_view_group,init,['Argument__1']}},
                           {pid,<0.939.0>},
                           {registered_name,[]},
                           {error_info,
                               {exit,
                                   {badarg,
                                       [{erlang,unlink,[nil]},
                                        {couch_view_group,handle_call,3},
                                        {gen_server,handle_msg,5},
                                        {proc_lib,init_p_do_apply,3}]},
                                   [{gen_server,terminate,6},
                                    {proc_lib,init_p_do_apply,3}]}},
                           {ancestors,[<0.938.0>]},
                           {messages,[]},
                           {links,[<0.940.0>,<0.126.0>]},
                           {dictionary,[]},
                           {trap_exit,true},
                           {status,running},
                           {heap_size,2584},
                           {stack_size,24},
                           {reductions,324488}],
                          []]}}
[Tue, 24 Jul 2012 07:58:39 GMT] [error] [<0.566.0>] ** Generic server <0.566.0>
terminating 
** Last message in was {'EXIT',<0.24784.62>,
                        {{badarg,
                          [{erlang,unlink,[nil]},
                           {couch_view_group,handle_call,3},
                           {gen_server,handle_msg,5},
                           {proc_lib,init_p_do_apply,3}]},
                         {gen_server,call,
                          [<0.939.0>,
                           {compact_done,
                            {group,
                             <<255,131,167,66,53,46,245,243,22,92,235,227,135,
                               59,95,56>>,
                             <0.24781.62>,<<"_design/events">>,
                             <<"javascript">>,[],
                             [{view,0,6473119,0,
                               [<<"list">>],
                               <<"function(doc) {\n    emit([doc.date, doc.facility],
null);\n}">>,
                               {btree,<0.24781.62>,
                                {308295893,{5879466,[]},154301438},
                                #Fun<couch_btree.3.71804109>,
                                #Fun<couch_btree.4.115144917>,
                                #Fun<couch_view.less_json_ids.2>,
                                #Fun<couch_view_group.10.26766604>,snappy},
                               [],[]}],
                             {[]},
                             {btree,<0.24781.62>,
                              {308292754,[],152742682},
                              #Fun<couch_btree.3.71804109>,
                              #Fun<couch_btree.4.115144917>,
                              #Fun<couch_btree.5.93788370>,nil,snappy},
                             6473119,0,nil,nil}}]}}}
** When Server state == {group_state,undefined,<<"exhaust_events">>,
                         {"/var/lib/couchdb",<<"exhaust_events">>,
                          {group,
                           <<52,56,143,106,60,215,14,14,141,162,67,151,219,113,
                             2,81>>,
                           nil,<<"_design/driver">>,<<"javascript">>,[],
                           [{view,0,0,0,[],
                             <<"function(doc) {\n\tif(doc.driver){\n    \temit([doc.driver,
doc.date.slice(0, 10), doc.date.slice(11, 19)], 1);\n\t}\n}">>,
                             nil,
                             [{<<"events">>,
                               <<"function(keys, values) {\n    return sum(values);\n}">>}],
                             []}],
                           {[]},
                           nil,0,0,nil,nil}},
                         {group,
                          <<255,131,167,66,53,46,245,243,22,92,235,227,135,59,
                            95,56>>,
                          <0.940.0>,<<"_design/events">>,<<"javascript">>,[],
                          [{view,0,6473109,0,
                            [<<"list">>],
                            <<"function(doc) {\n    emit([doc.date, doc.facility], null);\n}">>,
                            {btree,<0.940.0>,
                             {578548274,{5879456,[]},161852193},
                             #Fun<couch_btree.3.71804109>,
                             #Fun<couch_btree.4.115144917>,
                             #Fun<couch_view.less_json_ids.2>,
                             #Fun<couch_view_group.10.26766604>,snappy},
                            [],[]}],
                          {[]},
                          {btree,<0.940.0>,
                           {578544609,[],157785117},
                           #Fun<couch_btree.3.71804109>,
                           #Fun<couch_btree.4.115144917>,
                           #Fun<couch_btree.5.93788370>,nil,snappy},
                          6473109,0,nil,nil},
                         nil,<0.24784.62>,false,[],<0.17570.0>,false}
** Reason for termination == 
** {{badarg,
        [{erlang,unlink,[nil]},
         {couch_view_group,handle_call,3},
         {gen_server,handle_msg,5},
         {proc_lib,init_p_do_apply,3}]},
    {gen_server,call,
        [<0.939.0>,
         {compact_done,
             {group,
                 <<255,131,167,66,53,46,245,243,22,92,235,227,135,59,95,56>>,
                 <0.24781.62>,<<"_design/events">>,<<"javascript">>,[],
                 [{view,0,6473119,0,
                      [<<"list">>],
                      <<"function(doc) {\n    emit([doc.date, doc.facility], null);\n}">>,
                      {btree,<0.24781.62>,
                          {308295893,{5879466,[]},154301438},
                          #Fun<couch_btree.3.71804109>,
                          #Fun<couch_btree.4.115144917>,
                          #Fun<couch_view.less_json_ids.2>,
                          #Fun<couch_view_group.10.26766604>,snappy},
                      [],[]}],
                 {[]},
                 {btree,<0.24781.62>,
                     {308292754,[],152742682},
                     #Fun<couch_btree.3.71804109>,
                     #Fun<couch_btree.4.115144917>,
                     #Fun<couch_btree.5.93788370>,nil,snappy},
                 6473119,0,nil,nil}}]}}

[Tue, 24 Jul 2012 07:58:39 GMT] [error] [<0.566.0>] {error_report,<0.32.0>,
                     {<0.566.0>,crash_report,
                      [[{initial_call,{couch_view_group,init,['Argument__1']}},
                        {pid,<0.566.0>},
                        {registered_name,[]},
                        {error_info,
                         {exit,
                          {{badarg,
                            [{erlang,unlink,[nil]},
                             {couch_view_group,handle_call,3},
                             {gen_server,handle_msg,5},
                             {proc_lib,init_p_do_apply,3}]},
                           {gen_server,call,
                            [<0.939.0>,
                             {compact_done,
                              {group,
                               <<255,131,167,66,53,46,245,243,22,92,235,227,
                                 135,59,95,56>>,
                               <0.24781.62>,<<"_design/events">>,
                               <<"javascript">>,[],
                               [{view,0,6473119,0,
                                 [<<"list">>],
                                 <<"function(doc) {\n    emit([doc.date, doc.facility],
null);\n}">>,
                                 {btree,<0.24781.62>,
                                  {308295893,{5879466,[]},154301438},
                                  #Fun<couch_btree.3.71804109>,
                                  #Fun<couch_btree.4.115144917>,
                                  #Fun<couch_view.less_json_ids.2>,
                                  #Fun<couch_view_group.10.26766604>,snappy},
                                 [],[]}],
                               {[]},
                               {btree,<0.24781.62>,
                                {308292754,[],152742682},
                                #Fun<couch_btree.3.71804109>,
                                #Fun<couch_btree.4.115144917>,
                                #Fun<couch_btree.5.93788370>,nil,snappy},
                               6473119,0,nil,nil}}]}},
                          [{gen_server,terminate,6},
                           {proc_lib,init_p_do_apply,3}]}},
                        {ancestors,[<0.565.0>]},
                        {messages,[]},
                        {links,[<0.126.0>]},
                        {dictionary,[]},
                        {trap_exit,true},
                        {status,running},
                        {heap_size,1597},
                        {stack_size,24},
                        {reductions,340978}],
                       []]}}
[Tue, 24 Jul 2012 07:58:39 GMT] [error] [<0.940.0>] ** Generic server <0.940.0>
terminating 
** Last message in was {'EXIT',<0.939.0>,
                           {badarg,
                               [{erlang,unlink,[nil]},
                                {couch_view_group,handle_call,3},
                                {gen_server,handle_msg,5},
                                {proc_lib,init_p_do_apply,3}]}}
** When Server state == {file,{file_descriptor,prim_file,{#Port<0.2991>,126}},
                              578560125}
** Reason for termination == 
** {badarg,[{erlang,unlink,[nil]},
            {couch_view_group,handle_call,3},
            {gen_server,handle_msg,5},
            {proc_lib,init_p_do_apply,3}]}

[Tue, 24 Jul 2012 07:58:39 GMT] [error] [<0.940.0>] {error_report,<0.32.0>,
                        {<0.940.0>,crash_report,
                         [[{initial_call,{couch_file,init,['Argument__1']}},
                           {pid,<0.940.0>},
                           {registered_name,[]},
                           {error_info,
                               {exit,
                                   {badarg,
                                       [{erlang,unlink,[nil]},
                                        {couch_view_group,handle_call,3},
                                        {gen_server,handle_msg,5},
                                        {proc_lib,init_p_do_apply,3}]},
                                   [{gen_server,terminate,6},
                                    {proc_lib,init_p_do_apply,3}]}},
                           {ancestors,[<0.939.0>,<0.938.0>]},
                           {messages,[{'EXIT',<0.942.0>,shutdown}]},
                           {links,[]},
                           {dictionary,[]},
                           {trap_exit,true},
                           {status,running},
                           {heap_size,377},
                           {stack_size,24},
                           {reductions,165720368}],
                          []]}}
[Tue, 24 Jul 2012 07:58:39 GMT] [error] [<0.24781.62>] ** Generic server <0.24781.62>
terminating 
** Last message in was {'EXIT',<0.24784.62>,
                        {{badarg,
                          [{erlang,unlink,[nil]},
                           {couch_view_group,handle_call,3},
                           {gen_server,handle_msg,5},
                           {proc_lib,init_p_do_apply,3}]},
                         {gen_server,call,
                          [<0.939.0>,
                           {compact_done,
                            {group,
                             <<255,131,167,66,53,46,245,243,22,92,235,227,135,
                               59,95,56>>,
                             <0.24781.62>,<<"_design/events">>,
                             <<"javascript">>,[],
                             [{view,0,6473119,0,
                               [<<"list">>],
                               <<"function(doc) {\n    emit([doc.date, doc.facility],
null);\n}">>,
                               {btree,<0.24781.62>,
                                {308295893,{5879466,[]},154301438},
                                #Fun<couch_btree.3.71804109>,
                                #Fun<couch_btree.4.115144917>,
                                #Fun<couch_view.less_json_ids.2>,
                                #Fun<couch_view_group.10.26766604>,snappy},
                               [],[]}],
                             {[]},
                             {btree,<0.24781.62>,
                              {308292754,[],152742682},
                              #Fun<couch_btree.3.71804109>,
                              #Fun<couch_btree.4.115144917>,
                              #Fun<couch_btree.5.93788370>,nil,snappy},
                             6473119,0,nil,nil}}]}}}
** When Server state == {file,
                            {file_descriptor,prim_file,{#Port<0.851695>,121}},
                            308297853}
** Reason for termination == 
** {{badarg,
        [{erlang,unlink,[nil]},
         {couch_view_group,handle_call,3},
         {gen_server,handle_msg,5},
         {proc_lib,init_p_do_apply,3}]},
    {gen_server,call,
        [<0.939.0>,
         {compact_done,
             {group,
                 <<255,131,167,66,53,46,245,243,22,92,235,227,135,59,95,56>>,
                 <0.24781.62>,<<"_design/events">>,<<"javascript">>,[],
                 [{view,0,6473119,0,
                      [<<"list">>],
                      <<"function(doc) {\n    emit([doc.date, doc.facility], null);\n}">>,
                      {btree,<0.24781.62>,
                          {308295893,{5879466,[]},154301438},
                          #Fun<couch_btree.3.71804109>,
                          #Fun<couch_btree.4.115144917>,
                          #Fun<couch_view.less_json_ids.2>,
                          #Fun<couch_view_group.10.26766604>,snappy},
                      [],[]}],
                 {[]},
                 {btree,<0.24781.62>,
                     {308292754,[],152742682},
                     #Fun<couch_btree.3.71804109>,
                     #Fun<couch_btree.4.115144917>,
                     #Fun<couch_btree.5.93788370>,nil,snappy},
                 6473119,0,nil,nil}}]}}

[Tue, 24 Jul 2012 07:58:39 GMT] [error] [<0.24781.62>] {error_report,<0.32.0>,
                        {<0.24781.62>,crash_report,
                         [[{initial_call,{couch_file,init,['Argument__1']}},
                           {pid,<0.24781.62>},
                           {registered_name,[]},
                           {error_info,
                            {exit,
                             {{badarg,
                               [{erlang,unlink,[nil]},
                                {couch_view_group,handle_call,3},
                                {gen_server,handle_msg,5},
                                {proc_lib,init_p_do_apply,3}]},
                              {gen_server,call,
                               [<0.939.0>,
                                {compact_done,
                                 {group,
                                  <<255,131,167,66,53,46,245,243,22,92,235,227,
                                    135,59,95,56>>,
                                  <0.24781.62>,<<"_design/events">>,
                                  <<"javascript">>,[],
                                  [{view,0,6473119,0,
                                    [<<"list">>],
                                    <<"function(doc) {\n    emit([doc.date, doc.facility],
null);\n}">>,
                                    {btree,<0.24781.62>,
                                     {308295893,{5879466,[]},154301438},
                                     #Fun<couch_btree.3.71804109>,
                                     #Fun<couch_btree.4.115144917>,
                                     #Fun<couch_view.less_json_ids.2>,
                                     #Fun<couch_view_group.10.26766604>,
                                     snappy},
                                    [],[]}],
                                  {[]},
                                  {btree,<0.24781.62>,
                                   {308292754,[],152742682},
                                   #Fun<couch_btree.3.71804109>,
                                   #Fun<couch_btree.4.115144917>,
                                   #Fun<couch_btree.5.93788370>,nil,snappy},
                                  6473119,0,nil,nil}}]}},
                             [{gen_server,terminate,6},
                              {proc_lib,init_p_do_apply,3}]}},
                           {ancestors,[<0.566.0>,<0.565.0>]},
                           {messages,[]},
                           {links,[]},
                           {dictionary,[]},
                           {trap_exit,true},
                           {status,running},
                           {heap_size,1597},
                           {stack_size,24},
                           {reductions,120074193}],
                          []]}}



And, one more surprise: original view is accessible:

[Tue, 24 Jul 2012 07:59:31 GMT] [info] [<0.23744.62>] 10.0.0.41 - - GET /exhaust_events/_design/driver/_view/events?limit=11&reduce=false
200


So, as I think, couchdb view indexer mixed some view data inside.


More info:

I have 3 nodes with identical databases.
But problem occured only on one node.

Problem node running couchdb 1.2.0 and erlang 13.2.4
Working fine nodes running couchdb 1.2.0 and erlang 14.2.1

I'm going to upgrade erlang on problem node today and report, if problem gone away.
                
> missing_named_view error on existing javascript design doc and view
> -------------------------------------------------------------------
>
>                 Key: COUCHDB-1444
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1444
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>    Affects Versions: 1.1.1
>         Environment: Ubuntu 11.01 64 bit Erlang R13B03
>            Reporter: Sam Lown
>            Priority: Critical
>              Labels: 404, bug, missing_named_view
>         Attachments: couchdb-missing-view.log
>
>
> Moved over from issue: https://issues.apache.org/jira/browse/COUCHDB-1225 which has similar
symptoms but the view is written in Erlang.
> On our production server for no apparent reason, one of our views just suddenly stopped
responding to requests. The design document was still visible in Futon and the "all" view
did provide a list of documents. All other views in the ddoc responded with a 404 {"error":"not_found","reason":"missing_named_view"}.
> Restarting the couchdb server resolved the issue, and I've as yet been unable to reproduce
the problem.
> Here is the last successful log entry for the view:
>     [Fri, 16 Mar 2012 13:14:19 GMT] [info] [<0.831.531>] 192.168.163.3 - - 'GET'
/maxi/_design/Payment/_view/by_journey_id_and_sequence?startkey=%5B%229bd1647eb09fca1634a8a6129a8cff46%22%2C%7B%7D%5D&endkey=%5B%229bd1647eb09fca1634a8a6129a8cff46%22%5D&limit=1&descending=true&include_docs=true&reduce=false
200 
> Many requests later to other documents and views, here is when requests stopped working,
some 6 minutes later: 
>     [Fri, 16 Mar 2012 13:20:29 GMT] [info] [<0.4510.531>] 192.168.163.3 - - 'GET'
/maxi/_design/Payment/_view/by_user_id_and_created_at?startkey=%5B%22a0d0912e031b8fd28c2f89f828eebb12%22%5D&endkey=%5B%22a0d0912e031b8fd28c2f89f828eebb12%22%2C%7B%7D%5D&reduce=true&skip=0&limit=1
404 
> Here is the design document in question: https://gist.github.com/2050446 
> I could see nothing in the logs out of the ordinary.
> Obviously, this problem is very alarming indeed and not something I've come across before
in CouchDB. As you can see the view in question is related to Payments, which is something
we really do not want to go wrong. 
> Please let me know if I can provide more information.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message