Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-83190

Misleading error message when trying to rename an encrypted collection

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None

      What problem are you facing?

      When trying to rename a encrypted collection using a user with readWriteAnyDatabase access, a misleading "MongoServerError: Cannot rename an encrypted collection IllegalOperation" is shown. Error disappears and renaming succeeds when the user has atlasAdmin role.

       

      Failed to overwrite the warehouse, reason: MongoServerError: Cannot rename an encrypted collection at CryptoConnection.onMessage (/app/node_modules/mongodb/lib/cmap/connection.js:202:26) at MessageStream.<anonymous> (/app/node_modules/mongodb/lib/cmap/connection.js:61:60) at MessageStream.emit (node:events:514:28) at processIncomingData (/app/node_modules/mongodb/lib/cmap/message_stream.js:124:16) at MessageStream._write (/app/node_modules/mongodb/lib/cmap/message_stream.js:33:9) at writeOrBuffer (node:internal/streams/writable:447:12) at _write (node:internal/streams/writable:389:10) at Writable.write (node:internal/streams/writable:393:10) at TLSSocket.ondata (node:internal/streams/readable:817:22) at TLSSocket.emit (node:events:514:28) {

      What driver and relevant dependency versions are you using?

       
      "mongodb": "^6.0.0",
      "mongodb-client-encryption": "^6.0.0",

      Steps to reproduce?

            Assignee:
            noopur.gupta@mongodb.com Noopur Gupta
            Reporter:
            edward.fu@terminal3.io Edward Fu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: