I have been getting the error below since following this Azure DocumentDB guide which causes the analytics and other xDB functionally not to work (an example being Experience Analytics graphs not loading due to an error).

I am using the new Cosmos DB with MongoDB API for xDB along with using Sitecore 8.1 Update 1 which I suspect could be part of the problem as 8.1 supports up to version 3.0 of Mongo and Cosmos might be using a newer version. The actual connection appears to be fine since I am getting no TLS related access errors and all the collections were made as soon as I updated my connection strings although I have virtually no actual documents in any of the xDB databases. However, since I have not done as much work with xDB in the past I'm unsure if this is compatibly issue vs something that I haven't configured.

Exception: System.InvalidCastException
Message: Unable to cast object of type 'MongoDB.Bson.BsonInt32' to type 'MongoDB.Bson.BsonInt64'.
Source: Sitecore.Analytics.MongoDB
   at Sitecore.Analytics.RangeScheduler.MongoDbRangeMap2.BuildRangeRecord(BsonDocument document)
   at Sitecore.Analytics.RangeScheduler.MongoDbRangeMap2.TryLockRange(WorkerHandle worker, DateTime leaseExpiration, RangeHandle& range)
   at Sitecore.Analytics.Processing.RangeScheduler.RangeMapWorkScheduler3`1.TryLockRange(WorkScheduler`1& context)
   at Sitecore.Analytics.Processing.RangeScheduler.RangeMapWorkScheduler3`1.GetNextRange(WorkScheduler`1& context, Boolean returning)
   at Sitecore.Analytics.Processing.RangeScheduler.RangeMapWorkScheduler3`1.TryGetNext(ItemBatch`1& item)
   at Sitecore.Analytics.Processing.WorkSchedulerWithBacklog`1.TryGetNext(ItemBatch`1& batch)
   at Sitecore.Analytics.Aggregation.Data.Processing.InteractionBatchHistoryWorker.Execute()
   at Sitecore.Analytics.Core.BackgroundService.Run()
up vote 3 down vote accepted

At this time, Sitecore doesn't officially support Cosmos DB / DocumentDB. But with all the push towards Azure, I would expect this to be ready sometime this year.

See the notes here: https://kb.sitecore.net/articles/599633

Using DocumentDB protocol support for MongoDB with Azure DocumentDB service is not supported. A MongoDB server instance must be used.

And the compatibility table confirms that. But based on its presence there, and the fact that they've already switched the name to "Cosmos DB", I suspect they're actively working on it.

There's a great thread on the Sitecore community forum where this is discussed at some length (and the article you mention is linked). This might be a good source of support.

Considering the speed of evolution of both Azure services and Sitecore, it would be safer to wait for official support before using this in production. But if you're still feeling intrepid, here are a couple of more recent blog entries on the subject that you should read.

It might also be interesting for you to try this integration with Sitecore 8.2 Update 3.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.