Picture of Nicolas S
Trouble setting up the authoring tool - MongoError
by Nicolas S - Wednesday, 22 April 2015, 10:25 AM
 

Hi!

I have some trouble with setting up the authoring tool. Everything works fine until node install and the subsequent inputs.

The console returns:

ERROR:  { [MongoError: not authorized for query on adapt-tenant-master.tenants]

  name: 'MongoError',

  '$err': 'not authorized for query on adapt-tenant-master.tenants',

  code: 13 }

Tenant creation was unsuccessful. Please check the console output.

So I guess the install tool cannot access the database? Never worked with Node.js and MongoDB before. I am kind of clueless where to begin... Also I am puzzled that there were no login credentials requested...

Picture of Sam Tsiu
Re: Trouble setting up the authoring tool - MongoError
by Sam Tsiu - Wednesday, 22 April 2015, 1:46 PM
 

Hi Nicolas

Have you set the read and write permission to the user account running the Mongodb?

Picture of Nicolas S
Re: Trouble setting up the authoring tool - MongoError
by Nicolas S - Thursday, 23 April 2015, 8:07 PM
 

Hi Sam!

Thx for your reply. It did not work with an user with ReadWrite access, neither. 
I found this thread which says that the authoring tool does not require a password for the MongoDB by default. So I changed my database to --noauth. Then it worked.

 

Now I am still having some trouble with the server port, but I guess I'll get this fixed together with my hoster.

Picture of Nicolas S
Re: Trouble setting up the authoring tool - MongoError
by Nicolas S - Friday, 24 April 2015, 3:59 PM
 

Is there any possibility to use the Adapt Authoring Tool together with an authorization for the MognoDB?

--noauth is quite insecure when using shared hosting... 

Picture of Oscar Arango
Re: Trouble setting up the authoring tool - MongoError
by Oscar Arango - Monday, 11 April 2016, 5:33 PM
 

I see it's been one year since this thread has been updated.  This topic is still very important and any information regarding this is rare.  Today I was able to add remote authentication to a server that runs the Adapt auth tool, but now I get the 

{"success":false,"error":"not authorized for query on adapt-tenant-master.sessions"}

in my DB I have added the required info to the tenants database section but still get the same error.

thanks in advance.

Picture of Trieu Truong
Re: Trouble setting up the authoring tool - MongoError
by Trieu Truong - Tuesday, 27 February 2018, 6:19 AM
 

[Update Feb-2018]

Recently I came across this discussion when trying to set up the Authoring Tool with MongoDB authentication enabled and was able to accomplish this.

Here are the steps I've done to install the AT 0.4.1 (FW 2.2.5) with MongoDB authentication enabled.

1/ MongoDB auth:

https://docs.mongodb.com/manual/tutorial/enable-authentication

2/ Create an admin user for 'system.users' from: mongo client

db.createUser({user: "adaptadmin", pwd: "abc123", roles: [ { role: "root", db: "admin" }]})

3/ Update Adapt's install.js to allow dbUser, dbPass and dbAuthSource
https://github.com/adaptlearning/adapt_authoring/pull/1822 

{
name: 'dbUser',
type: 'string',
description: 'Database server user',
pattern: installHelpers.inputHelpers.alphanumValidator,
default: ''
}, {
name: 'dbPass',
type: 'string',
description: 'Database server password',
pattern: installHelpers.inputHelpers.alphanumValidator,
default: ''
}, {
name: 'dbAuthSource',
type: 'string',
description: 'Database server authentication database',
pattern: installHelpers.inputHelpers.alphanumValidator,
default: 'admin'
}

Thanks to Johannes Baum for that commit.

4/ Start MongoDB with auth: "mongod --auth --dbpath ./data"

5/ Run "node install" as Adapts' wiki instructions

Hope it helps in some way.

Cheers