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

Slave replication failure replHandshake unauthorized

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.4.3
    • Component/s: Replication, Security
    • Labels:
      None
    • ALL

      I previously have a database in Mongo 1.8 that was running master/slave replication.

      The data store has three databases: local, admin, and appdb

      I upgraded directly to Mongo 2.4.3, and I am starting to get sporadic master/slave replication failure. Specifically, I am seeing on the slaves:

      Sat Jun 1 14:48:29.702 [replslave] Socket recv() timeout 127.0.0.1:37017
      Sat Jun 1 14:48:29.703 [replslave] SocketException: remote: 127.0.0.1:37017 error: 9001 socket exception [3] server [127.0.0.1:37017]
      Sat Jun 1 14:48:29.703 [replslave] DBClientCursor::init call() failed
      Sat Jun 1 14:48:29.703 [replslave] repl: dbclient::query returns null (conn closed?)
      Sat Jun 1 14:48:29.704 [replslave] repl: sleep 3 sec before next pass
      Sat Jun 1 14:48:32.710 [replslave] repl: syncing from host:localhost:37017
      Sat Jun 1 14:48:33.080 [replslave] replHandshake res not: 0 res:

      { ok: 0.0, errmsg: "unauthorized" }

      And on the master:

      Sat Jun 01 09:49:39.024 [conn1767] authenticate db: local

      { authenticate: 1, nonce: "XXXXXXXXXX", user: "repl", key: "XXXXXXXXX" }

      Sat Jun 01 09:49:39.118 [conn1767] command denied:

      { handshake: ObjectId('XXXXXXXX-changes every time it outputs') }

      The error is not always present. I have three slave instances. One is replicating fine with no error messages. The other two would start replication, but at some point encounter the "unauthorized" errmsg.

      I tried deleting and re-creating the slave database, including adding the "repl" user to the local database. That works for a while, then the error comes up again.

      I tried changing the "repl" user on the master local database, including removing the old "readOnly" field and adding in roles ['read', 'readWrite', 'dbAdmin'], but it still doesn't work.

            Assignee:
            spencer@mongodb.com Spencer Brody (Inactive)
            Reporter:
            ckpeter Peter Chan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: