incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Damien Katz <damienk...@gmail.com>
Subject Re: Cryptic view errors popping up
Date Wed, 09 Apr 2008 01:12:57 GMT
Guby, Thank you for posting this.  From the stack trace you posted  
I've found the problem, the fix is now checked into the trunk.

The database should be fine and after upgrading everything *should*  
work. If you don't want to upgrade to the trunk (it's more unstable),  
we can create a 0.7.3.

In the meantime you can manually apply this patch:

Index: couch_btree.erl
===================================================================
--- couch_btree.erl	(revision 646162)
+++ couch_btree.erl	(working copy)
@@ -289,17 +289,20 @@
      ],
      {ok, ResultList, Bt}.

+
  modify_kpnode(Bt, KPs, [], ResultNode, QueryOutput) ->
      % processed all queries for the current tree
      {ok, lists:reverse(ResultNode, KPs), QueryOutput, Bt};

+modify_kpnode(Bt, [], Actions, [], QueryOutput) ->
+    modify_node(Bt, nil, Actions, QueryOutput);
+
  modify_kpnode(Bt, [], Actions, [{_Key, PointerInfo} | ResultNode],  
QueryOutput) ->
      {ok, ChildKPs, QueryOutput2, Bt2} = modify_node(Bt, PointerInfo,  
Actions, QueryOutput),
      {ok, lists:reverse(ResultNode, ChildKPs), QueryOutput2, Bt2};

  modify_kpnode(Bt, [{Key,PointerInfo} | RestKPs], Actions,  
ResultNode, QueryOutput) ->
-    % Split the actions into two lists, queries of values less
-    % than equals, and greater than the current key
+    % Split the actions into two lists, queries of values <= and >  
than the current key
      SplitFun = fun({_ActionType, ActionKey, _ActionValue}) ->
              not less(Bt, Key, ActionKey)
          end,



