Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Won't Fix
-
1.2
-
None
-
None
-
uname -a
{"couchdb":"Welcome","version":"1.2.0"}
Linux ORALNX 2.6.39-200.32.1.el6uek.x86_64 #1 SMP Wed Sep 26 23:11:38 PDT 2012 x86_64 x86_64 x86_64 GNU/Linux
curl -X GET http://admin:password@127.0.0.1:5984;-
-
- SETUP - JS 1.8.5
yum install -y wget gcc-c++ autoconf213 zip
cd /tmp
wget http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
tar xvf js185-1.0.0.tar.gz
cd /tmp/js-1.8.5/js/src
autoconf-2.13
./configure
make && make install
- SETUP - JS 1.8.5
-
-
-
-
- SETUP - CouchDB
yum install -y gcc autoconf automake make libicu-devel curl-devel erlang erlang-ibrowse erlang-mochiweb erlang-oauth openssl-devel libtool which
cd /tmp
wget http://apache.mirror.pop-sc.rnp.br/apache/couchdb/releases/1.2.0/apache-couchdb-1.2.0.tar.gz
tar zxfv apache-couchdb-1.2.0.tar.gz
cd /tmp/apache-couchdb-1.2.0
./configure --prefix=/opt --with-erlang=/usr/lib64/erlang/usr/include --with-js-lib=/usr/local/lib/ --with-js-include=/usr/local/include/js/
make && make install
- SETUP - CouchDB
-
-
-
-
-
- START - CouchDB
ln -s /opt/etc/rc.d/couchdb /etc/init.d/couchdb;
chkconfig --add couchdb;
chkconfig --level 345 couchdb on;
service couchdb stop;
sleep 3;
service couchdb start;
sleep 3;
curl -X GET http://admin:password@127.0.0.1:5984/; {"couchdb":"Welcome","version":"1.2.0"}
- START - CouchDB
-
-
uname -a Linux ORALNX 2.6.39-200.32.1.el6uek.x86_64 #1 SMP Wed Sep 26 23:11:38 PDT 2012 x86_64 x86_64 x86_64 GNU/Linux curl -X GET http://admin:password@127.0.0.1:5984 ; {"couchdb":"Welcome","version":"1.2.0"} SETUP - JS 1.8.5 yum install -y wget gcc-c++ autoconf213 zip cd /tmp wget http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz tar xvf js185-1.0.0.tar.gz cd /tmp/js-1.8.5/js/src autoconf-2.13 ./configure make && make install SETUP - CouchDB yum install -y gcc autoconf automake make libicu-devel curl-devel erlang erlang-ibrowse erlang-mochiweb erlang-oauth openssl-devel libtool which cd /tmp wget http://apache.mirror.pop-sc.rnp.br/apache/couchdb/releases/1.2.0/apache-couchdb-1.2.0.tar.gz tar zxfv apache-couchdb-1.2.0.tar.gz cd /tmp/apache-couchdb-1.2.0 ./configure --prefix=/opt --with-erlang=/usr/lib64/erlang/usr/include --with-js-lib=/usr/local/lib/ --with-js-include=/usr/local/include/js/ make && make install START - CouchDB ln -s /opt/etc/rc.d/couchdb /etc/init.d/couchdb; chkconfig --add couchdb; chkconfig --level 345 couchdb on; service couchdb stop; sleep 3; service couchdb start; sleep 3; curl -X GET http://admin:password@127.0.0.1:5984/ ; {"couchdb":"Welcome","version":"1.2.0"} -
-
New Contributors Level (Easy)
Description
- Now I try to create a replica:
[root@ORALNX couchdb]# curl -X GET http://admin:password@127.0.0.1:5984/syd_global_couchapp; {"db_name":"syd_global_couchapp","doc_count":3,"doc_del_count":0,"update_seq":4,"purge_seq":0,"compact_running":false,"disk_size":2379878,"data_size":2358489,"instance_start_time":"1352921020564400","disk_format_version":6,"committed_update_seq":4}[root@ORALNX couchdb]# curl -X POST http://admin:password@127.0.0.1:5984/_replicator -H "content-type: application/json" -d \
{exit_status,127}
'{
"_id":"reply1",
"source":"syd_global_couchapp",
"target":"syd_global_couchapp_copy",
"create_target":true,
"continuous":true
}';
{"error":"{bad_return_value,{os_process_error,}}","reason":"{gen_server,call,
{7, [<<63,207,130,209,42,66,129,178,15,48,222,32,110, 60,239,52>>, <<124,51,106,90,72,50,181,32,225,86,125,33,30,34, 213,185>>, <<115,129,44,182,171,22,108,111,73,61,111,140,98, 211,86,183>>, <<19,237,37,141,211,255,51,86,82,227,32,169,66, 75,147,202>>, <<124,39,146,76,233,174,78,63,55,135,118,148,221, 110,241,51>>, <<141,251,167,195,125,83,96,188,172,13,211,92, 251,86,210,229>>, <<91,250,44,153,238,254,43,46,180,150,45,181, 10,163,207,212>>]}
[couch_query_servers,
{get_proc,{doc,<<\"_design/_replicator\">>,
,
{<<\"language\">>,<<\"javascript\">>}
{[,
{<<\"validate_doc_update\">>,
<<\"
function(newDoc, oldDoc, userCtx) {
function reportError(error_msg)Unknown macro: { log('Error writing document `' + newDoc._id + '\\' to the replicator database}
function validateEndpoint(endpoint, fieldName) {
if ((typeof endpoint !== 'string') &&
((typeof endpoint !== 'object') || (endpoint === null)))
if (typeof endpoint === 'object') {
if ((typeof endpoint.url !== 'string') || !endpoint.url)
if ((typeof endpoint.auth !== 'undefined') &&
((typeof endpoint.auth !== 'object') ||
endpoint.auth === null))
if ((typeof endpoint.headers !== 'undefined') &&
((typeof endpoint.headers !== 'object') ||
endpoint.headers === null))
}
}
var isReplicator = (userCtx.roles.indexOf('_replicator') >= 0);
var isAdmin = (userCtx.roles.indexOf('_admin') >= 0);
if (oldDoc && !newDoc._deleted && !isReplicator &&
(oldDoc._replication_state === 'triggered'))
if (!newDoc._deleted) {
validateEndpoint(newDoc.source, 'source');
validateEndpoint(newDoc.target, 'target');
if ((typeof newDoc.create_target !== 'undefined') &&
(typeof newDoc.create_target !== 'boolean'))
if ((typeof newDoc.continuous !== 'undefined') &&
(typeof newDoc.continuous !== 'boolean'))
if ((typeof newDoc.doc_ids !== 'undefined') &&
!isArray(newDoc.doc_ids))
if ((typeof newDoc.filter !== 'undefined') &&
((typeof newDoc.filter !== 'string') || !newDoc.filter))
if ((typeof newDoc.query_params !== 'undefined') &&
((typeof newDoc.query_params !== 'object') ||
newDoc.query_params === null))
if (newDoc.user_ctx) {
var user_ctx = newDoc.user_ctx;
if ((typeof user_ctx !== 'object') || (user_ctx === null))
{ reportError('The `user_ctx\\\\' property must be a ' + 'non-null object.'); } if (!(user_ctx.name === null ||
(typeof user_ctx.name === 'undefined') ||
((typeof user_ctx.name === 'string') &&
user_ctx.name.length > 0)))
if (!isAdmin && (user_ctx.name !== userCtx.name))
{ reportError('The given `user_ctx.name\\\\' is not valid'); }if (user_ctx.roles && !isArray(user_ctx.roles))
{ reportError('The `user_ctx.roles\\\\' property must be ' + 'an array of strings.'); } if (!isAdmin && user_ctx.roles) {
for (var i = 0; i < user_ctx.roles.length; i++) {
var role = user_ctx.roles[i];
if (typeof role !== 'string' || role.length === 0)
{ reportError('Roles must be non-empty strings.'); }if (userCtx.roles.indexOf(role) === -1)
{ reportError('Invalid role (`' + role + '\\\\') in the `user_ctx\\\\''); } }
}
} else {
if (!isAdmin)
}
} else {
if (!isAdmin) {
if (!oldDoc.user_ctx || (oldDoc.user_ctx.name !== userCtx.name))
}
}
}
\">>}]},
[],false,[]},
{<<\"_design/_replicator\">>,
<<\"7-3fcf82d12a4281b20f30de206e3cef34\">>}},
infinity]}"}
[root@ORALNX couchdb]#