first of all I'm a noob at Geddy so the answer might be something stupid I forgot, but I keep getting an error while using Geddy auth and MongoDB at the same time; Here's what I did:
geddy app myapp
Then I configured config/development.js to use MongoDB:
var config = {
detailedErrors: true
, debug: true
, hostname: null
, port: 4000
, model: {
defaultAdapter: 'mongo'
}
, db: {
mongo: {
dbname: 'myappdb'
}
}
, sessions: {
store: 'memory'
, key: 'sid'
, expiry: 14 * 24 * 60 * 60
}
};
module.exports = config;
Finally I installed geddy auth and launched the app:
geddy auth
geddy
When I navigate to localhost:4000/ everything seems to work fine at first, but if I refresh the page or try to create a new user, I get a beautiful Error: 500
Error: 500 Internal Server Error
Error: db object already connecting, open cannot be called multiple times
at Db.open (/usr/lib/node_modules/geddy/node_modules/model/node_modules/mongodb-wrapper/node_modules/mongodb/lib/mongodb/db.js:240:11)
at open (/usr/lib/node_modules/geddy/node_modules/model/node_modules/mongodb-wrapper/lib/mongodb-wrapper.js:625:20)
at self.connection (/usr/lib/node_modules/geddy/node_modules/model/node_modules/mongodb-wrapper/lib/mongodb-wrapper.js:618:9)
at connection (/usr/lib/node_modules/geddy/node_modules/model/node_modules/mongodb-wrapper/lib/mongodb-wrapper.js:190:18)
at /usr/lib/node_modules/geddy/node_modules/model/node_modules/mongodb-wrapper/lib/mongodb-wrapper.js:433:13
at cursor (/usr/lib/node_modules/geddy/node_modules/model/node_modules/mongodb-wrapper/lib/mongodb-wrapper.js:158:9)
at self.toArray (/usr/lib/node_modules/geddy/node_modules/model/node_modules/mongodb-wrapper/lib/mongodb-wrapper.js:135:16)
at utils.mixin.load (/usr/lib/node_modules/geddy/node_modules/model/lib/adapters/mongo/index.js:194:14)
at Object.obj.all (/usr/lib/node_modules/geddy/node_modules/model/lib/index.js:501:25)
at Function.obj.first (/usr/lib/node_modules/geddy/node_modules/model/lib/index.js:459:18)
I tried to update geddy using npm and to reinstall the mongo-adapter package but nothing's changed, I'm starting to get really frustrated as I can't find a solution and know it's probably just something simple I'm missing out. Any idea of what is wrong ?
Thanks in advance for the help !
I think that you don't have MongoDB running... To run your Geddy App you need both things, mongodb and geddy server running.
First of all, start your mongo server:
$ mongod
And later launch geddy on your root app directory
$ geddy
Hope that helps