Kaixhin / FGLab

Future Gadget Laboratory
https://kaixhin.github.io/FGLab/
MIT License
223 stars 34 forks source link

how to specify mongodb instance, error starting FGLab #27

Open kirk86 opened 5 years ago

kirk86 commented 5 years ago

Hi and thanks for FGLab, I was wondering how exactly to start FGLab? I've followed the steps of installation but when I try to start the lab I get the following errors:

> FGLab@0.7.6 start /home/user/FGLab
> node lab.js

Error: No MongoDB instance specified
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! FGLab@0.7.6 start: `node lab.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the FGLab@0.7.6 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2019-02-13T19_29_46_962Z-debug.log

Also how do you specify if your db is in a different directory than the working one?

Kaixhin commented 5 years ago

Is the MongoDB daemon running and is MONGODB_URI set correctly? For example, can you use the URI to connect to it via another application like Robo 3T?

For a different db path just use an absolute path: mongod --dbpath <absolute path>.

kirk86 commented 5 years ago

Yeah mongo is running perfectly fine I can even connect to it using omniboard. What is the correct format for MONGODB_URI? isn't that usually localhost:27017:dbname?

Kaixhin commented 5 years ago

By default it is of the form mongodb://localhost:27017/dbname, as seen in example.env.

kirk86 commented 5 years ago

Ok so the this mongodb://localhost:27017/dbname apparently is not working. In mongo there was no db with the name FGLab but then even when I created one and started FGLab again still I was getting the above error of no mongodb instance. Even when I specified a different pre-existing db name still I was getting the error.

Could it be that my --dbpath is not in the same directory as FGLab?

Kaixhin commented 5 years ago

I don't think the database path needs to be in the same directory, but just to make sure that under your setup this isn't the issue, would you be able to create a new database inside and see if this changes anything?