FGLab icon indicating copy to clipboard operation
FGLab copied to clipboard

how to specify mongodb instance, error starting FGLab

Open kirk86 opened this issue 6 years ago • 5 comments

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:

> [email protected] start /home/user/FGLab
> node lab.js

Error: No MongoDB instance specified
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node lab.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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?

kirk86 avatar Feb 13 '19 19:02 kirk86

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>.

Kaixhin avatar Feb 13 '19 23:02 Kaixhin

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?

kirk86 avatar Feb 13 '19 23:02 kirk86

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

Kaixhin avatar Feb 13 '19 23:02 Kaixhin

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?

kirk86 avatar Feb 14 '19 00:02 kirk86

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?

Kaixhin avatar Feb 14 '19 09:02 Kaixhin