Unable to find source-code formatter for language: 48,name: namespaceexists. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
When renaming a collection to a target that already exists (without specifying dropTarget) renameCollection will fail with the following:
- errmsg: "target namespace exists"
- code: 48
- codeName: "NamespaceExists"
This corresponds to a documented error code: NamespaceExists(48) (message: "target namespace exists").
On mongos, the command responds is more cryptic:
- errmsg: "Target collection %s exists but dropTarget is not set"
- code: 5807601
- codeName: "Location5807601"
This error code originates from checkShardedRenamePreconditions.
Is it intentional for these errors to be inconsistent?
Note: This was tested on 5.0.x, but I presume the inconsistency goes back to older server versions.
- related to
-
SERVER-65802 mongos returns inconsistent error code when renameCollection target already exists
- Closed