Skip to content
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

server crash with the problem of no primary server available #1057

Closed
3 tasks done
mahabubakram opened this issue Mar 16, 2016 · 4 comments
Closed
3 tasks done

server crash with the problem of no primary server available #1057

mahabubakram opened this issue Mar 16, 2016 · 4 comments
Labels
type:question Support or code-level question

Comments

@mahabubakram
Copy link

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

Environment Setup

1- heroku as parse server
2. mongolab as database

Steps to reproduce

automatically it gives the error and server get stopped. We had not this problem before 2.1.5 version

Logs/Trace

2016-03-16T12:59:01.702788+00:00 heroku[router]: at=info method=POST path="/parse/classes/PublicCombinations" host=combyne-parse-server-staging.herokuapp.com request_id=df76331e-c0bc-44d7-a85c-27b82fa3fa06 fwd="54.216.75.217" dyno=web.1 connect=0ms service=288ms status=500 bytes=551
2016-03-16T12:59:01.694481+00:00 app[web.1]: Uncaught internal server error. { [MongoError: no primary server available] name: 'MongoError', message: 'no primary server available' } MongoError: no primary server available
2016-03-16T12:59:01.694522+00:00 app[web.1]:     at pickServer (/app/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/replset.js:953:13)
2016-03-16T12:59:01.694523+00:00 app[web.1]:     at ReplSet.getServer (/app/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/replset.js:345:10)
2016-03-16T12:59:01.694525+00:00 app[web.1]:     at Cursor.next [as _next] (/app/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:655:3)
2016-03-16T12:59:01.694524+00:00 app[web.1]:     at nextFunction (/app/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:513:35)
2016-03-16T12:59:01.694526+00:00 app[web.1]:     at fetchDocs (/app/node_modules/parse-server/node_modules/mongodb/lib/cursor.js:843:10)
2016-03-16T12:59:01.694528+00:00 app[web.1]:     at /app/node_modules/parse-server/node_modules/mongodb/lib/cursor.js:827:5
2016-03-16T12:59:01.694529+00:00 app[web.1]:     at new Promise (/app/node_modules/parse-server/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:193:7)
2016-03-16T12:59:01.694531+00:00 app[web.1]:     at MongoCollection._rawFind (/app/node_modules/parse-server/lib/Adapters/Storage/Mongo/MongoCollection.js:69:90)
2016-03-16T12:59:01.694530+00:00 app[web.1]:     at Cursor.toArray (/app/node_modules/parse-server/node_modules/mongodb/lib/cursor.js:826:10)
2016-03-16T12:59:01.742048+00:00 app[web.1]:     at pickServer (/app/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/replset.js:953:13)
2016-03-16T12:59:01.742049+00:00 app[web.1]:     at ReplSet.getServer (/app/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/replset.js:345:10)
2016-03-16T12:59:01.694527+00:00 app[web.1]:     at toArray (/app/node_modules/parse-server/node_modules/mongodb/lib/cursor.js:870:3)
2016-03-16T12:59:01.742023+00:00 app[web.1]: Uncaught internal server error. { [MongoError: no primary server available] name: 'MongoError', message: 'no primary server available' } MongoError: no primary server available
2016-03-16T12:59:01.742050+00:00 app[web.1]:     at nextFunction (/app/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:513:35)
2016-03-16T12:59:01.742051+00:00 app[web.1]:     at fetchDocs (/app/node_modules/parse-server/node_modules/mongodb/lib/cursor.js:843:10)
2016-03-16T12:59:01.742050+00:00 app[web.1]:     at Cursor.next [as _next] (/app/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:655:3)
2016-03-16T12:59:01.742053+00:00 app[web.1]:     at /app/node_modules/parse-server/node_modules/mongodb/lib/cursor.js:827:5
2016-03-16T12:59:01.742056+00:00 app[web.1]:     at MongoCollection._rawFind (/app/node_modules/parse-server/lib/Adapters/Storage/Mongo/MongoCollection.js:69:90)
2016-03-16T12:59:01.742052+00:00 app[web.1]:     at toArray (/app/node_modules/parse-server/node_modules/mongodb/lib/cursor.js:870:3)
2016-03-16T12:59:01.742054+00:00 app[web.1]:     at new Promise (/app/node_modules/parse-server/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:193:7)
2016-03-16T12:59:01.742055+00:00 app[web.1]:     at Cursor.toArray (/app/node_modules/parse-server/node_modules/mongodb/lib/cursor.js:826:10)
2016-03-16T12:59:03.504828+00:00 heroku[router]: at=info method=POST path="/parse/classes/PublicCombinations" host=combyne-parse-server-staging.herokuapp.com request_id=d083b4f4-689f-42a3-8230-3eefaf9bf618 fwd="54.216.75.217" dyno=web.1 connect=1ms service=1603ms status=500 bytes=551
2016-03-16T12:59:03.500781+00:00 app[web.1]: Uncaught internal server error. { [MongoError: no primary server available] name: 'MongoError', message: 'no primary server available' } MongoError: no primary server available
2016-03-16T12:59:03.500821+00:00 app[web.1]:     at pickServer (/app/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/replset.js:953:13)
2016-03-16T12:59:03.500822+00:00 app[web.1]:     at ReplSet.getServer (/app/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/replset.js:345:10)
2016-03-16T12:59:03.500823+00:00 app[web.1]:     at nextFunction (/app/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:513:35)
2016-03-16T12:59:03.500824+00:00 app[web.1]:     at Cursor.next [as _next] (/app/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:655:3)
2016-03-16T12:59:03.500825+00:00 app[web.1]:     at fetchDocs (/app/node_modules/parse-server/node_modules/mongodb/lib/cursor.js:843:10)
2016-03-16T12:59:03.500825+00:00 app[web.1]:     at toArray (/app/node_modules/parse-server/node_modules/mongodb/lib/cursor.js:870:3)
2016-03-16T12:59:03.500826+00:00 app[web.1]:     at /app/node_modules/parse-server/node_modules/mongodb/lib/cursor.js:827:5
2016-03-16T12:59:03.500827+00:00 app[web.1]:     at new Promise (/app/node_modules/parse-server/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:193:7)
2016-03-16T12:59:03.500829+00:00 app[web.1]:     at MongoCollection._rawFind (/app/node_modules/parse-server/lib/Adapters/Storage/Mongo/MongoCollection.js:69:90)
2016-03-16T12:59:03.500828+00:00 app[web.1]:     at Cursor.toArray (/app/node_modules/parse-server/node_modules/mongodb/lib/cursor.js:826:10)
2016-03-16T12:59:05.463629+00:00 heroku[router]: at=info method=POST path="/parse/classes/PublicCombinations" host=combyne-parse-server-staging.herokuapp.com request_id=016b169b-3e90-4217-a85f-eedc93179394 fwd="54.216.75.217" dyno=web.1 connect=1ms service=1488ms status=200 bytes=497900

