parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Cannot connect to MongoDb when connectTimeoutMS period is completed

Open dtsymbal opened this issue 10 years ago • 4 comments

Check out https://github.com/ParsePlatform/parse-server/issues/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!

  • Stack Overflow: http://stackoverflow.com/questions/tagged/parse.com
  • Server Fault: https://serverfault.com/tags/parse

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!

  • [ x] You've met the prerequisites: https://github.com/ParsePlatform/parse-server/wiki/Parse-Server-Guide#prerequisites.
  • [ x] You're running the latest version of Parse Server: https://github.com/ParsePlatform/parse-server/releases
  • [ x] You've searched through existing issues: https://github.com/ParsePlatform/Parse-Server/issues?utf8=%E2%9C%93&q=is%3Aissue Chances are that your issue has been reported or resolved before.

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 :(

dtsymbal avatar May 20 '16 14:05 dtsymbal

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

johndrewing avatar May 20 '16 19:05 johndrewing

Possibly related to this? https://github.com/ParsePlatform/parse-server/issues/1854

dcdspace avatar May 20 '16 20:05 dcdspace

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.

chris3000 avatar May 20 '16 22:05 chris3000

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

drew-gross avatar May 23 '16 18:05 drew-gross