incubator-couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denny Trebbin (JIRA)" <>
Subject [jira] [Created] (COUCHDB-1121) Signup error is shown after creating an administrator account
Date Wed, 06 Apr 2011 06:07:05 GMT
Signup error is shown after creating an administrator account

                 Key: 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.10, all systems are
running in x86_64 mode.
            Reporter: Denny Trebbin
            Priority: Minor

A fresh new installation of CouchDB comes with no pre defined admin account. 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,
                               <<"\n    function(newDoc, oldDoc, userCtx) {\n      
 if (newDoc._deleted === true) {\n            // allow deletes by admins and matching users\n
           // without checking the other fields\n            if ((userCtx.roles.indexOf('_admin')
!== -1) ||\n                ( == {\n                return;\n  
         } else {\n                throw({forbidden: 'Only admins may delete other user docs.'});\n
           }\n        }\n\n        if ((oldDoc && oldDoc.type !== 'user') || newDoc.type
!== 'user') {\n            throw({forbidden : 'doc.type must be user'});\n        } // we
only allow user docs for now\n\n        if (! {\n            throw({forbidden:
' 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 !== ('org.couchdb.user:' + {\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 ( !==
{\n                throw({forbidden: 'Usernames can not be changed.'});\n            }\n 
      }\n\n        if (newDoc.password_sha && !newDoc.salt) {\n            throw({\n
               forbidden: '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') === -1) {\n            if (oldDoc) { // validate non-admin
updates\n                if ( !== {\n                    throw({\n
                       forbidden: 'You may only update your own user document.'\n        
           });\n                }\n                // validate role updates\n            
   var oldRoles = oldDoc.roles.sort();\n                var newRoles = newDoc.roles.sort();\n\n
               if (oldRoles.length !== newRoles.length) {\n                    throw({forbidden:
'Only _admin may edit roles'});\n                }\n\n                for (var i = 0; i <
oldRoles.length; i++) {\n                    if (oldRoles[i] !== newRoles[i]) {\n        
               throw({forbidden: 'Only _admin may edit roles'});\n                    }\n
               }\n            } else if (newDoc.roles.length > 0) {\n                throw({forbidden:
'Only _admin may set roles'});\n            }\n        }\n\n        // no system roles in
users db\n        for (var i = 0; i < newDoc.roles.length; i++) {\n            if (newDoc.roles[i][0]
=== '_') {\n                throw({\n                    forbidden:\n                    'No
system roles (starting with underscore) in users db.'\n                });\n            }\n
       }\n\n        // no system names as names\n        if ([0] === '_') {\n 
          throw({forbidden: 'Username may not start with underscore.'});\n        }\n    }\n">>}]},

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 machine.
On Mac OS I used Homebrew ($ brew install couchdb) to install CouchDB which downloads all
the sources, compiles them and install properly. On my Linux machine I've followed the compile
instructions from the Wiki page.

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message