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 was destroyed #4

Open
nshaikhinurov opened this issue Mar 1, 2019 · 3 comments
Open

MongoError: topology was destroyed #4

nshaikhinurov opened this issue Mar 1, 2019 · 3 comments

Comments

@nshaikhinurov
Copy link

When running test-schema script on branch lesson-2-solution with installed dependencies and mongod running in a terminal I have this error:
Jest's output:
Product schema › lesson-2: › Product has base fields

MongoError: topology was destroyed

  at createIndex (node_modules/mongodb/lib/operations/db_ops.js:289:21)
  at indexInformation (node_modules/mongodb/lib/operations/db_ops.js:424:7)
  at db.collection.listIndexes.toArray (node_modules/mongodb/lib/operations/db_ops.js:579:23)
  at err (node_modules/mongodb/lib/utils.js:415:14)
  at executeCallback (node_modules/mongodb/lib/utils.js:404:25)
  at handleCallback (node_modules/mongodb/lib/utils.js:128:55)
  at cursor._endSession.cursor._endSession (node_modules/mongodb/lib/operations/cursor_ops.js:220:38)
  at ClientSession.endSession (node_modules/mongodb-core/lib/sessions.js:113:43)
  at CommandCursor.Object.<anonymous>.Cursor._endSession (node_modules/mongodb-core/lib/cursor.js:190:13)
  at CommandCursor.Object.<anonymous>.Cursor._endSession (node_modules/mongodb/lib/cursor.js:226:59)
  at cursor._next (node_modules/mongodb/lib/operations/cursor_ops.js:220:20)
  at queryCallback (node_modules/mongodb-core/lib/cursor.js:660:23)
  at node_modules/mongodb-core/lib/connection/pool.js:532:18

$ mongod --version
db version v4.0.5
git version: 3739429dd92b92d1b0ab120911a23d50bf03c412
allocator: tcmalloc
modules: none
build environment:
distmod: 2008plus-ssl
distarch: x86_64
target_arch: x86_64

What could be the suggestion for resolving this issue?

@shindeajinkya
Copy link

Replacing localhost to 127.0.0.1 in config folder to dev and testing file worked for me

@MrSamsa42
Copy link

To be clear, change the dbUrl in dev.js to:
'mongodb://127.0.0.1:27017/api-design'

and change dbUrl in testing.js to:
'mongodb://127.0.0.1:27017/introgql-test'

@sharazghouri
Copy link

Replacing localhost to 127.0.0.1 in config folder to dev and testing file worked for me

Its work for me.

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

4 participants