Map Reduce Views failing when key provided

Hi folks,

Firstly, congrats on the 4.0 GA release!

I’ve installed the El Capitan Enterprise edition on my Mac, and restored from a 2.2 backup, which has previously been working fine in the 4.0 RCs and developer previews. The design documents are successfully created and indexed, and I can query a view. However, if I specify a key I get a “cannot parse response” error - this is via the Python SDK, and the REST interface (directly and via the Web UI).

Any ideas?

Dave

Looking through the logs, if these are helpful, I found these:

In ns_couchdb.log

    [couchdb:error,2015-10-06T16:53:22.073+01:00,couchdb_ns_1@127.0.0.1:<0.3121.0>:couch_log:error:44]Uncaught error in HTTP request: {error,ejson_compare_nif_not_loaded}

Stacktrace: [{erlang,nif_error,[ejson_compare_nif_not_loaded],[]},
             {couch_ejson_compare,less_json_nif,2,
                 [{file,
                      "/Users/jenkins/jenkins/workspace/sherlock-unix/couchdb/src/couchdb/couch_ejson_compare.erl"},
                  {line,62}]},
             {couch_ejson_compare,less_json,2,
                 [{file,
                      "/Users/jenkins/jenkins/workspace/sherlock-unix/couchdb/src/couchdb/couch_ejson_compare.erl"},
                  {line,49}]},
             {mapreduce_view,'-setup_views/5-fun-2-',2,
                 [{file,
                      "/Users/jenkins/jenkins/workspace/sherlock-unix/couchdb/src/couch_set_view/src/mapreduce_view.erl"},
                  {line,391}]},
             {couch_btree,drop_nodes,4,
                 [{file,
                      "/Users/jenkins/jenkins/workspace/sherlock-unix/couchdb/src/couchdb/couch_btree.erl"},
                  {line,911}]},
             {couch_btree,stream_kp_node,8,
                 [{file,
                      "/Users/jenkins/jenkins/workspace/sherlock-unix/couchdb/src/couchdb/couch_btree.erl"},
                  {line,923}]},
             {couch_btree,fold,4,
                 [{file,
                      "/Users/jenkins/jenkins/workspace/sherlock-unix/couchdb/src/couchdb/couch_btree.erl"},
                  {line,202}]},
             {couch_set_view,do_fold,5,
                 [{file,
                      "/Users/jenkins/jenkins/workspace/sherlock-unix/couchdb/src/couch_set_view/src/couch_set_view.erl"},
                  {line,894}]}]

In debug.log

[ns_server:error,2015-10-06T16:53:22.074+01:00,ns_1@127.0.0.1:<0.17094.4>:menelaus_web:loop:184]Server error during processing: ["web request failed",
                                 {path,
                                  "/couchBase/seenitstudio/_design/dev_user/_view/usersByEmail"},
                                 {method,'GET'},
                                 {type,error},
                                 {what,
                                  {badmatch,
                                   {error,
                                    {badarg,
                                     [{erlang,list_to_integer,
                                       ["HTTP/1.1500InternalServerError",16],
                                       []},
                                      {lhttpc_client,chunk_size,1,
                                       [{file,
                                         "/Users/jenkins/jenkins/workspace/sherlock-unix/couchdb/src/lhttpc/lhttpc_client.erl"},
                                        {line,736}]},
                                      {lhttpc_client,read_chunked_body,4,
                                       [{file,
                                         "/Users/jenkins/jenkins/workspace/sherlock-unix/couchdb/src/lhttpc/lhttpc_client.erl"},
                                        {line,722}]},
                                      {lhttpc_client,handle_response_body,4,
                                       [{file,
                                         "/Users/jenkins/jenkins/workspace/sherlock-unix/couchdb/src/lhttpc/lhttpc_client.erl"},
                                        {line,484}]},
                                      {lhttpc_client,read_response,4,
                                       [{file,
                                         "/Users/jenkins/jenkins/workspace/sherlock-unix/couchdb/src/lhttpc/lhttpc_client.erl"},
                                        {line,446}]},
                                      {lhttpc_client,execute,9,
                                       [{file,
                                         "/Users/jenkins/jenkins/workspace/sherlock-unix/couchdb/src/lhttpc/lhttpc_client.erl"},
                                        {line,169}]},
                                      {lhttpc_client,request,9,
                                       [{file,
                                         "/Users/jenkins/jenkins/workspace/sherlock-unix/couchdb/src/lhttpc/lhttpc_client.erl"},
                                        {line,92}]}]}}}},
                                 {trace,
                                  [{capi_http_proxy,handle_request,1,
                                    [{file,"src/capi_http_proxy.erl"},
                                     {line,75}]},
                                   {menelaus_web,loop,2,
                                    [{file,"src/menelaus_web.erl"},
                                     {line,160}]},

Dave,

The error messages is saying the ejson_compare_nif could not be loaded. This looks a lot like MB-16435 and this forum post. The SIP feature in El Capitian disrupts the dynamic loading of libraries…

When did you installed the El Capitan Enterprise edition, and where did you download it from? I will try and reproduce here.

This was today, using the El Capitan GA release on the couchbase.com
homepage

Note that El Capitan is not yet at supported platform for Couchbase Server 4.0.

There is a Developer Preview for El Capitan available on the website - see http://www.couchbase.com/nosql-databases/downloads and select “Mac OS X El Capitan”

Dave,

Thank you for reporting this issue, I have reproduced the problem and have updated MB-16435 with the details. We have a fix that is waiting to be tested. Once we have more information I will let you know.

On the off chance that a new build had been uploaded, a tried a fresh download and install of the El Capitan release, and it looks like this issue has been fixed. Thanks for the quick turnaround!