when we check the server log. This error log shows and server get crashed/stopped. Then we need to restart the server. But this problem did not occur before. Right now we have the same setup like old. We just upgraded the parse server version to latest and suddenly this problem occurs.

How to solve this issue.

@gfosco
Copy link
Contributor

gfosco commented Mar 16, 2016

What does your mongo connection string look like?

@tobernguyen
Copy link
Contributor

I also experiencing this today, I use mLab with one replica set. My connection bumps up to over 4000 connection in 10 minutes, I have to restart the server to make the number of connections back to around 100.

This issue may relate to this: Automattic/mongoose#3634

@tobernguyen
Copy link
Contributor

My mongo connection string look like this:
mongodb://USER_NAME:PASSWORD@CLUSTER_1_ADDRESS:CLUSTER_1_PORT,CLUSTER_2_ADDRESS:CLUSTER_2_PORT/COLLECTION_NAME?replicaSet=xxxxxx

After researching for awhile, I tried to change the connection to only primary cluster like this:
mongodb://USER_NAME:PASSWORD@CLUSTER_1_ADDRESS:CLUSTER_1_PORT/COLLECTION_NAME

So far so good, the number of connection is now stable at around 80 for more than 6 hours.
@mahabubakram you can give a try and let us know does it work.

@drew-gross
Copy link
Contributor

No response in many days, closing.

@mtrezza mtrezza added type:question Support or code-level question and removed 🔧 troubleshooting labels Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

6 participants