Today let’s look at some of the possible causes of an undesired behavior that can be sometimes a pain to troubleshoot.
The symptom is very recognizable – you open up the Experience Analytics dashboard and you see a big bright red line telling you that a graph cannot be shown. This of course is due to an exception happening behind the scenes.
There are many things that can cause this problem, and therefore there are many things to check. In this post, I’m going to assume you already:
- Checked the logs to find something out of the ordinary.
- Have triple-checked you analytics configuration.
- Have ensured mongo is running and collecting data.
- Have made sure your reporting connection string is pointing to a valid server and DB, and that the login details are correct.
- Have already redeployed the marketing segments (/sitecore/admin/RedeployMarketingData.aspx)
- Have checked the console of your browser and emptied the browser cache.
- Have even rebuilt the reporting DB (making a secondary db and all that jazz)
And you still have not found an answer. Well, here’s one more thing – which was actually the real culprit on a previous project and which took hours to find.
It all stated the day a team got html for a site all nicely organized in a VS web MVC project. It had the default files, it was clean, and the UX/UI team just added views with the plain html mockup of the site. Nice!
So that team started coding all backend logic, adding stuff here and there, pipelining their way to heaven, as usual, and no one of them ever checked the Experience Analytics dashboard. You know, too busy building the actual site, they didn’t care about the analytics part because, of course, Sitecore has it covered out of the box.
Until the day someone actually tried to open the Experience Analytics dashboard – to find a red sea of “graph cannot be displayed” messages. Server errors all over the place. The browser console was showing nothing but a dreaded the error 500 message, line after line after line. Worse yet, the original team was long gone. Guess whose team got the job to fix that?
We tried everything in the above list, some of those things multiple times. We even installed a new Sitecore instance, checked that it worked, and then deployed our solution – and we broke it. So we started looking in the code itself – we disabled custom config files, we looked into every line of code in every processor, made small refactorings – and nothing.
Until I noticed a funny little friendly file in the app_start folder of the web project:
Recognize the little friend? It’s the default route configuration file for WebApi routes. and that was it! All custom webapi routes should not be registered as usual, but using a different method, more “Sitecore-friendly”.
I checked the file and it actually was the plain default one added by webapi – so not even that default route was needed. We ended up deleting the file and removing references to its code, and magically the Experience Analytics dashboard was working again.
So there you go! I hope this helps you save some troubleshooting time if you are having this same problem.
See you later, and very happy Easter Sunday to all of you who celebrate it.