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
Exception while polling query (QUERY): MongoError: connection (NUMBER) to (MONGODB) closed #9135
Comments
Are these normally long running queries @raphaelarias? Maybe your connection is timing out for some reason, before the query has completed? Or the connection is being reclaimed by the connection pool a bit early? You could try playing around with your Mongo connection settings a bit, using |
Awesome, I'll take a look on those. This queries are supposed to be very small, and they have indexes too.
I was trying to find the root of the problem, as when that happens my app keeps on "Loading" so my users don't have access. I discovered that, all the publications are working, but the flag on Meteor.isLoggingIn() never changes to true.
I'm deleting this validation on my Blaze layout, and ill test. Do you think could be something related?
…________________________________
From: Hugh Willson <notifications@github.com>
Sent: Tuesday, September 26, 2017 1:06 PM
To: meteor/meteor
Cc: Raphael Arias; Mention
Subject: Re: [meteor/meteor] Exception while polling query (QUERY): MongoError: connection (NUMBER) to (MONGODB) closed (#9135)
Are these normally long running queries @raphaelarias<https://github.com/raphaelarias>? Maybe your connection is timing out for some reason, before the query has completed? Or the connection is being reclaimed by the connection pool a bit early? You could try playing around with your Mongo connection settings<http://mongodb.github.io/node-mongodb-native/2.2/reference/connecting/connection-settings/> a bit, using Mongo.setConnectionOptions<https://github.com/meteor/meteor/blob/d93c021c896029d774ccecc7241ff20ec4045568/packages/mongo/connection_options.js#L7> (maybe try tweaking your poolSize, connectTimeoutMS, etc.).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#9135 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AExrJljeykPJTNJI1vLxmk2oXOjFL7__ks5smSAvgaJpZM4PkZ2W>.
|
I double checked. These queries are not long running, it usually happens when there is new primary elected (not always thought). Maybe MongoDB drops the connection (some) when electing a new primary or time out. Every publication and method still works. The only very weird thing that doesn't is the Meteor.logginIn(). Is there any way to simulate this exception in dev? |
@raphaelarias I seem to be experiencing the same issue with:
I have 3 meteor apps connected to the same replica set and when the replica set elects a new primary all 3 apps become partially unresponsive. That is, long running subscriptions don't show updates on the client and method calls that try to insert/update to the database seem to just hang. Strangely though only one of the 3 apps shows an error:
Restarting the galaxy containers disconnects clients and once the containers are restarted the clients reconnect and the long running subscriptions update again and incomplete method calls successfully complete. The apps continue to operate correctly until the replica set elects a new primary. Were you able to make any progress on this @raphaelarias? |
@maxfi What version of the |
@abernix you beat me to it! I just came across #8598 and was going to mention it here. The 3 apps of mine that were affected all depend on |
Awesome. I'll update the package (and Meteor) too and test it. It's worth mentioning that, I tried forcing an election, but the problem does not always happen (Since I opened the issue it never happened again). |
@abernix This may help: https://docs.mongodb.com/manual/tutorial/force-member-to-be-primary/ You can do via the shell. |
@raphaelarias Since the MongoDB Atlas service is designed to be fully managed and is responsible for all the cluster administration, Atlas users won't have access to cluster administration commands such as |
Is anyone here still encountering this issue with |
I just encountered this error:
I am using:
It is the first time I am seeing meteor crash on my digital ocean droplet, I recovered by restarting the server |
@hwillson ^^^ |
@schiefferstudios Is there more to that error message? Feel free to redact any sensitive information (like the selector or options), but keep in mind that the information after that is helpful, including the full stack trace on the lines after the error message! |
Hi, apologies for delayed response, I think I may have found what the issue was - looks like I may be running out of memory - see below
|
I am experiencing the same issue on Meteor 1.6.1 and as of the last comment, no memory issue and also no error on mongodb server.
|
Same here, on a very basic query, looking into a collection with only 105 records and 153kb of data:
I'm utterly puzzled as to what is causing this, but it probably has something to do with a write action as mentioned before. A single document in the collection is updated on a refresh of the page, and is broadcasted to who-ever listens at that time, but it is most of the time limited to less than 5 active connections. Version info: npm-mongo@3.0.7 Running on a Heroku node, connected to an mLab mongo instance. |
Years later, Meteor 2.0 with Atlas
|
The same problem, log from galaxy.meteor.com:
and further down the cycle... |
Same here. @paulincai @Sergeyamir were you able to fix it? |
Not fixed yet. I tried a little to distribute the calls to the database in time (put a delay between calls where there was a problem), and now it happens rarely, 0-1 times a month. It's not good enough, but I don't know how to fix it completely. |
I was in MongoDB Atlas' free shared cluster and moving to a dedicated cluster seems to have solved the issue. Maybe it's an Atlas thing. |
I've checked every issue and post in the Meteor forum, but It was not quite like this error.
Sometimes Meteor may try to query the DB but the connection is closed, so it will log an error:
meteor/packages/mongo/polling_observe_driver.js
Line 175 in d93c021
The app although the failed attempt keeps working (I can see login attempts in the log), my app keeps on 'Loading'.
I'm getting this almost every day, for some reason. The mongo connection string has the replicas sets too, and sometimes this occur when Mongo just elected a new primary.
Meteor version 1.5.
Ubuntu: Galaxy.
DB: Atlas
Would you have any idea what can it be, or how could I create a repo to simulate this part of the observe driver?
I think that even if Meteor is not crashing the software, something is stopping working.
PS: It stays "Loading" because the Meteor.loggingIn() does not change to false, even if the login has finished (it only happens after this error).
The text was updated successfully, but these errors were encountered: