MongoDB错误:不允许用户在[Admin。]上执行操作[ServerStatus]

发布于 2025-01-27 13:54:51 字数 961 浏览 3 评论 0原文

我的项目正在使用Nestjs。当我尝试从数据库中编写备份文件时,我遇到了这个错误。

VError: pack collection: 'collection name' failed:   
  user is not allowed to do action [serverStatus] on [admin.]
    at CatchSubscriber.selector (/usr/src/app/node_modules/mongodb-snapshot/src/connectors/filesystem/FileSystemDuplexConnector.ts:45:40)
    at CatchSubscriber.error (/usr/src/app/node_modules/mongodb-snapshot/node_modules/rxjs/src/internal/operators/catchError.ts:132:23)
    at /usr/src/app/node_modules/mongodb-snapshot/src/connectors/filesystem/FileSystemDuplexConnector.ts:267:26
    at Sink.<anonymous> (/usr/src/app/node_modules/tar-stream/pack.js:175:14)
    at Sink.f (/usr/src/app/node_modules/once/once.js:25:25)
    at Sink.onfinish (/usr/src/app/node_modules/end-of-stream/index.js:31:27)  
...  
MongoURI: mongodb+srv://username:password@cluster/databaseName?retryWrites=true&w=majority&authSource=admin

My project is using NestJS. I got this error when I tried to write a backup file from my database.

VError: pack collection: 'collection name' failed:   
  user is not allowed to do action [serverStatus] on [admin.]
    at CatchSubscriber.selector (/usr/src/app/node_modules/mongodb-snapshot/src/connectors/filesystem/FileSystemDuplexConnector.ts:45:40)
    at CatchSubscriber.error (/usr/src/app/node_modules/mongodb-snapshot/node_modules/rxjs/src/internal/operators/catchError.ts:132:23)
    at /usr/src/app/node_modules/mongodb-snapshot/src/connectors/filesystem/FileSystemDuplexConnector.ts:267:26
    at Sink.<anonymous> (/usr/src/app/node_modules/tar-stream/pack.js:175:14)
    at Sink.f (/usr/src/app/node_modules/once/once.js:25:25)
    at Sink.onfinish (/usr/src/app/node_modules/end-of-stream/index.js:31:27)  
...  
MongoURI: mongodb+srv://username:password@cluster/databaseName?retryWrites=true&w=majority&authSource=admin

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文