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:


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

2015-07-23T18:02:42.741+0100 [conn699] end connection (2 connections now open)
2015-07-23T18:02:43.610+0100 [conn689] end connection (1 connection now open)
2015-07-23T18:02:43.611+0100 [initandlisten] connection accepted from #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 #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

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

Leave a Reply

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