Publishing Errors, something about clearing cache… stupid me!

Started last week with a new Sitecore-based Intranet for a new customer. Renamed the website-name in the sites-section to intranet and from that moment I actually received error after error while publishing. Ofcourse I’ve never looked in the log-files, didn’t had any problem, so why should I ;)?
The error, talking about was the following:

Job started: Publish ‘master’ to ‘web’ (nl)|#Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.Exception: Site “website” not found. (method: Sitecore.Publishing.HtmlCacheClearer.ClearCache(Object sender, EventArgs args)).
at Sitecore.Diagnostics.Error.Raise(String error, String method)
at Sitecore.Sites.SiteContextFactory.GetSiteInfo(String name)
at Sitecore.Publishing.HtmlCacheClearer.ClearCache(Object sender, EventArgs args)
at Sitecore.Events.Event.EventSubscribers.RaiseEvent(String eventName, Object[] parameters)
at Sitecore.Events.Event.RaiseEvent(String eventName, Object[] parameters)
at Sitecore.Publishing.Publisher.NotifyEnd()
at Sitecore.Publishing.Publisher.Publish()
— End of inner exception stack trace —
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args)
— End of inner exception stack trace —
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Pipelines.CorePipeline.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
at Sitecore.Jobs.Job.ThreadEntry(Object state)

It couldn’t be more self explaining: System.Exception: Site “website” not found..
How to fix this? Go to your publishing events, in this case the publish:end, and rename the websites:


<handler type=”Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel” method=”ClearCache”>
<sites hint=”list”><site>website</site></sites>
</handler>
<handler type=”Sitecore.EventHandlers.CredentialCacheClearer, Sitecore.EventHandlers” method=”ClearCache”>
<sites hint=”list”><site>website</site></sites>
</handler>
</event>

So when you rename your site in the sites-section Or when you add another website, just configure this event the right way :).

Update: There’s also a cacheSizes-size section. It contains a ‘website’-node. Rename it.

