[SERVER-5895] auth.js times out waiting for user authentication to replicate Created: 22/May/12  Updated: 11/Jul/16  Resolved: 22/May/12

Status: Closed
Project: Core Server
Component/s: Replication, Security
Affects Version/s: None
Fix Version/s: 2.1.2

Type: Bug Priority: Major - P3
Reporter: Ian Whalen (Inactive) Assignee: Greg Studer
Resolution: Done Votes: 0
Labels: buildbot
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-5876 user authentication should retry on p... Closed
Operating System: ALL
Participants:

 Description   

Tue May 22 02:45:51 uncaught exception: timed out while waiting for user authentication to replicate - database will not be fully secured until replication finishes

http://buildlogs.mongodb.org/build/4fbb160bd2a60f22cc000bb7/test/4fbb35e7d2a60f3e8e0003ff/



 Comments   
Comment by Blake Niemyjski [ 13/Mar/14 ]

I just had this same error happen to me on centos using 2.4.9

Comment by Spencer Brody (Inactive) [ 07/Feb/13 ]

aleksey@myinvisible.net, that is because addUser uses getLastError with "w":"majority" by default to verify the write propagated to a majority of secondaries, and master-slave replication doesn't support "w":"majority".

You can get around this by providing a number value to use for the "w" argument to getLastError. When calling addUser, the first argument is username, second is password, third is whether or not the user should be read-only, and fourth is how many servers to wait for the user to replicate to. If you explicitly provide a number value for how many slaves you want to wait for, you'll override the default of "majority" that always times out in 2.2.

Comment by Aleksey Mykhailov [ 05/Feb/13 ]

getting the same error message on the master-slave installation

db version v2.2.3, pdfile version 4.5
git version: f570771a5d8a3846eb7586eaffcf4c2f4a96bf08

> db.addUser('test','test')
{
"user" : "test",
"readOnly" : false,
"pwd" : "a6de521abefc2fed4f5876855a3484f5",
"_id" : ObjectId("51117ef299297860eeef91f1")
}

Tue Feb 5 13:52:16 uncaught exception: timed out while waiting for user authentication to replicate - database will not be fully secured until replication finishes

Comment by Greg Studer [ 22/May/12 ]

Think this should fix - but there may be other places the same problem manifests.

Comment by auto [ 22/May/12 ]

Author:

{u'login': u'gregstuder', u'name': u'Greg Studer', u'email': u'greg@10gen.com'}

Message: wait for secondary status before addUser so we're more sure the change propagates SERVER-5895
Branch: master
https://github.com/mongodb/mongo/commit/e2a664776ef3ff6f128fa03f639dfd3e83f62f5d

Generated at Thu Feb 08 03:10:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.