December 1, 2017

Errthing is Duplicated! (in the Sitecore content tree)

By: Craig Taylor
December 1, 2017


Errthing is Duplicated! (in the Sitecore content tree)

So many Sitecores!  I recently ran into something that I've never seen before.  After performing a build to my local server, I noticed that I was having trouble syncing portions of my content tree via TDS and Rocks.  After further investigation, I noted that every node was duplicated:

You get a content, you get a content, you get a content

No bueno.  The duplicated items had identical guids, so it's not like they were separate items.  This screenshot is from Rocks, but logging into Sitecore showed me the same thing. (8.2 Update 4, btw, but this probably applies to all versions of Sitecore)

I tried just about everything I could think of to resolve this.  No dice.  Off to the trusty Sitecore Slack channels for help!

Side note: The Sitecore community is awesome!  You've instantly got an army of Sitecore enthusiasts willing to help you through any roadblocks you may face.  At times it seems like there are so many places to keep track of, but when you need them, you're glad they're there.  How to connect with the community: https://sitecore.stackexchange.com/questions/1689/how-can-i-connect-with-the-sitecore-community

As I initially thought this might have something to do with TDS, I tried that channel first.  Using the suggestions by others on the channel I tried numerous IIS restarts, Visual Studio reboots, disabled the TDS item cache, removed TDS file caches and rebooted my VM.  None of these helped my situation.  I was starting to consider "nuclear" options where I would attach vanilla master database files and briefly considered "transferring items from web to master."  I was not looking forward to these options and am glad I didn't get to that point.

The Fix

Fellow Sitecore MVP Kamruz Jaman (@JammyKam) thought this sounded like a config issue.  Perhaps there were some config files were corrupt or duplicated, he thought.  He suggested disabling all custom configs to rule those out.  I wasn't sure what would have changed from earlier in the day when everything was working and to a bit later that evening, but I decided to delete all custom configs knowing that I could always just redeploy them.

Well, I deleted the custom config files and fired Sitecore back up (after an IISreset for good measure)  to check and sure enough, the duplication issue was resolved!

I still didn't have my application configs now, so I followed up with re-deploying my application.  Still worked, whew!

So What Busted Sitecore?

I actually haven't had a chance to get to the bottom of *exactly* which config broke Sitecore so hard.  I think there must have been a config that somehow got duplicated (with a different name) or some cruft left over from a bad deploy that caused it to get wonky.  It was definitely not a TDS problem though, just to be clear! ;) I'm just glad the solution was relatively easy.


Sitecore 9 to the Rescue!

Well, 9 isn't the solution to my duplication problem, but it would have been much, much easier if I were already on 9 and could disable an entire configuration layer via the "mode=Off" setting as our hero of this story, Kamruz documents here:
https://jammykam.wordpress.com/2017/10/17/rules-based-configuration/