Any idea why I am not able to connect to the mongo database? I just installed it on a new debian following this https://linuxize.com/post/how-to-install-mongodb-on-debian-9/.

Mongo startup logs: https://hastebin.com/iyelaxasec.md

I issued mongo and get:

baseUser@vmd54274:~$ mongo
MongoDB shell version v4.0.19
connecting to: mongodb://
2020-06-17T01:53:05.338+0200 E QUERY    [js] Error: couldn't connect to server, connection attempt failed: SocketException: Error connecting to :: caused by :: Connection timed out :
exception: connect failed

I didnt change any setting so everything should be running on the correct port. And I checked that the port is used by the service.

This is from lsof:

mongod     8898   mongodb   11u  IPv4 2530915      0t0  TCP (LISTEN)
  • Add the output of cat /var/log/mongodb/mongod.log to your question. Jun 17 '20 at 0:47
  • @NasirRiley I already did. Thats the hastebin link
    – Gerolmed
    Jun 17 '20 at 10:59
  • Add them while you are trying to connect. Do not post images of text. Use the codeblocks to put them into your question. Jun 17 '20 at 11:02

I managed to find the issue myself. Appearently there was a flaw in my firewall configuration preventing access from localhost to mongodb

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.