14 thoughts on “Publishing Errors, something about clearing cache… stupid me!”

  1. I’m getting a similar error, though the details are a bit different. My question is, rename the website to what?

    For something’s sake, here is my error:

    Job started: Publish ‘master’ to ‘web’ (en)|#Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.NullReferenceException: Object reference not set to an instance of an object.
    at CheckedIn.Handlers.OnItemDeleted(Object sender, EventArgs args)
    at Sitecore.Events.Event.EventSubscribers.RaiseEvent(String eventName, Object[] parameters)
    at Sitecore.Events.Event.RaiseEvent(String eventName, Object[] parameters)
    at Sitecore.Data.DataManager.NotifyItemDeleting(Item item)
    at Sitecore.Data.DataManager.DeleteCommand.Authorize(ItemCollection instances)
    at Sitecore.Data.DataManager.DeleteCommand.DeleteItem(Item item, Int32 index, Boolean deep)
    at Sitecore.Data.DataManager.DeleteCommand.Execute()
    at Sitecore.Data.Items.Item.Delete()
    at Sitecore.Publishing.Publisher.SyncTargetChildren(Item source)
    at Sitecore.Publishing.Publisher.ProcessItem(Item item, Boolean deep)
    at Sitecore.Publishing.Publisher.ProcessItem(Item item, Boolean deep)
    at Sitecore.Publishing.Publisher.ProcessItem(Item item, Boolean deep)
    at Sitecore.Publishing.Publisher.DoPublish()
    at Sitecore.Publishing.Publisher.Publish()
    — End of inner exception stack trace —
    at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args)
    — End of inner exception stack trace —
    at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
    at Sitecore.Pipelines.CorePipeline.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
    at Sitecore.Jobs.Job.ThreadEntry(Object state)

  2. Hi Andy,

    There seems to be a problem after fireing an event.
    Hmmzz, ‘at CheckedIn.Handlers.OnItemDeleted(Object sender, EventArgs args)’, have you written an event handler by your own?

    Normally the deleted-event would look like this:

    < event name=item:deleted>< handler type=Sitecore.Links.ItemEventHandler, Sitecore.Kernel method=OnItemDeleted/><

    handler type=Sitecore.Tasks.ItemEventHandler, Sitecore.Kernel method=OnItemDeleted/>< handler type=Sitecore.Globalization.ItemEventHandler, Sitecore.Kernel method=OnItemDeleted/><

    handler type=Sitecore.Data.Indexing.ItemEventHandler, Sitecore.Kernel method=OnItemDeleted/>event>

    – Alex

  3. Hi Alex,

    we have more or less the same error after clicking on the publish button:

    ManagedPoolThread #18 16:16:03 INFO Sitecore.Jobs.JobStatus – Job started: Publish
    ManagedPoolThread #15 16:16:03 INFO Sitecore.Jobs.JobStatus – Job started: Publish to ‘web’
    ManagedPoolThread #15 16:16:03 INFO Sitecore.Publishing.HtmlCacheClearer – HtmlCacheClearer clearing HTML caches for all sites (1).
    ManagedPoolThread #15 16:16:03 INFO Sitecore.Publishing.HtmlCacheClearer – HtmlCacheClearer done.
    ManagedPoolThread #15 16:16:04 ERROR Sitecore.Jobs.JobStatus – Exception
    Exception: System.Reflection.TargetInvocationException
    Message: Exception has been thrown by the target of an invocation.
    Source: mscorlib
    at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj)
    at Sitecore.Reflection.MethodInstance.Invoke()
    at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args)
    at (Object , Object[] )
    at Sitecore.Pipelines.PipelineMethod.Invoke(Object[] parameters)
    at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
    at Sitecore.Pipelines.CorePipeline.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
    at Sitecore.Jobs.Job.ThreadEntry(Object state)

    Nested Exception

    Exception: System.NullReferenceException
    Message: Object reference not set to an instance of an object.
    Source: Staging.Kernel
    at Sitecore.Modules.Staging.AfterPublish.AfterPublishHandler(Object Sender, EventArgs args)
    at Sitecore.Events.Event.EventSubscribers.RaiseEvent(String eventName, Object[] parameters, EventResult result)
    at Sitecore.Events.Event.EventSubscribers.RaiseEvent(String eventName, Object[] parameters)
    at Sitecore.Events.Event.RaiseEvent(String eventName, Object[] parameters)
    at Sitecore.Publishing.Publisher.NotifyEnd()
    at Sitecore.Publishing.Publisher.Publish()

    Any idea?

  4. Decent send! GA is also my biggest earning. However, that it is not just a a lot. thank you !!! quite very helpful send! awesome stuff thanx

  5. my God, i considered you have been going to chip in with some decisive insght at the end there, not leave it with ‘we leave it to you to decide’.

  6. I’ve been browsing online more than three hours today, yet I never found any interesting article like yours. It’s pretty worth enough for me. In my view, if all site owners and bloggers made good content as you did, the net will be a lot more useful than ever before.

  7. I am getting this error when I do a Publish Site in Sitecore 7.1 which is upgraded from sitecore 6.2. Options chosen to publish is Language :English
    Target : Internet
    I have a CM from which I am publishing it 2 CD servers []
    I have followed the scaling guide to implement web deployment of Media files. Please help me in fixing this.
    Error Stack Trace:
    11468 01:00:57 ERROR Application error.
    Exception: System.Web.HttpUnhandledException
    Message: Exception of type ‘System.Web.HttpUnhandledException’ was thrown.
    Source: System.Web
    at System.Web.UI.Page.HandleError(Exception e)
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.ProcessRequest()
    at System.Web.UI.Page.ProcessRequest(HttpContext context)
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

    Nested Exception

    Exception: System.Reflection.TargetInvocationException
    Message: Exception has been thrown by the target of an invocation.
    Source: mscorlib
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at Sitecore.Shell.Framework.Commands.MethodCommandProcessor.Invoke(PipelineArgs args)
    at Sitecore.Nexus.Pipelines.NexusPipelineApi.Resume(PipelineArgs args, Pipeline pipeline)
    at Sitecore.Pipelines.Pipeline.Start(PipelineArgs args, Boolean atomic)
    at Sitecore.Shell.Framework.Commands.MethodCommand.Execute(CommandContext context)
    at Sitecore.Web.UI.Sheer.ClientPage.OnPreRender(EventArgs e)
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    Nested Exception

    Exception: System.Exception
    Message: The publishing process was unexpectedly interrupted.
    Source: Sitecore.Client
    at Sitecore.Shell.Applications.Dialogs.Publish.PublishForm.CheckStatus()

Comments are closed.