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

MongoError: Topology closed #70

Closed
Ased2235 opened this issue Jun 7, 2021 · 8 comments
Closed

MongoError: Topology closed #70

Ased2235 opened this issue Jun 7, 2021 · 8 comments

Comments

@Ased2235
Copy link

Ased2235 commented Jun 7, 2021

Hello, when i run npm start it's showing this error

npm start

spruce@4.0.0 start
node update.js; node ./bin/www

Developer key: pxdo2rqHVVw1DMEHeYwXyE9nKwH5b3SxzB5pMVUs
Verify your account in /me with this key

spruce is listening on http://localhost:8000

home/senpai/code/spruce/node_modules/mongodb/lib/core/sdam/topology.js:325
drainWaitQueue(this[kWaitQueue], new MongoError('Topology closed'));
^

MongoError: Topology closed
at NativeTopology.close (/home/senpai/code/spruce/node_modules/mongodb/lib/core/sdam/topology.js:325:38)
at /home/senpai/code/spruce/node_modules/mongodb/lib/mongo_client.js:267:21
at maybePromise (/home/senpai/code/spruce/node_modules/mongodb/lib/utils.js:719:3)
at MongoClient.close (/home/senpai/code/spruce/node_modules/mongodb/lib/mongo_client.js:248:10)
at /home/senpai/code/spruce/node_modules/mongoose/lib/connection.js:711:20
at new Promise ()
at NativeConnection.Connection.openUri (/home/senpai/code/spruce/node_modules/mongoose/lib/connection.js:709:19)
at Mongoose.connect (/home/senpai/code/spruce/node_modules/mongoose/lib/index.js:335:15)
at Object. (/home/senpai/code/spruce/utils/models/keys.js:6:10)`
npm ERR! A complete log of this run can be found in:
npm ERR! /home/senpai/.npm/_logs/2021-06-07T13_48_06_101Z-debug.log

can anyone help me?
Thanks!

@dan-online
Copy link
Member

Hi @Ased2235, is this the same mongo version as listed on the github repo's package.json or did you install a later version?

@Ased2235
Copy link
Author

Ased2235 commented Jun 8, 2021

Hi @Ased2235, is this the same mongo version as listed on the github repo's package.json or did you install a later version?

Same as github repo's package.json

@dan-online
Copy link
Member

The error says that the server connection was closed, so you need to reopen the connection. Perhaps the connection disconnected or was closed somewhere?

@Ased2235
Copy link
Author

The error says that the server connection was closed, so you need to reopen the connection. Perhaps the connection disconnected or was closed somewhere?

But it's not closed as i have one more active connection to ping the server.

@dan-online
Copy link
Member

Hmm, the error reports that the database connection is closed are you sure you don't close the connection somewhere?

@Ased2235
Copy link
Author

Hmm, the error reports that the database connection is closed are you sure you don't close the connection somewhere?

No, it's active I already tested it but only here it shows close error. I don't know why it is doing this.

@god-s-perfect-idiot
Copy link

Im getting the same error. Please lmk if this was fixed

@god-s-perfect-idiot
Copy link

For those of you running in to this error, the problem is indeed multiple parallel instances of Mongo being open. Save those connect calls to a separate script and import that.

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

3 participants