我正在尝试使用couchapp,couchdb构建一个示例应用程序。我也使用jquery.couch.js插件与我的本地couchdb进行通信。但是当我尝试将它复制到iriscouch.com上的远程沙发时,我收到以下错误:
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]}}}
我哪里出错?
答案 0 :(得分:3)
如果您使用的是Ubuntu 12.04(CouchDB v1.0.1附带),则可以使用PPA而不是从源代码安装CouchDB。例如,https://launchpad.net/~novacut/+archive/daily的后向端口为1.2.0,用于精确;我用
安装了它$ sudo apt-add-repository ppa:novacut/daily
$ sudo apt-get update
$ sudo apt-get install couchdb
升级到1.2.0后问题解决了。
编辑: Novacut存储库不再托管couchdb
的软件包,因为版本1.5.0已包含在Ubuntu Trusty(http://packages.ubuntu.com/trusty/couchdb)中。
答案 1 :(得分:1)
我想知道这是不是版本不匹配?您在本地系统上使用的是什么版本的CouchDB?
无论如何,一个快速的解决方法是编辑CouchDB的源代码并在代码中的任何位置插入data_size
。
例如,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}.
然而,希望通过识别您的版本,我们可以找到比这更好的东西。