On Apr 8, 2008, at 6:07 PM, Guby wrote:
> Some additional info if that might help you:
>
> The three views that are causing me trouble today look like this. It  
> has worked perfectly
>
> function(doc) {
> 	if (doc.class ==  "Feed"){
> 		map(doc.attributes.feed_id, doc);
> 	}
> }
>
> function(doc) {
> 	if (doc.class == "Feed" && doc.attributes.being_checked == false) {
> 		map(doc.attributes.next_check, doc);
> 	}
> }
>
> function(doc) {
> 	if (doc.class == "Feed" && doc.attributes.being_checked == true) {
> 		map(doc.attributes.next_check, doc);
> 	}
> }
>
> A typical document with class == "Feed" would look like this:
>
> {
> 	"_id":"57FE8B5DDF5FA55537D76EEB7C4F7C62",
> 	"_rev":"346516073",
> 	"class":"Feed",
> 	"attributes":
> 	{
> 		"title":"The Unofficial Apple Weblog (TUAW)",
> 		"feed_url":"http:\/\/www.tuaw.com\/rss.xml",
> 		"url":"http:\/\/www.tuaw.com",
> 		"feed_id":"http:\/\/www.tuaw.com\/rss.xml",
> 		"description":"The Unofficial Apple Weblog (TUAW)",
> 		"last_updated":null,
> 		"copyright":"Copyright 2008 Weblogs, Inc. The contents of this  
> feed are available for non-commercial use only.",
> 		"being_checked":false,
> 		"generator":"Blogsmith http:\/\/www.blogsmith.com\/",
> 		"image":"http:\/\/www.tuaw.com\/media\/feedlogo.gif",
> 		"next_check":1207692728,
> 		"was_scheduled_for_check":1207691521
> 	}
> }
>
>
> Best regards
> Sebastian
>
>
>
> On Apr 8, 2008, at 6:59 PM, Guby wrote:
>
>> I am running CouchDB 0.7.2
>> I love CouchDB when it is working! And it is really powerful all  
>> the stuff one can do with the views, but:
>> Every so often, more often lately, views that have worked perfectly  
>> start returning errors... and really cryptic errors too!
>> If I remove the view and add it again it might work for a little  
>> while, and then the error comes back again.
>> I can't really make anything out of this error message, but if any  
>> of you do, please let me know if you understand what might be wrong!
>>
>> Best regards
>> Sebastian
>>
>>
>> [error] [emulator] Error in process <0.10595.0> with exit value:  
>> {function_clause,[{couch_btree,modify_kpnode,[{btree,<0.8093.0>, 
>> {6790526,7},#Fun<couch_view_group.11.87050650>},[],[{insert, 
>> {1207692728,"57FE8B5DDF5FA55537D76EEB7C4F7C62"},{obj, 
>> [{"_id","57FE8B5DDF5FA55537D76EEB7C4F7C62"},{"_rev","346516073"}, 
>> {"class","Feed"},{"attributes",{obj,[{"title"...
>>
>>
>>
>> =ERROR REPORT==== 8-Apr-2008::18:53:44 ===
>> Error in process <0.10595.0> with exit value: {function_clause, 
>> [{couch_btree,modify_kpnode,[{btree,<0.8093.0>, 
>> {6790526,7},#Fun<couch_view_group.11.87050650>},[],[{insert, 
>> {1207692728,"57FE8B5DDF5FA55537D76EEB7C4F7C62"},{obj, 
>> [{"_id","57FE8B5DDF5FA55537D76EEB7C4F7C62"},{"_rev","346516073"}, 
>> {"class","Feed"},{"attributes",{obj,[{"title"...
>>
>> [info] [<0.10594.0>] HTTP Error (code 500): {obj, 
>> [{error,"function_clause"},
>>                            {reason,"[{couch_btree,modify_kpnode, 
>> \n              [{btree,<0.8093.0>,\n                       
>> {6790526,7},\n                      #Fun<couch_view_group. 
>> 11.87050650>},\n               [],\n               [{insert, 
>> {1207692728,\"57FE8B5DDF5FA55537D76EEB7C4F7C62\"}, 
>> \n                        {obj,[{\"_id\", 
>> \"57FE8B5DDF5FA55537D76EEB7C4F7C62\"}, 
>> \n                              {\"_rev\",\"346516073\"}, 
>> \n                              {\"class\",\"Feed\"}, 
>> \n                              {\"attributes\", 
>> \n                               {obj,[{\"title\", 
>> \n                                      \"The Unofficial Apple  
>> Weblog (TUAW)\"},\n                                     {\"feed_url 
>> \",\n                                      \"http://www.tuaw.com/rss.xml 
>> \"},\n                                     {\"url\",\"http://www.tuaw.com 
>> \"},\n                                     {\"feed_id\",\"http://www.tuaw.com/rss.xml

>> \"},\n                                     {\"description\", 
>> \n                                      \"The Unofficial Apple  
>> Weblog (TUAW)\"},\n                                      
>> {\"last_updated\",null},\n                                      
>> {\"copyright\",\n                                      \"Copyright  
>> 2008 Weblogs, Inc. The contents of this feed are available for non- 
>> commercial use only.\"},\n                                      
>> {\"being_checked\",false},\n                                      
>> {\"generator\",\n                                      \"Blogsmith http://www.blogsmith.com/

>> \"},\n                                     {\"image\", 
>> \n                                      \"http://www.tuaw.com/media/feedlogo.gif

>> \"},\n                                     {\"next_check\", 
>> 1207692728},\n                                      
>> {\"was_scheduled_for_check\", 
>> \n                                      1207691521}]}}]}}, 
>> \n                {insert, 
>> {1207692749,\"595F9051C34C7A0C2C383620E724813C\"}, 
>> \n                        {obj,[{\"_id\", 
>> \"595F9051C34C7A0C2C383620E724813C\"}, 
>> \n                              {\"_rev\",\"964772635\"}, 
>> \n                              {\"class\",\"Feed\"}, 
>> \n                              {\"attributes\", 
>> \n                               {obj,[{\"title\",\"Dagbladet.no -  
>> kultur\"},\n                                     {\"feed_url\", 
>> \n                                      \"http://www.dagbladet.no/rss/kultur/ 
>> \"},\n                                     {\"url\", 
>> \n                                      \"http://www.dagbladet.no/kultur// 
>> \"},\n                                     {\"feed_id\", 
>> \n                                      \"http://www.dagbladet.no/rss/kultur/ 
>> \"},\n                                     {\"description\", 
>> \n                                      \"Dagbladet.no - kultur -  
>> export\"},\n                                     {\"last_updated 
>> \",null},\n                                     {\"copyright 
>> \",null},\n                                     {\"being_checked 
>> \",false},\n                                     {\"generator 
>> \",null},\n                                     {\"image\", 
>> \n                                      \"http://www.dagbladet.no/gfx/dagbladet.no.gif

>> \"},\n                                     {\"next_check\", 
>> 1207692749},\n                                      
>> {\"was_scheduled_for_check\", 
>> \n                                      1207691521}]}}]}}, 
>> \n                {insert, 
>> {1207692750,\"F61BD4576778E9A2F7F6B95DD357FA66\"}, 
>> \n                        {obj,[{\"_id\", 
>> \"F61BD4576778E9A2F7F6B95DD357FA66\"}, 
>> \n                              {\"_rev\",\"2170658173\"}, 
>> \n                              {\"class\",\"Feed\"}, 
>> \n                              {\"attributes\", 
>> \n                               {obj,[{\"title\",\"Dagbladet.no -  
>> sport\"},\n                                     {\"feed_url\", 
>> \n                                      \"http://www.dagbladet.no/rss/sport/ 
>> \"},\n                                     {\"url\",\"http://www.dagbladet.no/sport//

>> \"},\n                                     {\"feed_id\", 
>> \n                                      \"http://www.dagbladet.no/rss/sport/ 
>> \"},\n                                     {\"description\", 
>> \n                                      \"Dagbladet.no - sport -  
>> export\"},\n                                     {\"last_updated 
>> \",null},\n                                     {\"copyright 
>> \",null},\n                                     {\"being_checked 
>> \",false},\n                                     {\"generator 
>> \",null},\n                                     {\"image\", 
>> \n                                      \"http://www.dagbladet.no/gfx/dagbladet.no.gif

>> \"},\n                                     {\"next_check\", 
>> 1207692750},\n                                      
>> {\"was_scheduled_for_check\", 
>> \n                                      1207691521}]}}]}}, 
>> \n                {insert, 
>> {1207692751,\"8D1F264FB7F72492E0EFAFAA3FD9BBE5\"}, 
>> \n                        {obj,[{\"_id\", 
>> \"8D1F264FB7F72492E0EFAFAA3FD9BBE5\"}, 
>> \n                              {\"_rev\",\"1822787569\"}, 
>> \n                              {\"class\",\"Feed\"}, 
>> \n                              {\"attributes\", 
>> \n                               {obj,[{\"title\",\"Dagbladet.no -  
>> spill\"},\n                                     {\"feed_url\", 
>> \n                                      \"http://www.dagbladet.no/rss/spill/ 
>> \"},\n                                     {\"url\",\"http://www.dagbladet.no/spill//

>> \"},\n                                     {\"feed_id\", 
>> \n                                      \"http://www.dagbladet.no/rss/spill/ 
>> \"},\n                                     {\"description\", 
>> \n                                      \"Dagbladet.no - spill -  
>> export\"},\n                                     {\"last_updated 
>> \",null},\n                                     {\"copyright 
>> \",null},\n                                     {\"being_checked 
>> \",false},\n                                     {\"generator 
>> \",null},\n                                     {\"image\", 
>> \n                                      \"http://www.dagbladet.no/gfx/dagbladet.no.gif

>> \"},\n                                     {\"next_check\", 
>> 1207692751},\n                                      
>> {\"was_scheduled_for_check\", 
>> \n                                      1207691521}]}}]}}, 
>> \n                {insert, 
>> {1207692752,\"C3D3EE09DAF4BDEE5C77490D3E5F7C86\"}, 
>> \n                        {obj,[{\"_id\", 
>> \"C3D3EE09DAF4BDEE5C77490D3E5F7C86\"}, 
>> \n                              {\"_rev\",\"2346335936\"}, 
>> \n                              {\"class\",\"Feed\"}, 
>> \n                              {\"attributes\", 
>> \n                               {obj,[{\"title\",\"Dagbladet.no\"}, 
>> \n                                     {\"feed_url\", 
>> \n                                      \"http://www.dagbladet.no/rss/forsiden/ 
>> \"},\n                                     {\"url\",\"http://www.dagbladet.no/ 
>> \"},\n                                     {\"feed_id\", 
>> \n                                      \"http://www.dagbladet.no/rss/forsiden/ 
>> \"},\n                                     {\"description\", 
>> \"Dagbladet.no - export\"},\n                                      
>> {\"last_updated\",null},\n                                      
>> {\"copyright\",null},\n                                      
>> {\"being_checked\",false},\n                                      
>> {\"generator\",null},\n                                     {\"image 
>> \",\n                                      \"http://www.dagbladet.no/gfx/dagbladet.no.gif

>> \"},\n                                     {\"next_check\", 
>> 1207692752},\n                                      
>> {\"was_scheduled_for_check\", 
>> \n                                      1207691521}]}}]}}, 
>> \n                {insert, 
>> {1207692753,\"214F131E43C6EA407F6C03FFF8384A56\"}, 
>> \n                        {obj,[{\"_id\", 
>> \"214F131E43C6EA407F6C03FFF8384A56\"}, 
>> \n                              {\"_rev\",\"3771929290\"}, 
>> \n                              {\"class\",\"Feed\"}, 
>> \n                              {\"attributes\", 
>> \n                               {obj,[{\"title\",\"Dagbladet.no -  
>> reise\"},\n                                     {\"feed_url\", 
>> \n                                      \"http://www.dagbladet.no/rss/reise/ 
>> \"},\n                                     {\"url\",\"http://www.dagbladet.no/reise//

>> \"},\n                                     {\"feed_id\", 
>> \n                                      \"http://www.dagbladet.no/rss/reise/ 
>> \"},\n                                     {\"description\", 
>> \n                                      \"Dagbladet.no - reise -  
>> export\"},\n                                     {\"last_updated 
>> \",null},\n                                     {\"copyright 
>> \",null},\n                                     {\"being_checked 
>> \",false},\n                                     {\"generator 
>> \",null},\n                                     {\"image\", 
>> \n                                      \"http://www.dagbladet.no/gfx/dagbladet.no.gif

>> \"},\n                                     {\"next_check\", 
>> 1207692753},\n                                      
>> {\"was_scheduled_for_check\", 
>> \n                                      1207691521}]}}]}}], 
>> \n               [],[]]},\n {couch_btree,modify_node,4},\n  
>> {couch_btree,query_modify,4},\n {couch_btree,add_remove,3},\n  
>> {couch_view_group,'-write_changes/4-lc$^3/1-3-',2},\n  
>> {couch_view_group,write_changes,4},\n {couch_view_group,update_int, 
>> 2}]"}]}
>>
>


Mime
View raw message