Roles package problem


I have a problem with roles package… I am bashing my head trough the wall. It constantly crashes my app. This is the error.

W20150422-11:49:14.097(2)? (STDERR)                                             throw(ex);
W20150422-11:49:14.097(2)? (STDERR)                                                   ^
W20150422-11:49:14.097(2)? (STDERR) Error: Username already exists. [403]
W20150422-11:49:14.097(2)? (STDERR)     at Object.Accounts.insertUserDoc (packages/accounts-base/accounts_server.js:1027:1)
W20150422-11:49:14.097(2)? (STDERR)     at createUser (packages/accounts-password/password_server.js:718:1)
W20150422-11:49:14.097(2)? (STDERR)     at Object.Accounts.createUser (packages/accounts-password/password_server.js:776:1)
W20150422-11:49:14.097(2)? (STDERR)     at Meteor.methods.addTask.Tasks.insert.title (app\elevator.js:70:35)
W20150422-11:49:14.097(2)? (STDERR)     at Array.forEach (native)
W20150422-11:49:14.097(2)? (STDERR)     at Function._.each._.forEach (packages/underscore/underscore.js:105:1)
W20150422-11:49:14.097(2)? (STDERR)     at app\elevator.js:69:11

Please help it’s urgent I’m writing this as my undergrad project. Thank you for any kind of help in advance


Is the information in this thread any help?


I wasn’t able to solve that so I tried this…

        Meteor.publish(null, function (){

var users = [ Meteor.users.find({})];
if(users == email ){
    users = Meteor.this.userId;
    Roles.setUserRoles(users, 'admin');
    users = Meteor.this.userId;
return Meteor.users.find({});


Can I get help with this code. The goal is when creating user there are two user acc one should have admin and the other is normal user without role