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

cant authenticate #30

Open
amouratoglou opened this issue Oct 27, 2022 · 1 comment
Open

cant authenticate #30

amouratoglou opened this issue Oct 27, 2022 · 1 comment

Comments

@amouratoglou
Copy link

hi! looks promising but was not able to make the connection authenticate:

extract-mongo-schema -d "mongodb://root:rootpassword@localhost:27020/socialTemplates-test?authSource=admin" -o schema.json

returns:


{
  authSource: undefined,
  collectionList: null,
  arrayList: null,
  raw: false,
  limit: 100,
  dontFollowFK: { __ANY__: {} },
  includeSystem: false
}
/Users/agustin/.nvm/versions/node/v16.14.2/lib/node_modules/extract-mongo-schema/node_modules/mongodb/lib/utils.js:698
          throw error;
          ^

MongoError: Authentication failed.
    at MessageStream.messageHandler (/Users/agustin/.nvm/versions/node/v16.14.2/lib/node_modules/extract-mongo-schema/node_modules/mongodb/lib/cmap/connection.js:299:20)
    at MessageStream.emit (node:events:526:28)
    at processIncomingData (/Users/agustin/.nvm/versions/node/v16.14.2/lib/node_modules/extract-mongo-schema/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
    at MessageStream._write (/Users/agustin/.nvm/versions/node/v16.14.2/lib/node_modules/extract-mongo-schema/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
    at writeOrBuffer (node:internal/streams/writable:389:12)
    at _write (node:internal/streams/writable:330:10)
    at MessageStream.Writable.write (node:internal/streams/writable:334:10)
    at Socket.ondata (node:internal/streams/readable:754:22)
    at Socket.emit (node:events:526:28)
    at addChunk (node:internal/streams/readable:315:12) {
  ok: 0,
  code: 18,
  codeName: 'AuthenticationFailed'
}

I can connect using mongosh using the same connection string..same with. my app and other mongodb GUI apps.

thanks!

@MrMohebi
Copy link

MrMohebi commented Nov 2, 2022

use this switch

-u, --authSource Database for authentication. Example: "admin".

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

2 participants