Search code examples
javascriptmongodbsails.jssails-mongodedicated-server

Unreachable MongoDB after few minutes running Sails.js App on my server


I want to create an API service for a project. I'm creating this service with Sails.js. I pushed this Sails app on my dedicated server running with pm2.

My problem is that each 2 minutes I can't access to the data of my MongoDB database, running on my server. When I check the log I can see the connection open and 2 minutes later the logs say that the connection is ending.

enter image description here

And when I restart the app the service is working for a few times.

Anyone have an idea to resolve this problem ?

Thank you,

ADR.


Solution

  • This is related to a known issues with connection time out. Here are the relevant links and fixes.

    https://github.com/balderdashy/sails-mongo/issues/275#issuecomment-101288312 https://github.com/balderdashy/sails-mongo/pull/277