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

Fix permission errors when running getMongoData.js against Atlas, allow to ignore errors #136

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

bartpolot
Copy link

  • Running against Atlas creates permission errors with the local db
  • The error message is lost since the throw uses a string and the catch tries to access an Error objects
  • Imitators like DocumentDB fail some of the initial commands but deliver useful index and sizing results, allow to ignore those first errors.

…le (or [backup, clusterMonitor, readAnyDatabase]) it fails on Atlas clusters with:

MongoServerError: not authorized on local to execute command { aggregate: "replset.minvalid", pipeline: [ { $indexStats: {} }, { $group: { _id: "$key", stats: { $push: { accesses: "$accesses.ops", host: "$host", since: "$accesses.since" } } } }, { $project: { key: "$_id", stats: 1, _id: 0 } } ], cursor: {}, apiVersion: "1", lsid: { id: UUID(<UUID>) }, $clusterTime: { clusterTime: Timestamp(1724256067, 1), signature: { hash: BinData(0, <HEX>), keyId: <NUM> } }, $db: "local" }
…ol to run on MongoDB imitators.

For instance on DocumentDB this results in:
MongoServerError: Feature not supported: getCmdLineOpts
MongoServerError: Feature not supported: getParameter
MongoServerError: local db creation is not supported
MongoServerError: Field 'type' is currently not supported
MongoServerError: Profiler (slow query logger) is supported via log exports to Amazon CloudWatch. For more information: https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html
@zhangyaoxing
Copy link
Collaborator

zhangyaoxing commented Sep 24, 2024

The latest change already skipped the local/admin/config database for getting indexes. Other commits look good.

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

Successfully merging this pull request may close these issues.

2 participants