Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E6562DA32 for ; Wed, 14 Nov 2012 19:36:13 +0000 (UTC) Received: (qmail 34482 invoked by uid 500); 14 Nov 2012 19:36:13 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 34430 invoked by uid 500); 14 Nov 2012 19:36:13 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 34405 invoked by uid 99); 14 Nov 2012 19:36:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Nov 2012 19:36:13 +0000 Date: Wed, 14 Nov 2012 19:36:13 +0000 (UTC) From: =?utf-8?Q?Fabr=C3=ADcio_Dias_=28JIRA=29?= To: dev@couchdb.apache.org Message-ID: <1237230728.115334.1352921773319.JavaMail.jiratomcat@arcas> Subject: [jira] [Created] (COUCHDB-1605) Fail to Add Document to _replicator MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Fabr=C3=ADcio Dias created COUCHDB-1605: -------------------------------------- Summary: Fail to Add Document to _replicator Key: COUCHDB-1605 URL: https://issues.apache.org/jira/browse/COUCHDB-1605 Project: CouchDB Issue Type: Bug Components: Replication Affects Versions: 1.2 Environment: uname -a Linux SPOUOLSRV17 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:n3ts3rv1c0s@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 er= lang-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/apach= e-couchdb-1.2.0.tar.gz tar zxfv apache-couchdb-1.2.0.tar.gz cd /tmp/apache-couchdb-1.2.0 ./configure --prefix=3D/opt --with-erlang=3D/usr/lib64/erlang/usr/include -= -with-js-lib=3D/usr/local/lib/ --with-js-include=3D/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:n3ts3rv1c0s@127.0.0.1:5984/; {"couchdb":"Welcome","version":"1.2.0"} Reporter: Fabr=C3=ADcio Dias Priority: Critical # 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_se= q":4,"purge_seq":0,"compact_running":false,"disk_size":2379878,"data_size":= 2358489,"instance_start_time":"1352921020564400","disk_format_version":6,"c= ommitted_update_seq":4} [root@ORALNX couchdb]# curl -X POST http://admin:password@127.0.0.1:5984/_r= eplicator -H "content-type: application/json" -d \ '{ "_id":"reply1", "source":"syd_global_couchapp", "target":"syd_global_couchapp_copy", "create_target":true, "continuous":true }'; {"error":"{bad_return_value,{os_process_error,{exit_status,127}}}","reason"= :"{gen_server,call, [couch_query_servers, {get_proc,{doc,<<\"_design/_replicator\">>, {7, [<<63,207,130,209,42,66,129,178,15,48,222,32,1= 10, 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,6= 6, 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>>]}, {[{<<\"language\">>,<<\"javascript\">>}, {<<\"validate_doc_update\">>, <<\" function(newDoc, oldDoc, userCtx) { function reportError(error_msg) { log('Error writing document `' + newDoc._id + '\\\\' to the replicator database: ' + error_msg); throw({forbidden: error_msg}); } function validateEndpoint(endpoint, fieldName) { if ((typeof endpoint !=3D=3D 'string') && ((typeof endpoint !=3D=3D 'object') || (endpoint =3D=3D=3D = null))) { reportError('The `' + fieldName + '\\\\' property must exis= t' + ' and be either a string or an object.'); } if (typeof endpoint =3D=3D=3D 'object') { if ((typeof endpoint.url !=3D=3D 'string') || !endpoint.url= ) { reportError('The url property must exist in the `' + fieldName + '\\\\' field and must be a non-empty st= ring.'); } if ((typeof endpoint.auth !=3D=3D 'undefined') && ((typeof endpoint.auth !=3D=3D 'object') || endpoint.auth =3D=3D=3D null)) { reportError('`' + fieldName + '.auth\\\\' must be a non-null object.'); } if ((typeof endpoint.headers !=3D=3D 'undefined') && ((typeof endpoint.headers !=3D=3D 'object') || endpoint.headers =3D=3D=3D null)) { reportError('`' + fieldName + '.headers\\\\' must be a non-null object.'); } } } var isReplicator =3D (userCtx.roles.indexOf('_replicator') >=3D 0); var isAdmin =3D (userCtx.roles.indexOf('_admin') >=3D 0); if (oldDoc && !newDoc._deleted && !isReplicator && (oldDoc._replication_state =3D=3D=3D 'triggered')) { reportError('Only the replicator can edit replication documents= ' + 'that are in the triggered state.'); } if (!newDoc._deleted) { validateEndpoint(newDoc.source, 'source'); validateEndpoint(newDoc.target, 'target'); if ((typeof newDoc.create_target !=3D=3D 'undefined') && (typeof newDoc.create_target !=3D=3D 'boolean')) { reportError('The `create_target\\\\' field must be a boolea= n.'); } if ((typeof newDoc.continuous !=3D=3D 'undefined') && (typeof newDoc.continuous !=3D=3D 'boolean')) { reportError('The `continuous\\\\' field must be a boolean.'= ); } if ((typeof newDoc.doc_ids !=3D=3D 'undefined') && !isArray(newDoc.doc_ids)) { reportError('The `doc_ids\\\\' field must be an array of st= rings.'); } if ((typeof newDoc.filter !=3D=3D 'undefined') && ((typeof newDoc.filter !=3D=3D 'string') || !newDoc.filter)= ) { reportError('The `filter\\\\' field must be a non-empty str= ing.'); } if ((typeof newDoc.query_params !=3D=3D 'undefined') && ((typeof newDoc.query_params !=3D=3D 'object') || newDoc.query_params =3D=3D=3D null)) { reportError('The `query_params\\\\' field must be an object= .'); } if (newDoc.user_ctx) { var user_ctx =3D newDoc.user_ctx; if ((typeof user_ctx !=3D=3D 'object') || (user_ctx =3D=3D= =3D null)) { reportError('The `user_ctx\\\\' property must be a ' + 'non-null object.'); } if (!(user_ctx.name =3D=3D=3D null || (typeof user_ctx.name =3D=3D=3D 'undefined') || ((typeof user_ctx.name =3D=3D=3D 'string') && user_ctx.name.length > 0))) { reportError('The `user_ctx.name\\\\' property must be a= ' + 'non-empty string or null.'); } if (!isAdmin && (user_ctx.name !=3D=3D 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 =3D 0; i < user_ctx.roles.length; i++) { var role =3D user_ctx.roles[i]; if (typeof role !=3D=3D 'string' || role.length =3D= =3D=3D 0) { reportError('Roles must be non-empty strings.')= ; } if (userCtx.roles.indexOf(role) =3D=3D=3D -1) { reportError('Invalid role (`' + role + '\\\\') in the `user_ctx\\\\''); } } } } else { if (!isAdmin) { reportError('The `user_ctx\\\\' property is missing (it= is ' + 'optional for admins only).'); } } } else { if (!isAdmin) { if (!oldDoc.user_ctx || (oldDoc.user_ctx.name !=3D=3D userC= tx.name)) { reportError('Replication documents can only be deleted = by ' + 'admins or by the users who created them.'); } } } } \">>}]}, [],false,[]}, {<<\"_design/_replicator\">>, <<\"7-3fcf82d12a4281b20f30de206e3cef34\">>}}, infinity]}"} [root@ORALNX couchdb]# -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira