Skip to content
Browse files

SERVER-12133 Improve error message when a 2.6 schema user doc is pres…

…ent during the authSchemaUpgrade
  • Loading branch information...
1 parent 3a7950f commit 2399d0d6b32a941e4f2c6435d284227bd0df044a @stbrody stbrody committed Feb 5, 2014
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/mongo/client/auth_helpers.cpp
View
10 src/mongo/client/auth_helpers.cpp
@@ -76,6 +76,16 @@ namespace auth {
const BSONObj& oldUserDoc,
BSONObj* query,
BSONObj* update) {
+ uassert(17387,
+ mongoutils::str::stream() << "While preparing to upgrade user doc from the 2.4 "
+ "user data schema to the 2.6 schema, found a user doc with a "
+ "\"credentials\" field, indicating that the doc already has the new "
+ "schema. Make sure that all documents in admin.system.users have the same "
+ "user data schema and that the version document in admin.system.version "
+ "indicates the correct schema version. User doc found: " <<
+ oldUserDoc.toString(),
+ !oldUserDoc.hasField("credentials"));
+
std::string oldUserSource;
uassertStatusOK(bsonExtractStringFieldWithDefault(
oldUserDoc,

0 comments on commit 2399d0d

Please sign in to comment.
Something went wrong with that request. Please try again.