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 270B7F716 for ; Fri, 5 Apr 2013 08:26:17 +0000 (UTC) Received: (qmail 66518 invoked by uid 500); 5 Apr 2013 08:26:16 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 66321 invoked by uid 500); 5 Apr 2013 08:26:16 -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 66287 invoked by uid 99); 5 Apr 2013 08:26:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Apr 2013 08:26:15 +0000 Date: Fri, 5 Apr 2013 08:26:15 +0000 (UTC) From: "Vidja (JIRA)" To: dev@couchdb.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (COUCHDB-1121) Signup error is shown after creating an administrator account MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-1121?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D13= 623452#comment-13623452 ]=20 Vidja commented on COUCHDB-1121: -------------------------------- Same issue after installing 1.2.1 on Ubuntu 10.04 64bit server.=20 Compiled and installed without error messages. Futon shows a little message and provides a Link to add admin account. The = admin account is created and added to local.ini but the following error mes= sage appears. Same error as above. =20 > Signup error is shown after creating an administrator account > ------------------------------------------------------------- > > Key: COUCHDB-1121 > URL: https://issues.apache.org/jira/browse/COUCHDB-1121 > Project: CouchDB > Issue Type: Bug > Components: Futon > Affects Versions: 1.0.2 > Environment: Mac OS X 10.6.7, Max OS X 10.7.preview2, Ubuntu 10.1= 0, all systems are running in x86_64 mode. > Reporter: Denny Trebbin > Priority: Minor > Fix For: 1.1.1 > > Attachments: Apache CouchDB - Futon Overview - Google Chrome_001.= png, couch.log > > > A fresh new installation of CouchDB comes with no pre defined admin accou= nt. Futon shows a little message and provides a Link to fix this. > If I try to add an user named as root and give him a password then Futon = will show an error after saving this account. > Signup error: {gen_server,call, > [couch_query_servers, > {get_proc,{doc,<<"_design/_auth">>, > {1, > [<<196,79,177,42,38,118,212,129,210,53,82,48= , > 146,224,206,196>>]}, > {[{<<"language">>,<<"javascript">>}, > {<<"validate_doc_update">>, > <<"\n function(newDoc, oldDoc, userCtx)= {\n if (newDoc._deleted =3D=3D=3D true) {\n // allow del= etes by admins and matching users\n // without checking the othe= r fields\n if ((userCtx.roles.indexOf('_admin') !=3D=3D -1) ||\n= (userCtx.name =3D=3D oldDoc.name)) {\n retur= n;\n } else {\n throw({forbidden: 'Only admins ma= y delete other user docs.'});\n }\n }\n\n if ((old= Doc && oldDoc.type !=3D=3D 'user') || newDoc.type !=3D=3D 'user') {\n = throw({forbidden : 'doc.type must be user'});\n } // we only a= llow user docs for now\n\n if (!newDoc.name) {\n throw({f= orbidden: 'doc.name is required'});\n }\n\n if (newDoc.roles = && !isArray(newDoc.roles)) {\n throw({forbidden: 'doc.roles must= be an array'});\n }\n\n if (newDoc._id !=3D=3D ('org.couchdb= .user:' + newDoc.name)) {\n throw({\n forbidden: = 'Doc ID must be of the form org.couchdb.user:name'\n });\n = }\n\n if (oldDoc) { // validate all updates\n if (oldDo= c.name !=3D=3D newDoc.name) {\n throw({forbidden: 'Usernames= can not be changed.'});\n }\n }\n\n if (newDoc.pa= ssword_sha && !newDoc.salt) {\n throw({\n forbidd= en: 'Users with password_sha must have a salt.' +\n 'See= /_utils/script/couch.js for example code.'\n });\n }\n\n= if (userCtx.roles.indexOf('_admin') =3D=3D=3D -1) {\n if= (oldDoc) { // validate non-admin updates\n if (userCtx.name= !=3D=3D newDoc.name) {\n throw({\n = forbidden: 'You may only update your own user document.'\n = });\n }\n // validate role updates\n = var oldRoles =3D oldDoc.roles.sort();\n var new= Roles =3D newDoc.roles.sort();\n\n if (oldRoles.length !=3D= =3D newRoles.length) {\n throw({forbidden: 'Only _admin = may edit roles'});\n }\n\n for (var i =3D 0; = i < oldRoles.length; i++) {\n if (oldRoles[i] !=3D=3D ne= wRoles[i]) {\n throw({forbidden: 'Only _admin may ed= it roles'});\n }\n }\n } else = if (newDoc.roles.length > 0) {\n throw({forbidden: 'Only _ad= min may set roles'});\n }\n }\n\n // no system rol= es in users db\n for (var i =3D 0; i < newDoc.roles.length; i++) {\n= if (newDoc.roles[i][0] =3D=3D=3D '_') {\n throw(= {\n forbidden:\n 'No system roles (st= arting with underscore) in users db.'\n });\n }\n= }\n\n // no system names as names\n if (newDoc.name[0= ] =3D=3D=3D '_') {\n throw({forbidden: 'Username may not start w= ith underscore.'});\n }\n }\n">>}]}, > [],false,[]}, > {<<"_design/_auth">>, > <<"1-c44fb12a2676d481d235523092e0cec4">>}}]} > The admin account will be created and I can log in with the admin account= "root". This problem showed up every time I installed CouchDB on my machin= e. > On Mac OS I used Homebrew ($ brew install couchdb) to install CouchDB whi= ch downloads all the sources, compiles them and install properly. On my Lin= ux machine I've followed the compile instructions from the Wiki page. -- 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