Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-4801

Unfriendly error message for builtin reduce function _stats

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0-developer-preview-4
    • Component/s: view-engine
    • Security Level: Public
    • Labels:
      None
    • Environment:
      1 node cluster.
      Ubuntu 10.04 64 bit
      2.0.0r-665-ga56327e

      Description

      Items ~ 5M.

      Query (with negative connection timeout) :-
      http://10.2.1.64:8092/default/_design/dev_temp/_view/temp?stale=false&connection_timeout=-1&limit=10&skip=0

      Design doc:-
      {"_id":"_design/dev_temp","_rev":"4-a2116f64","views":{"temp":{"map":"function (doc)

      {\n emit(doc._id, [doc.achievements, doc.coins]);\n}

      ","reduce":"_stats"}}}

      Error:-

      "from": "local",
      "reason": "{function_clause,\n [

      {couch_query_servers,builtin_stats,\n [reduce,\n [[[<<\"01b7575c38dac42f\">>,<<\"01b7575c38dac42f\">>],[\"\\r%m�-I\",4.39]],\n [[<<\"02c29fad5f164d62\">>,<<\"02c29fad5f164d62\">>],\n [[3,94,134,62,146,176],7.06]],\n [[<<\"039b9f5c48fb1bbe\">>,<<\"039b9f5c48fb1bbe\">>],[\"Oo�m\",9.23]],\n [[<<\"06866f020cb80790\">>,<<\"06866f020cb80790\">>],[\"=�\",16.7]],\n [[<<\"07b1e246e902a97f\">>,<<\"07b1e246e902a97f\">>],\n [[76,157,157,179,14,239],19.69]],\n [[<<\"094bc4aa468a6cb4\">>,<<\"094bc4aa468a6cb4\">>],\n [[48,80,134,214,52,206],23.79]],\n [[<<\"0a1e1d8da51f5dd7\">>,<<\"0a1e1d8da51f5dd7\">>],\n [[62,142,187,197,91],25.9]],\n [[<<\"0a797fd202caabdf\">>,<<\"0a797fd202caabdf\">>],[\" ..@�9�\",26.81]],\n [[<<\"0a862b7f915e2f79\">>,<<\"0a862b7f915e2f79\">>],\n [[54,126,135,185,58,156],26.94]],\n [[<<\"0ac60fb446a982fc\">>,<<\"0ac60fb446a982fc\">>],\n [[21,53,107,207,138],27.58]],\n [[<<\"0b0b963ba25b9d38\">>,<<\"0b0b963ba25b9d38\">>],\n [[5,85,103,153,51,93,213],28.27]],\n [[<<\"0b96459020caf4e1\">>,<<\"0b96459020caf4e1\">>],\n [[78,188,116,131],29.66]]]]}

      ,\n

      {couch_query_servers,builtin_reduce,4}

      ,\n

      {couch_query_servers,reduce,3}

      ,\n

      {couch_view_group,'-init_group/4-fun-1-',4}

      ,\n

      {couch_btree,'-write_node/3-lc$^0/1-0-',5}

      ,\n

      {couch_btree,write_node,3}

      ,\n

      {couch_btree,modify_node,8}

      ,\n

      {couch_btree,query_modify,6}

      ]}"
      }

      Attaching the diags

      1. Screen Shot 2012-02-14 at 12.56.01 PM.png
        428 kB
      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        karan Karan Kumar (Inactive) added a comment -

        See the following error messages when querying with:-

        http://10.2.1.64:8092/default/_design/dev_temp/_view/temp?full_set=true&stale=false&connection_timeout=60000&limit=10&skip=0

        {"error":"{nocatch,{error,function_clause}}","reason":"[

        {couch_set_view,get_group,3}

        ,\n

        {couch_set_view,get_reduce_view,5}

        ,\n

        {couch_view_merger,prepare_set_view,4}

        ,\n

        {couch_view_merger,reduce_set_view_folder,4}

        ]"}

        Show
        karan Karan Kumar (Inactive) added a comment - See the following error messages when querying with:- http://10.2.1.64:8092/default/_design/dev_temp/_view/temp?full_set=true&stale=false&connection_timeout=60000&limit=10&skip=0 {"error":"{nocatch,{error,function_clause}}","reason":"[ {couch_set_view,get_group,3} ,\n {couch_set_view,get_reduce_view,5} ,\n {couch_view_merger,prepare_set_view,4} ,\n {couch_view_merger,reduce_set_view_folder,4} ]"}
        Hide
        karan Karan Kumar (Inactive) added a comment -

        This does not seem related to connection_timeout at all. Was able to reproduce this with even default connection_timeout param.

        Show
        karan Karan Kumar (Inactive) added a comment - This does not seem related to connection_timeout at all. Was able to reproduce this with even default connection_timeout param.
        Hide
        FilipeManana Filipe Manana (Inactive) added a comment -

        CouchDB's builtin reduce function _stats expects values emitted by the map function to be numbers.
        I've updated in CouchDB the error handling, so for a 2 nodes cluster for e.g., you get:

        $ curl http://localhost:9500/default/_design/test/_view/view1?stale=false
        {"rows":[
        ],
        "errors":[

        {"from":"local","reason":"builtin _stats function requires map values to be numbers"}

        ,

        {"from":"http://192.168.1.80:9501/_view_merge/","reason":"builtin _stats function requires map values to be numbers"}

        ]
        }

        In http://review.couchbase.org/#change,13253

        Show
        FilipeManana Filipe Manana (Inactive) added a comment - CouchDB's builtin reduce function _stats expects values emitted by the map function to be numbers. I've updated in CouchDB the error handling, so for a 2 nodes cluster for e.g., you get: $ curl http://localhost:9500/default/_design/test/_view/view1?stale=false {"rows":[ ], "errors":[ {"from":"local","reason":"builtin _stats function requires map values to be numbers"} , {"from":"http://192.168.1.80:9501/_view_merge/","reason":"builtin _stats function requires map values to be numbers"} ] } In http://review.couchbase.org/#change,13253
        Show
        FilipeManana Filipe Manana (Inactive) added a comment - Applied to branch-20dp4 and master: https://github.com/couchbase/couchdb/commit/015e9129aef5231c091ecc3514111bbfbee27dfc

          People

          • Assignee:
            FilipeManana Filipe Manana (Inactive)
            Reporter:
            karan Karan Kumar (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes