Insights

Sitecore 10: An Error Has Occurred

An Error Has Occurred in Sitecore 10

What happened? Sitecore 10 was running fine with its fresh install, you deployed your existing code from your Sitecore 8 instance to do your upgrade, that all worked, and now you start setting up your UAT or Production instance and you get nearly a blank screen. All it says is "an error occurred" [sic].

Sitecore 10: An error has occurred

Loading up Sitecore worked, going through the login process with Identity Server worked... until you get redirected back to Sitecore.

There used to be an SC_TICKET error that would cause this in Sitecore 9, but it was patched. What's going on now?

This is what's happening. It used to be that Sitecore required you to set up cache clearing yourself. Lots of people would have a patch file like this:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <events timingLevel="custom">
      <event name="publish:end">
        <handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">
          <sites hint="list">
            <site name="MySite">MySite</site>
          </sites>
        </handler>
      </event>
    </events>
  </sitecore>
</configuration>

 

If you check the logs, you'll see errors referring to this.

27700 17:45:56 ERROR Could not resolve type name: Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel (method: Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)). 24712 17:45:56 ERROR Could not resolve type name: Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel (method: Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)). ManagedPoolThread #5 17:45:57 INFO Trying to load XML configuration /App_Config/Security/GlobalRoles.config ManagedPoolThread #6 17:45:57 INFO Trying to load XML configuration /App_Config/Security/Domains.config ManagedPoolThread #5 17:45:57 ERROR Could not resolve type name: Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel (method: Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)).

I know it doesn't look like it has anything to do with login, but it does. (It actually breaks a lot of processes, but login is the one you'll notice first.)

The Good News

You don't need this setup anymore! Sitecore has handled this cache clearing event as part of its standard installation now. Just delete the cache configuration and move on.

It might take a bit of work going through all the different environment setups, but its one less thing to maintain.

P.S. This will actually happen in Sitecore 9 as well, and the same solution applies.

👋 Hey Sitecore Enthusiasts!

Sign up to our bi-weekly newsletter for a bite-sized curation of valuable insight from the Sitecore community.

What’s in it for you?

  • Stay up-to-date with the latest Sitecore news
  • New to Sitecore? Learn tips and tricks to help you navigate this powerful tool
  • Sitecore pro? Expand your skill set and discover troubleshooting tips
  • Browse open careers and opportunities
  • Get a chance to be featured in upcoming editions
  • Learn our secret handshake
  • And more!
Sitecore Snack a newsletter by Fishtank Consulting
 

Meet Ryan Allan

Senior Developer

⚙️💻👪

Ryan is a seasoned Senior Developer at Fishtank and is Sitecore Developer Certified. In a nutshell, he describes his role as "building extremely fancy websites". Ryan has a degree in Mechanical Engineering and previously worked on power plants and compressors, and now builds websites for the same company as a client! Outside of work, his interests are science + physics and spending time with his kids.

Connect with Ryan