Sitecore Mongo arbiter shows failed authentication attempts.

I setup a Mongo arbiter instance alongside two full instances for use with Sitecore 8 xDB database. Shortly afterwards I noticed the arbiter log was full of authentication failures. This isn’t a big huge problem, but it fills up the arbiter log and may cause concern wondering if there’s an underlying configuration problem.

This isn’t a Sitecore problem but a Mongo c-sharp driver issue that relates to recent versions. This is also specific the arbiter, the real Mongo instances authenticate just fine using a replica-set shared key. Also, this only occurs when the web application it actually running. Stop the app, and the authentication errors stop too.

My xDB connection strings looks like this:

connectionString="mongodb://webapp:password@mongotest1:27018,mongotest2.local:27019/sc8-tracking-history?replicaSet=repSet1&authSource=admin

Arbiter log looks like this, the last error looping over and over.

2015-07-23T18:02:42.741+0100 [conn699] end connection 127.0.0.1:62206 (2 connections now open)
2015-07-23T18:02:43.610+0100 [conn689] end connection 127.0.0.1:62193 (1 connection now open)
2015-07-23T18:02:43.611+0100 [initandlisten] connection accepted from 127.0.0.1:62207 #700 (3 connections now open)
2015-07-23T18:02:43.613+0100 [conn700] authenticate db: local { authenticate: 1, nonce: "xxx", user: "__system", key: "xxx" }
2015-07-23T18:02:43.890+0100 [initandlisten] connection accepted from 127.0.0.1:62208 #701 (3 connections now open)
2015-07-23T18:02:43.891+0100 [conn701] authenticate db: admin { authenticate: 1, user: "webapp", nonce: "xxx", key: "xxx" }
2015-07-23T18:02:43.891+0100 [conn701] Failed to authenticate webapp@admin with mechanism MONGODB-CR: AuthenticationFailed UserNotFound Could not find
user webapp@admin

Early Sitecore 8 releases were aimed at Mongo v2.6.5.  The MongoDB.Driver.dll shipped was v1.8.3.9, which puts it just before this known issue with the c-sharp driver was resolved by v1.9.0.200

If you want to get rid of this error, you can upgrade Sitecore to update 5 which moves support up to Mongo v3 and accordingly ships with a fixed v1.10 of the c-sharp driver. Alternatively if you want the least disruption in-situ fix, download the v1.9 c-sharp driver and add an assembly redirect to web.config

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MongoDB.Bson" publicKeyToken="f686731cfb9cc103" />
<bindingRedirect oldVersion="0.0.0.0-1.9.0.200" newVersion="1.9.0.200" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="MongoDB.Driver" publicKeyToken="f686731cfb9cc103" />
<bindingRedirect oldVersion="0.0.0.0-1.9.0.200" newVersion="1.9.0.200" />
</dependentAssembly>
</runtime>

Leave a Reply

Your email address will not be published. Required fields are marked *