You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Gerald Richter - ECOS <ri...@ecos.de> on 2013/03/22 06:16:55 UTC

view_indexer fails / cryptic error messages

Hi,

 
I am using couchdb for over two years now and I really love it, but I hate it’s error messages. If there is one thing I would wish that should be in the next release, than it would be: human readable error messages. I know that writing good error messages is nothing that programmer likes to do. We like more to implement great new features, but for the daily work having a good diagnostic message is of so much value and saves so much time…

 
So in addition to the many hour I spend in the past, trying to decrypt an error message of couchdb, here is one that really gives me no clue what it is about and I am giving up. Neither starting couchdb with debug output, nor looking at the output of my viewserver, shows anything irregular. Basically a view index is rebuild and it crashes somewhere in the middle of the process with the error message below.  I hope somebody on the list, could shed some light what’s going on here.

 
Any help would be greatly appreciated

 
Thanks & Regards

 
Gerald

 
=ERROR REPORT==== 22-Mar-2013::06:10:53 ===

Error in process <0.890.0> with exit value: {function_clause,[{couch_view_updater,'-view_insert_doc_query_results/5-fun-0-',[{},{[],[]},<<0 bytes>>,{view,0,229488,0,[<<5 bytes>>],<<53 bytes>>,{btree,<0.881.0>,{31298052,{7667,[]},9402798},#Fun<couch_btree.3.71804109>,#Fun<couch_btree.4.115144917>,#Fun<couch_view.less_json_ids.2>,#Fun<couch_view_group.10.75611305>,snappy},[],[]}]},{lists,foldl,3},{couch_view_updater,view_insert_doc_query_results,5},{couch_view_updater... 

 
[error] [<0.880.0>] ** Generic server <0.880.0> terminating 

** Last message in was {'EXIT',<0.884.0>,

                        {function_clause,

                         [{couch_view_updater,

                           '-view_insert_doc_query_results/5-fun-0-',

                           [{},

                            {[],[]},

                            <<>>,

                            {view,0,229488,0,

                             [<<"index">>],

                             <<"\\&CouchDB::AppServ::Docclass::map_doctype #version=19">>,

                             {btree,<0.881.0>,

                              {31298052,{7667,[]},9402798},

                              #Fun<couch_btree.3.71804109>,

                              #Fun<couch_btree.4.115144917>,

                              #Fun<couch_view.less_json_ids.2>,

                              #Fun<couch_view_group.10.75611305>,snappy},

                             [],[]}]},

                          {lists,foldl,3},

                          {couch_view_updater,view_insert_doc_query_results,5},

                          {couch_view_updater,'-do_writes/6-fun-0-',2},

                          {couch_view_updater,do_writes,6}]}}

** When Server state == {group_state,undefined,<<"ebosdb">>,

                         {"/var/lib/couchdb",<<"ebosdb">>,

                          {group,

                           <<90,90,237,193,108,102,135,29,30,98,254,76,111,169,

                             215,129>>,

                           nil,<<"_design/Docclass">>,<<"perl">>,[],

                           [{view,0,0,0,

                             [<<"index">>],

                             <<"\\&CouchDB::AppServ::Docclass::map_doctype #version=19">>,

                             nil,[],[]}],

                           {[]},

                           nil,0,0,nil,nil}},

                         {group,

                          <<90,90,237,193,108,102,135,29,30,98,254,76,111,169,

                            215,129>>,

                          <0.881.0>,<<"_design/Docclass">>,<<"perl">>,[],

                          [{view,0,229488,0,

                            [<<"index">>],

                            <<"\\&CouchDB::AppServ::Docclass::map_doctype #version=19">>,

                            {btree,<0.881.0>,

                             {31298052,{7667,[]},9402798},

                             #Fun<couch_btree.3.71804109>,

                             #Fun<couch_btree.4.115144917>,

                             #Fun<couch_view.less_json_ids.2>,

                             #Fun<couch_view_group.10.75611305>,snappy},

                            [],[]}],

                          {[]},

                          {btree,<0.881.0>,

                           {31168185,[],503419},

                           #Fun<couch_btree.3.71804109>,

                           #Fun<couch_btree.4.115144917>,

                           #Fun<couch_btree.5.93788370>,nil,snappy},

                          230018,0,nil,nil},

                         <0.884.0>,nil,true,

                         [{{<0.831.0>,#Ref<0.0.0.16930>},637633}],

                         <0.883.0>,false}

** Reason for termination == 

** {function_clause,

       [{couch_view_updater,'-view_insert_doc_query_results/5-fun-0-',

            [{},

             {[],[]},

             <<>>,

             {view,0,229488,0,

                 [<<"index">>],

                 <<"\\&CouchDB::AppServ::Docclass::map_doctype #version=19">>,

                 {btree,<0.881.0>,

                     {31298052,{7667,[]},9402798},

                     #Fun<couch_btree.3.71804109>,

                     #Fun<couch_btree.4.115144917>,

                     #Fun<couch_view.less_json_ids.2>,

                     #Fun<couch_view_group.10.75611305>,snappy},

                 [],[]}]},

        {lists,foldl,3},

        {couch_view_updater,view_insert_doc_query_results,5},

        {couch_view_updater,'-do_writes/6-fun-0-',2},

        {couch_view_updater,do_writes,6}]}

 
 
 

Re: view_indexer fails / cryptic error messages

Posted by Robert Newson <rn...@apache.org>.
[<<"index">>],<<"\\&CouchDB::AppServ::
Docclass::map_doctype #version=19">>,

doesn't look quite right to me. Could you friendpaste/gist your design document?

FYI: If you try uploading your design document to Cloudant you'll get
an error message if it's malformed or the map/reduce code does not
compile. I think we're porting that work as part of the merge, or
shortly after.

B.

On 22 March 2013 08:38, Dave Cottlehuber <dc...@jsonified.com> wrote:
> On 22 March 2013 09:20, Dave Cottlehuber <dc...@jsonified.com> wrote:
>> On 22 March 2013 06:16, Gerald Richter - ECOS <ri...@ecos.de> wrote:
>>> Hi,
>>>
>>>
>>> I am using couchdb for over two years now and I really love it, but I hate it’s error messages. If there is one thing I would wish that should be in the next release, than it would be: human readable error messages. I know that writing good error messages is nothing that programmer likes to do. We like more to implement great new features, but for the daily work having a good diagnostic message is of so much value and saves so much time…
>>
>> Good call, maybe you want to open a JIRA for this and we can discuss
>> what needs to change?
>>
>>> So in addition to the many hour I spend in the past, trying to decrypt an error message of couchdb, here is one that really gives me no clue what it is about and I am giving up. Neither starting couchdb with debug output, nor looking at the output of my viewserver, shows anything irregular. Basically a view index is rebuild and it crashes somewhere in the middle of the process with the error message below.  I hope somebody on the list, could shed some light what’s going on here.
>>
>> If you can run the view build with log level = debug  and send a link
>> to the results we might see something more interesting.
>>
>> Don't forget what version of erlang, and couch you are running.
>>
>> I'm pretty sure one of these fields in that log excerpt will tell you
>> the last doc processed but I don't see it right now myself.
>>
>> If your view is small, you might consider sprinkling in some log
>> messages http://wiki.apache.org/couchdb/HTTP_view_API#Debugging_Views
>> bearing in mind there's a *significant* performance impact for doing
>> this.
>>
>> If your view is failing at the same place each time, you'll see this
>> when you delete the view, re-run the build, query _info (see below)
>> and then re-run the build and re-query _info again.
>>
>> http://wiki.apache.org/couchdb/HTTP_view_API?action=show&redirect=HttpViewApi#Getting_Information_about_Design_Documents_.28and_their_Views.29
>
> I forgot the most important bit (aaugh), in that view _info output is
> the update_seq  which should match the db's info at
> $COUCH:5984/dbname/  if it completed all docs. If it didn't you should
> be able to GET $COUCH:5984/dbname/_changes?since=<update_seq> and one
> of the docs around there  should be the culprit. You can use
> limit=5&descending=true as well to get a list of the preceding docs,
> and just limit=5 to get subsequent doc ids. I'm not 100% sure that
> this all will work, maybe one of the other devs can confirm, as there
> are a few circumstances[1] where the update_seq might not match
> between view & db, but it should be reasonably close.
>
> http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options
>
> [1] https://issues.apache.org/jira/browse/COUCHDB-1367
>
> A+
> Dave

Re: view_indexer fails / cryptic error messages

Posted by Dave Cottlehuber <dc...@jsonified.com>.
On 22 March 2013 09:20, Dave Cottlehuber <dc...@jsonified.com> wrote:
> On 22 March 2013 06:16, Gerald Richter - ECOS <ri...@ecos.de> wrote:
>> Hi,
>>
>>
>> I am using couchdb for over two years now and I really love it, but I hate it’s error messages. If there is one thing I would wish that should be in the next release, than it would be: human readable error messages. I know that writing good error messages is nothing that programmer likes to do. We like more to implement great new features, but for the daily work having a good diagnostic message is of so much value and saves so much time…
>
> Good call, maybe you want to open a JIRA for this and we can discuss
> what needs to change?
>
>> So in addition to the many hour I spend in the past, trying to decrypt an error message of couchdb, here is one that really gives me no clue what it is about and I am giving up. Neither starting couchdb with debug output, nor looking at the output of my viewserver, shows anything irregular. Basically a view index is rebuild and it crashes somewhere in the middle of the process with the error message below.  I hope somebody on the list, could shed some light what’s going on here.
>
> If you can run the view build with log level = debug  and send a link
> to the results we might see something more interesting.
>
> Don't forget what version of erlang, and couch you are running.
>
> I'm pretty sure one of these fields in that log excerpt will tell you
> the last doc processed but I don't see it right now myself.
>
> If your view is small, you might consider sprinkling in some log
> messages http://wiki.apache.org/couchdb/HTTP_view_API#Debugging_Views
> bearing in mind there's a *significant* performance impact for doing
> this.
>
> If your view is failing at the same place each time, you'll see this
> when you delete the view, re-run the build, query _info (see below)
> and then re-run the build and re-query _info again.
>
> http://wiki.apache.org/couchdb/HTTP_view_API?action=show&redirect=HttpViewApi#Getting_Information_about_Design_Documents_.28and_their_Views.29

I forgot the most important bit (aaugh), in that view _info output is
the update_seq  which should match the db's info at
$COUCH:5984/dbname/  if it completed all docs. If it didn't you should
be able to GET $COUCH:5984/dbname/_changes?since=<update_seq> and one
of the docs around there  should be the culprit. You can use
limit=5&descending=true as well to get a list of the preceding docs,
and just limit=5 to get subsequent doc ids. I'm not 100% sure that
this all will work, maybe one of the other devs can confirm, as there
are a few circumstances[1] where the update_seq might not match
between view & db, but it should be reasonably close.

http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options

[1] https://issues.apache.org/jira/browse/COUCHDB-1367

A+
Dave

Re: view_indexer fails / cryptic error messages

Posted by Dave Cottlehuber <dc...@jsonified.com>.
On 22 March 2013 06:16, Gerald Richter - ECOS <ri...@ecos.de> wrote:
> Hi,
>
>
> I am using couchdb for over two years now and I really love it, but I hate it’s error messages. If there is one thing I would wish that should be in the next release, than it would be: human readable error messages. I know that writing good error messages is nothing that programmer likes to do. We like more to implement great new features, but for the daily work having a good diagnostic message is of so much value and saves so much time…

Good call, maybe you want to open a JIRA for this and we can discuss
what needs to change?

> So in addition to the many hour I spend in the past, trying to decrypt an error message of couchdb, here is one that really gives me no clue what it is about and I am giving up. Neither starting couchdb with debug output, nor looking at the output of my viewserver, shows anything irregular. Basically a view index is rebuild and it crashes somewhere in the middle of the process with the error message below.  I hope somebody on the list, could shed some light what’s going on here.

If you can run the view build with log level = debug  and send a link
to the results we might see something more interesting.

Don't forget what version of erlang, and couch you are running.

I'm pretty sure one of these fields in that log excerpt will tell you
the last doc processed but I don't see it right now myself.

If your view is small, you might consider sprinkling in some log
messages http://wiki.apache.org/couchdb/HTTP_view_API#Debugging_Views
bearing in mind there's a *significant* performance impact for doing
this.

If your view is failing at the same place each time, you'll see this
when you delete the view, re-run the build, query _info (see below)
and then re-run the build and re-query _info again.

http://wiki.apache.org/couchdb/HTTP_view_API?action=show&redirect=HttpViewApi#Getting_Information_about_Design_Documents_.28and_their_Views.29

If that *is* the case you can run a few of those docs manually through
the view engine, e.g. for JS like this
http://wiki.apache.org/couchdb/Troubleshooting#Map.2BAC8-Reduce_debugging

A+
Dave

AW: view_indexer fails / cryptic error messages

Posted by Gerald Richter - ECOS <ri...@ecos.de>.
Hi,

it seems like it was a corrupted database, also accessing that database was no problem.

I wrote a script that has dumped all document as json to a text file, recreated the database and loaded the documents again. After that the building of the view indexes worked without problem.

Gerald

> -----Ursprüngliche Nachricht-----
> Von: Gerald Richter - ECOS
> Gesendet: Freitag, 22. März 2013 16:02
> An: user@couchdb.apache.org
> Betreff: AW: view_indexer fails / cryptic error messages
> 
> Hi Dave,
> 
> thanks for the detailed answer.
> 
> The database contains about 40000 document and it's failing after a few
> hundred documents. It's not always failing at the same document.
> 
> The output of all the documents that have been index so far is empty (i.e.
> [[]] ), because they should not be included in the view. There are more views
> and some of them are already completely indexed.
> 
> As I wrote in my other mail I am using my own viewserver written in Perl. It
> has a lot of debugging features and I am pretty sure it returns the correct
> result. Also the couchdb log shows that the output of a document indexed so
> far is [[]] .
> 
> I am using couchdb 1.2.1 and Erlang 13.2.4
> 
>  Thanks & Regards
> 
> Gerald
> 
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Dave Cottlehuber [mailto:dch@jsonified.com]
> > Gesendet: Freitag, 22. März 2013 09:38
> > An: user@couchdb.apache.org
> > Betreff: Re: view_indexer fails / cryptic error messages
> >
> > On 22 March 2013 09:20, Dave Cottlehuber <dc...@jsonified.com> wrote:
> > > On 22 March 2013 06:16, Gerald Richter - ECOS <ri...@ecos.de> wrote:
> > >> Hi,
> > >>
> > >>
> > >> I am using couchdb for over two years now and I really love it, but
> > >> I hate it's error messages. If there is one thing I would wish that
> > >> should be in the next release, than it would be: human readable
> > >> error messages. I know that writing good error messages is nothing
> > >> that programmer likes to do. We like more to implement great new
> > >> features, but for the daily work having a good diagnostic message
> > >> is of so much value and saves so much time...
> > >
> > > Good call, maybe you want to open a JIRA for this and we can discuss
> > > what needs to change?
> > >
> > >> So in addition to the many hour I spend in the past, trying to
> > >> decrypt an
> > error message of couchdb, here is one that really gives me no clue
> > what it is about and I am giving up. Neither starting couchdb with
> > debug output, nor looking at the output of my viewserver, shows
> > anything irregular. Basically a view index is rebuild and it crashes
> > somewhere in the middle of the process with the error message below.
> > I hope somebody on the list, could shed some light what's going on here.
> > >
> > > If you can run the view build with log level = debug  and send a
> > > link to the results we might see something more interesting.
> > >
> > > Don't forget what version of erlang, and couch you are running.
> > >
> > > I'm pretty sure one of these fields in that log excerpt will tell
> > > you the last doc processed but I don't see it right now myself.
> > >
> > > If your view is small, you might consider sprinkling in some log
> > > messages
> > http://wiki.apache.org/couchdb/HTTP_view_API#Debugging_Views
> > > bearing in mind there's a *significant* performance impact for doing
> > > this.
> > >
> > > If your view is failing at the same place each time, you'll see this
> > > when you delete the view, re-run the build, query _info (see below)
> > > and then re-run the build and re-query _info again.
> > >
> > >
> >
> http://wiki.apache.org/couchdb/HTTP_view_API?action=show&redirect=Htt
> > p
> > >
> >
> ViewApi#Getting_Information_about_Design_Documents_.28and_their_Vi
> > ews.
> > > 29
> >
> > I forgot the most important bit (aaugh), in that view _info output is
> > the update_seq  which should match the db's info at
> > $COUCH:5984/dbname/  if it completed all docs. If it didn't you should
> > be able to GET $COUCH:5984/dbname/_changes?since=<update_seq> and
> one
> > of the docs around there  should be the culprit. You can use
> > limit=5&descending=true as well to get a list of the preceding docs,
> > and just limit=5 to get subsequent doc ids. I'm not 100% sure that
> > this all will work, maybe one of the other devs can confirm, as there
> > are a few circumstances[1] where the update_seq might not match
> between view & db, but it should be reasonably close.
> >
> > http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options
> >
> > [1] https://issues.apache.org/jira/browse/COUCHDB-1367
> >
> > A+
> > Dave



AW: view_indexer fails / cryptic error messages

Posted by Gerald Richter - ECOS <ri...@ecos.de>.
Hi Dave,

thanks for the detailed answer.

The database contains about 40000 document and it's failing after a few hundred documents. It's not always failing at the same document.

The output of all the documents that have been index so far is empty (i.e. [[]] ), because they should not be included in the view. There are more views and some of them are already completely indexed.

As I wrote in my other mail I am using my own viewserver written in Perl. It has a lot of debugging features and I am pretty sure it returns the correct result. Also the couchdb log shows that the output of a document indexed so far is [[]] .

I am using couchdb 1.2.1 and Erlang 13.2.4

 Thanks & Regards

Gerald


> -----Ursprüngliche Nachricht-----
> Von: Dave Cottlehuber [mailto:dch@jsonified.com]
> Gesendet: Freitag, 22. März 2013 09:38
> An: user@couchdb.apache.org
> Betreff: Re: view_indexer fails / cryptic error messages
> 
> On 22 March 2013 09:20, Dave Cottlehuber <dc...@jsonified.com> wrote:
> > On 22 March 2013 06:16, Gerald Richter - ECOS <ri...@ecos.de> wrote:
> >> Hi,
> >>
> >>
> >> I am using couchdb for over two years now and I really love it, but I
> >> hate it's error messages. If there is one thing I would wish that
> >> should be in the next release, than it would be: human readable error
> >> messages. I know that writing good error messages is nothing that
> >> programmer likes to do. We like more to implement great new features,
> >> but for the daily work having a good diagnostic message is of so much
> >> value and saves so much time...
> >
> > Good call, maybe you want to open a JIRA for this and we can discuss
> > what needs to change?
> >
> >> So in addition to the many hour I spend in the past, trying to decrypt an
> error message of couchdb, here is one that really gives me no clue what it is
> about and I am giving up. Neither starting couchdb with debug output, nor
> looking at the output of my viewserver, shows anything irregular. Basically a
> view index is rebuild and it crashes somewhere in the middle of the process
> with the error message below.  I hope somebody on the list, could shed
> some light what's going on here.
> >
> > If you can run the view build with log level = debug  and send a link
> > to the results we might see something more interesting.
> >
> > Don't forget what version of erlang, and couch you are running.
> >
> > I'm pretty sure one of these fields in that log excerpt will tell you
> > the last doc processed but I don't see it right now myself.
> >
> > If your view is small, you might consider sprinkling in some log
> > messages
> http://wiki.apache.org/couchdb/HTTP_view_API#Debugging_Views
> > bearing in mind there's a *significant* performance impact for doing
> > this.
> >
> > If your view is failing at the same place each time, you'll see this
> > when you delete the view, re-run the build, query _info (see below)
> > and then re-run the build and re-query _info again.
> >
> >
> http://wiki.apache.org/couchdb/HTTP_view_API?action=show&redirect=Htt
> p
> >
> ViewApi#Getting_Information_about_Design_Documents_.28and_their_Vi
> ews.
> > 29
> 
> I forgot the most important bit (aaugh), in that view _info output is the
> update_seq  which should match the db's info at $COUCH:5984/dbname/  if it
> completed all docs. If it didn't you should be able to GET
> $COUCH:5984/dbname/_changes?since=<update_seq> and one of the docs
> around there  should be the culprit. You can use limit=5&descending=true as
> well to get a list of the preceding docs, and just limit=5 to get subsequent doc
> ids. I'm not 100% sure that this all will work, maybe one of the other devs can
> confirm, as there are a few circumstances[1] where the update_seq might
> not match between view & db, but it should be reasonably close.
> 
> http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options
> 
> [1] https://issues.apache.org/jira/browse/COUCHDB-1367
> 
> A+
> Dave


Re: AW: AW: view_indexer fails / cryptic error messages

Posted by Amine BENHAMZA <am...@gmail.com>.
Le 22 mars 2013 16:51, "Gerald Richter - ECOS" <ri...@ecos.de> a écrit :

> >
> > Just a thought here. Can you check if you have any IO issues or are out
> of
> > drive space on the machine throwing the errors?
> >
>
> Already check it, there is plenty of free diskspace, no IO issues and also
> enough free memory and the machine is 100% idle, when couchdb doesn't runs
>
> Gerald
>
>
> > Wendall
> >
> > On 03/22/2013 07:52 AM, Gerald Richter - ECOS wrote:
> > >> [<<"index">>],<<"\\&CouchDB::AppServ::
> > >> Docclass::map_doctype #version=19">>,
> > >>
> > >> doesn't look quite right to me. Could you friendpaste/gist your
> > >> design document?
> > >>
> > > I am using my own Viewserver written in Perl and this is valid Perl
> code. It
> > works for over two years without problem.
> > >
> > > Thanks & Regards
> > >
> > > Gerald
> > >
>
>
>

AW: AW: view_indexer fails / cryptic error messages

Posted by Gerald Richter - ECOS <ri...@ecos.de>.
> 
> Just a thought here. Can you check if you have any IO issues or are out of
> drive space on the machine throwing the errors?
> 

Already check it, there is plenty of free diskspace, no IO issues and also enough free memory and the machine is 100% idle, when couchdb doesn't runs

Gerald


> Wendall
> 
> On 03/22/2013 07:52 AM, Gerald Richter - ECOS wrote:
> >> [<<"index">>],<<"\\&CouchDB::AppServ::
> >> Docclass::map_doctype #version=19">>,
> >>
> >> doesn't look quite right to me. Could you friendpaste/gist your
> >> design document?
> >>
> > I am using my own Viewserver written in Perl and this is valid Perl code. It
> works for over two years without problem.
> >
> > Thanks & Regards
> >
> > Gerald
> >



Re: AW: view_indexer fails / cryptic error messages

Posted by Wendall Cada <we...@apache.org>.
Just a thought here. Can you check if you have any IO issues or are out 
of drive space on the machine throwing the errors?

Wendall

On 03/22/2013 07:52 AM, Gerald Richter - ECOS wrote:
>> [<<"index">>],<<"\\&CouchDB::AppServ::
>> Docclass::map_doctype #version=19">>,
>>
>> doesn't look quite right to me. Could you friendpaste/gist your design
>> document?
>>
> I am using my own Viewserver written in Perl and this is valid Perl code. It works for over two years without problem.
>
> Thanks & Regards
>
> Gerald
>


AW: view_indexer fails / cryptic error messages

Posted by Gerald Richter - ECOS <ri...@ecos.de>.
> 
> [<<"index">>],<<"\\&CouchDB::AppServ::
> Docclass::map_doctype #version=19">>,
> 
> doesn't look quite right to me. Could you friendpaste/gist your design
> document?
> 

I am using my own Viewserver written in Perl and this is valid Perl code. It works for over two years without problem. 

Thanks & Regards

Gerald