With MongoDB 2.6 the usersInfo command is used to determine if the addUser helper should call createUser or updateUser when passed a given username. Starting with MongoDB 2.7.0 the scope of the localhost exception for authentication was dramatically narrowed. It is no longer possible to call the userInfo command unauthenticated, even when the localhost exception is in effect. Any driver that calls usersInfo in its addUser helper can no longer be used to add the first admin user while the localhost exception is in effect:
A workaround for this issue is to catch the exception and call createUser if the error code is 13 (Unauthorized). Any exception from the createUser call should propagate to the user application.