0

I am working on nodejs application with mongodb. It was working fine but after the server restart and some config change, my mongodb is not working.

I reverted the nodejs changes back to original but still facing the same issue.

I tried following

MongoDB shell version: 3.2.17
connecting to: test
> show dbs
Warning  0.000GB
local    0.000GB
> db
test
> use profit
switched to db profit
> db
profit
> show collections
> show dbs
Warning  0.000GB
local    0.000GB

but all dbs and it's collection are not showing up.I have restarted mongodb services as well.Can anyone please help.

Thanks, J

Jitesh
  • 395
  • 2
  • 5
  • 18
  • My money says "some config change" is you are now starting with a different `--dbpath` setting. Check for where you had you're data before and correct it. Or "as a developer" this really should not matter to you and you should simply be able to start over. – Neil Lunn May 10 '18 at 20:55
  • I did not touch any config at mongo side..config file still pointing to same /data/db folder..all changes were done in node's app.js file..I am not sure but restarting mongodb did something and I have to figure out that.. – Jitesh May 10 '18 at 20:58
  • 1
    What was the content of the `Warning` database? Do you have auth turned on? Is your database open to the internet without firewall or IP whitelisting? – kevinadi May 10 '18 at 22:49
  • @KevinAdistambha I too believe it's an attack which has exploited the lack of auth being enabled and probably a bindIP on all interfaces. This comes up every now and then, but there is little more to say about it ultimately than you "should" have authentication enabled and backup data. And of course as a "site for programming questions" a **developer** simply has no need to care beyond that. If anyone is asking about their "production system" on this site, then they're in the wrong place. – Neil Lunn May 11 '18 at 02:12
  • @Kevin I didn't had any DB with name warning. I had DB with name profit which is not showing up in list.That is the problem. – Jitesh May 11 '18 at 05:45
  • I had backup so I restored the DB. Can you please guide me to setup auth for mongodb...Any link etc to start?... Thanks – Jitesh May 11 '18 at 11:22

0 Answers0