Skip to content

Cannot connect to MongoDb when connectTimeoutMS period is completed #1849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dtsymbal opened this issue May 20, 2016 · 4 comments
Closed

Cannot connect to MongoDb when connectTimeoutMS period is completed #1849

dtsymbal opened this issue May 20, 2016 · 4 comments

Comments

@dtsymbal
Copy link

Check out #1271 for an ideal bug report. The closer your issue report is to that one, the more likely we are to be able to help, and the more likely we will be to fix the issue quickly!

Many members of the community use Stack Overflow and Server Fault to ask questions. Read through the existing questions or ask your own!

For database migration help, please file a bug report at https://parse.com/help#report

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!

Environment Setup

  • Server: parse-server version: 2.2.10, operating system: ubuntu 14.04, local
  • Database: MongoDb 3.0.12

Steps to reproduce

  1. define Cloud function
    Parse.Cloud.define('test', function(request, response) { (new Parse.Query('_User')).select('username').limit(2).find().then( function(r) { return (new Parse.Query('_User')).select('username').skip(2).limit(2).find(); } ).then( function(r) { response.success(r); }, function(error) { response.error(error); } ); });
  2. run it
  3. wait 120 seconds (it's default value for "server.socketOptions.connectTimeoutMS" and "server.socketOptions.socketTimeoutMS" of "databaseOptions" value of ParseServer config.
  4. run function again. result is:
    curl: (52) Empty reply from server

I found that if the second query's limit is more than 1 in "test" cloud function, then auto-reconnection of database fails.

Logs/Trace

Here's log of mongod.log:

....
2016-05-20T17:12:05.280+0300 I NETWORK [conn369] end connection 127.0.0.1:54746 (0 connections now open)
2016-05-20T17:12:05.286+0300 I NETWORK [initandlisten] connection accepted from 127.0.0.1:54747 #370 (1 connection now open)
2016-05-20T17:14:09.197+0300 I NETWORK [conn370] end connection 127.0.0.1:54747 (0 connections now open)

and it's not starting again :(

@johndrewing
Copy link

I have same issue too, parse server stop return data from mongodb after some minutes.

@dcdspace
Copy link

Possibly related to this? #1854

@chris3000
Copy link

I'm having a similar issue, when testing the server under load. After the load test completes, the connection between Mongo and Parse will disconnect after a couple of minutes.

@drew-gross
Copy link
Contributor

I think this is a duplicate of #1854 and #1855. Pin your mongodb version to 2.1.18 and your problem should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants