I am trying to build a sample application using couchapp, couchdb. I am also using the jquery.couch.js plugin to communicate with my local couchdb. However when I try to replicate it to my remote couch on iriscouch.com, I get the following error:

Replication failed: {error,
{{badarg,
     [{erlang,list_to_existing_atom,["data_size"]},
      {couch_rep,'-dbinfo/1-lc$^0/1-0-',1},
      {couch_rep,'-dbinfo/1-lc$^0/1-0-',1},
      {couch_rep,do_init,1},
      {couch_rep,init,1},
      {gen_server,init_it,6},
      {proc_lib,init_p_do_apply,3}]},
 {child,undefined,"6f5beff2bd381e02b602cee2e8e1e86d",
     {gen_server,start_link,
         [couch_rep,
          ["6f5beff2bd381e02b602cee2e8e1e86d",
           {[{<<"source">>,<<"zwaroop">>},
             {<<"target">>,
              <<"http://username:password@swaroopsm.iriscouch.com/zwaroop">>}]},
           {user_ctx,<<"root">>,
               [<<"_admin">>],
               <<"{couch_httpd_auth, cookie_authentication_handler}">>}],
          []]},
     temporary,1,worker,
     [couch_rep]}}}

Where am I go wrong?

有帮助吗?

解决方案

If you are using Ubuntu 12.04 (which comes with CouchDB v1.0.1), you can use a PPA instead of installing CouchDB from source. For instance, https://launchpad.net/~novacut/+archive/daily has a backport of 1.2.0 for precise; I installed it with

$ sudo apt-add-repository ppa:novacut/daily
$ sudo apt-get update
$ sudo apt-get install couchdb

After the upgrade to 1.2.0 the problem was solved.

EDIT: the Novacut repository no longer hosts package for couchdb, as version 1.5.0 has been included in Ubuntu Trusty (http://packages.ubuntu.com/trusty/couchdb).

其他提示

I wonder if that is a version mismatch? What version of CouchDB are you using on your local system?

Anyway, a quick workaround would be to edit the source code of CouchDB and insert data_size anywhere in the code.

For example, src/couchdb/couch_doc.erl

-spec to_path(#doc{}) -> path().
to_path(#doc{revs={Start, RevIds}}=Doc) ->
    data_size, % This no-op expression allows list_to_existing_atom
    [Branch] = to_branch(Doc, lists:reverse(RevIds)),
    {Start - length(RevIds) + 1, Branch}.

However hopefully we can find something better than this by identifying your versions.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top