Sitecore Version upgrade Troubleshooting Basics

Challenge:

This week, we were upgrading one of our environment and while doing so. We can’t get rid of following screen:

Sitecore-Upgrade-Hung

This screen will not move on, as you know when you see following messages:

Executing Post Installation instructions: ‘Sitecore.Shell.Upgrades.PostStep,Sitecore.Client’
Installation has been completed

Then only you can say upgrade is completed!

We also tried to Download full log by clicking on “Download as file”. But with no luck 😦

So, you are also facing similar challenges while doing upgrade OR facing some another challenge while doing upgrade and not sure where to look at? Then this post is for you!

Solution:

I’m sure you must’ve read my earlier post which shares solution about Browser timeout issue while doing upgrade – Not yet? then please give it a read here

Okay, So let’s come to the main question  – Why Upgrade is not getting completed? Where should we look at? The answer for your questions lies in following folder:

<WEBSITEROOT>/temp/__UpgradeHistory/<package_name>_<timestamp>/

So, here’s how it looks like:

SC-Upgrade-History-It contains following directories and files:

  • bin_install
  • deleted
  • modified
  • transactions
  • FileOperation.install.log — All details about File related operation like DeleteFile, AddFile etc.
  • InstallationHistory.txt – Shows the full Installation History in detail.
  • installationLog.txt – Detailed Item and file installation – Like Which Item is getting added, deleted etc.
  • messages.xml – XML Log of installation – Says Item forcefully updated, Collision occurred etc.
  • process.bat – Usually, Sitecore support champs asks you to run this batch file. In case of your upgrade has not been completed successfully
  • rollbackPackage.rlb

From here we found that on bin folder Access rights were missing. Someone from team applied it earlier. But forgot to select “Replace all child object permissions with inheritable permissions from this object” : http://www.techrepublic.com/blog/how-do-i/how-do-i-change-access-permissions-for-all-folders-and-files-in-vista/

As you can see — Haven’t written description of each file and folder, and to be honest. I am also not fully aware about it and unfortunately can’t find any document which explains them. But I do learn  them case by case. So, if you faced challenge earlier and know the description feel free to share.

So, Just remember this as Sitecore Logs are your friends during day-to-day life. And __UpgradeHistory folder is your friend during your upgrade days! 🙂 [A friend in need is friend indeed!]

Good Reads:

Sitecore 7.2 Upgrade Learnings

Challenge:

Howdy my dear readers, I am back. Yes, after so long time. But I was learning and exploring new things for you! And please fasten your seat now. As I got a lot of Basics to share with you! So, here we go..

Last week we were working on upgrading from Sitecore.NET 7.0. (rev. 130810) to Sitecore.NET 7.2 (rev. 140228) [You are also going to upgrade to same version? What a co-incidence?]

BTW, Sitecore released 7.2 Update-2 (rev. 140526) on Friday, May 30, 2014 only. So, if you are in planning phase, good to have a look at it here : http://sitecorekh.blogspot.in/2014/05/sitecore-releases-72-update-2-rev-140526.html

After deploying these changes we found following error which took lot of our time. [Roughly 4 hours]

Max-Clause-Count-v2

Message: maxClauseCount is set to 1024
Source: Lucene.Net
Lucene.Net.Search.BooleanQuery.Add(BooleanClause clause)
Lucene.Net.Search.MultiTermQuery.ScoringBooleanQueryRewrite.Rewrite(IndexReader reader, MultiTermQuery query)
Sitecore.ContentSearch.Linq.Lucene.Queries.SpanWildcardQuery.Rewrite(IndexReader reader)
Lucene.Net.Search.Spans.SpanFirstQuery.Rewrite(IndexReader reader)
Lucene.Net.Search.BooleanQuery.Rewrite(IndexReader reader)
Lucene.Net.Search.BooleanQuery.Rewrite(IndexReader reader)
Lucene.Net.Search.IndexSearcher.Rewrite(Query original)

You are also facing same error? Or you would like to be pro-active? Then this post is for you!

Solution:

Just a note : Before we move to solution of this challenge, I would suggest you to check this post — http://maxslabyak.com/sitecore/3-new-sitecore-v7-2-bugs-need-know-go-live/

To resolve this error, we did following steps:

  • We found that — Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config file has following setting (We Increased it from 1024 to 2048, then bit higher and then finally 65536. But it didn’t work):
    <!--  MAX LUCENE QUERY CLAUSE COUNT
            Boolean Max Clause Count. Increasing this value increases memory consumption. Only increase it if you need to run very large queries. 
            This setting allows you to increase or decrease the clause count for Lucene depending upon how big you think the queries could grow.

            Default value: 1024
      -->
      <!-- Performance Issue: Changed value[65536] to default value [1024] -->
      <setting name="ContentSearch.LuceneQueryClauseCount" value="65536" />
  • Then we contacted our common friend — Google and gave us following two links:

http://www.newguid.net/sitecore/2012/sitecore-lucene-max-clause-count/

Lucene MaxClauseCount error after upgrading to Sitecore 7.2 (rev. 140228)

  • First one, says about pipeline, and second one asks us to do changeinSearchProvider. But we haven’t implemented our search provider — Then we merged both of this solution and derived our solution and here’s the simplified version of it:
    • Create a New Pipeline in your Pipelines projects [Basically, We create layer for each this kind of functionality]. Technically, Create a .cs file — Let’s say AdjustLuceneSettings.cs. And add following code within it:
using Lucene.Net.Search;
using Sitecore.Pipelines;

namespace SitecoreBasics.Pipelines.Search
{    
    public class AdjustLuceneSettings
    {
        ///
        /// Processor to set the lucene max query clause count
        ///
        ///
        public void Process(PipelineArgs args)
        {
            int maxClauseCount = 1024;
            int.TryParse(Sitecore.Configuration.Settings.GetSetting(&quot;ContentSearch.LuceneQueryClauseCount&quot;, &quot;1024&quot;), out maxClauseCount);
            BooleanQuery.MaxClauseCount = maxClauseCount;            
        }       

    }

}
    • Now, this project will need reference of “Lucene.Net.dll” — Please do add it
    • So, Pipeline is ready. Now we need to Hook it in  to Sitecore. To do that, add AdjustLuceneSettings.Config under your App_Config/Include folder, and add following configuration within it:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <pipelines>
      <initialize>
        <!--<processor patch:after="*[@type='Sitecore.Pipelines.Loader.EnsureAnonymousUsers, Sitecore.Kernel']" 
                   type="SitecoreBasics.Extension.Pipelines.Search.AdjustLuceneSettings, SitecoreBasics.Extension"/>-->
      </initialize>
    </pipelines>
  </sitecore>
</configuration>
    • Yes, we are near — Now, you can set ContentSearch.LuceneQueryClauseCount to any number you want.
    • That’s it!

So, your application is working fine — right? Happy?! I know you will be. But an engineer within you is shouting and asking following questions:

  1. Why we get maxClauseCount error?
  2. Why ContentSearch.LuceneQueryClauseCount s not working?

We appreciate your questions, and luckily, we’ve answers for both of your questions:

The reason for maxClauseCount is as below:

Recently I ran into a familiar lucene exception within my sitecore solution. Its lucene’s TooManyClauses exception. In fact the exception occures when there are more than 1024 where clauses in your query. That seems a lot but by using a wildcard query for example lucene is translating your wildcard query into a lot of where clauses after analyzing it. Of-course the first step is to take a good look at your query and if possible try to rewrite

Source : http://www.newguid.net/sitecore/2012/sitecore-lucene-max-clause-count/

Answer for guys like me who believe in Basics:

http://dalelane.co.uk/blog/?p=2081

To borrow the example from the Lucene FAQ, in some situations Lucene expands your search query before running it.

If you have an index with:

     car
     cars
     cat
     catalogue
     caterpillar
     delta
     doctor
     dogs
     dominos

And you search for: ca*
It will essentially be expanded to “car OR cars OR cat OR catalogue OR caterpillar” (removing the wildcard).

And if you search for: *
It will be expanded to: “car OR cars OR cat OR catalogue OR caterpillar OR delta OR doctor OR dogs OR dominos“.
A query with nine clauses.

As the index grows, the number of clauses in these wildcard queries increases. If it increases to the point where search queries end up with more than the default 1024 clauses in them, then searches start throwing TooManyClauses exceptions.

And for second question– Why ContentSearch.LuceneQueryClauseCount is not working?

We raised a support case to our second common friends — Sitecore Support and they accepted it as a BUG:

I have managed to replicate this. Unfortunately the “ContentSearch.LuceneQueryClauseCount” setting is not used. We have registered this as a bug for the current version of CMS. We will notify you of any updates. Thank you for reporting the problem.

I hope I’ve answered all your questions. If you have more questions — Just shout! You’ve your set of learning after upgrading? And you would like to share. What a noble thought! Do it right now! Because Sharing is Caring! 🙂

Good reads:

Unable to create document builder – crawling exception after upgrading to SC 7.2 : 

Unable to create document builder – crawling exception after upgrading to SC 7.2

Happy Upgrading! 🙂

PS : Special thanks to Lilia Silvestrova (Sitecore Support) for providing this suggestion Bhavesh and Marcia who worked on this challenge!

Browser timeout error while doing Sitecore version upgrade

Challenge:

Currently, we are working on Sitecore version upgrade and during the upgrade process, we got following error:

[Screenshot credits : Varun]

Error was not helpful, we checked Sitecore log on server-side, checked SQL Connection and everything was fine! Then what caused this error? Is our Sitecore upgrade got competed successfully or not?

If you have faced similar error and have same question as we, then this post has answer for you!

Solution:

We rolled back our application to our base version and ran Sitecore version upgrade again using Firefox, and guess what it worked! 🙂

Yes, we know you are an engineer and you need logical justification for the same. Don’t worry we have a logical justification for you — posted on my another blog — Long-running processes and browser timeout issue (mainly Internet Explorer)?

Mainly following lines have answers:

IE

CAUSE

By design, Internet Explorer imposes a time-out limit for the server to return data. The time-out limit is five minutes for versions 4.0 and 4.01 and is 60 minutes for versions 5.x, 6, and 7. As a result, Internet Explorer does not wait endlessly for the server to come back with data when the server has a problem.

FF

Currently, Firefox timeout is determined by the system-level connection establishment timeout [Source : http://kb.mozillazine.org/Network.http.connect.timeout]. It was earlier issue in Firefox as well and they fixed it – https://bugzilla.mozilla.org/show_bug.cgi?id=592284

Happy Sitecore upgrade! 🙂

Challenges faced during up-gradation of Sitecore instance from IIS 6.0 to IIS 7.5

Before couple of months back, we upgraded our Sitecore instance from IIS 6.0 to IIS 7.5, It went smooth except few things, which are not Sitecore specific. But general .NET/IIS7.5/Windows Server 2008 related.

Just wanted to share with you. So, If during your up-gradation you don’t invest the time which we already! (Obviously, You can share any new things which you faced during your up-gradation process).

Challenge1 : Error: The requested name is valid, but no data of the requested type was found when calling Dns GetHostByAddress

Whenever we were opening Sitecore login page we used to get this error and to solve this error we need to enable “use NETBIOS over TCPIP” [Source : http://www.mycsharpcorner.com/Post.aspx?postID=28]

Challenge2 : The ‘Microsoft.ACE.OLEDB.12.0’ provider is not registered on the local machine.

We tried everything suggested which Google suggested us from following articles:
http://ybbest.wordpress.com/2009/07/22/the-microsoft-ace-oledb-12-0-provider-is-not-registered-on-the-local-machine/
http://karthickmicrosoft.blogspot.com/2010/05/microsoftaceoledb120-provider-is-not.html

Basically they suggested us to change the application to 32 bit and do run it! But it was not the solution in our case, as we wanted to take full benefit of Integrated Pipeline mode also we earlier learnt that Sitecore works best in ASP.NET 64
bit mode. So, we were sure that we have to find some another solution. So, we delved again in to Google ocean and found pearl from it! Basically you need to install 64 bit drivers to make it working! [Source : http://blog.newslacker.net/2011/08/microsoftaceoledb120-provider-is-not.html]

Just a note : after installing drivers, it’s good to manually restart IIS using command prompt!

Challenge3 IIS related : few things which we found (and learnt) were related to IIS Only!

  1. iisreset practice : Right click and then do iisrest! As per Windows Server 2008 architecture command prompt automatically dosen’t run in Admin mode. You have to forcefully to do it! (sometime annoying. But it makes sure you are doing IISRESET when you really need to do!)
  2. IIS Log files : When you run Sitecore 6.x in Integrated Pipeline Mode, You will notice that ALL IIS log entries contain the log entry for the resquest to the layout (aspx) page (instead of the actual sitecore item .e.g /ContactUs.aspx). To solve this error you need to write your own IIS Module, How to do it? Refer following article: http://www.bolaky.net/post/IIS-75-Logging-with-Sitecore-6x-in-Integrated-Pipeline-Mode.aspx Just a note :The IIS  Module uses app.Context.RewritePath(originalPath); method which is a heavy method to use. So, before adding this module, give yourself a though. Do you really need (or use) this log entries for any purpose? Can’t you live without them? If Yes, I would strongly recommend not to add it!
  3. Global.asax’s Application_BeginRequest was not getting called every time : And we had our custom security code in that method. So, if it won’t get called our application will not work. After digging a bit we found that it’s behavior of IIS and to solve it we did following change in our web.config:

<modules runAllManagedModulesForAllRequests=”true”>

For more information on this read : http://learn.iis.net/page.aspx/121/iis-modules-overview/

Good to read :
IIS Performance analysis by Microsoft : http://blogs.technet.com/b/mscom/archive/2008/06/09/microsoft-com-operations-performance-analysis-of-iis-7-0-windows-server-2008.aspx
http://learn.iis.net/page.aspx/624/application-pool-identities/

Happy Up-gradation! 🙂

Sitecore upgrade decision

Challenge:

It’s always a question for everyone that whether we should upgrade to latest sitecore version or not?

Solution:

Alex Shyba wrote a nice article and provided Decision tree which will surely help you to answer above question:

Source : http://sitecoreblog.alexshyba.com/2011/02/to-upgrade-or-not-upgrade.html

UPDATE : 6/5/2011:

Just before couple of days back, gone through nice article from SDN on same topic with title “Sitecore’s Recommended Version Policy” — This explains Sitecore’s Version recommendation policy very well. Frankly, this article helps you to clearly understand your version upgrade process.

From article I made few of my notes, which I will be sharing with you:

1. Check Which Level of Version upgrade you have? Following table will help you out to identify update level.

Revision Level

Description

Required Upgrade Efforts

<Level 1> Indicates a major new version of the product. Developers, users, and partners should attend supplemental training to keep their certification status up-to-date. Internal sales training, documentation, and training materials will be updated.

e.g. Sitecore 5.3 to Sitecore 6.0 Indicates Level 1 Upgrade.

Major new versions require the greatest effort to upgrade. On average, upgrades for this level of release will take several weeks to implement.
<Level 2> Indicates a release that introduces new features, these are typically UI changes and updates of, for example, XSLT files, ASPX files, or APIs. Documentation and training materials will be updated.

e.g. Sitecore 6.2 to Sitecore 6.3 Indicates Level 2 Upgrade.

Upgrades at this level require a moderate amount of effort to implement. On average, upgrades for this level of release will take 1-2 weeks to implement.
<Level 3> Indicates a release that contains minor structural changes.

e.g. Sitecore 6.4.1 to Sitecore 6.4.2 Indicates Level 3 Upgrade.

Upgrades at this level require a minimal amount of effort. On average, upgrades for this level of release require less than a week to implement.
rev. <Level 4> Indicates a release that contains bug fixes. Upgrades at this level require a minimal amount of effort.

The fourth level numbering is a date — yymmdd-n — and n is used if more than one build is made on the same day.

e.g. Sitecore.NET 6.2.0 (rev. 091012 Hotfix 330275-1) Indicates Level 1 Upgrade.

On average, upgrades for this level require a few hours to implement.

2.  From above table’s last column identify required upgrade efforts. Please note this upgrade efforts depends on your customization line. If you have customized Sitecore a lot, then this time will be increased. And also through QA is also required.

You must be eagerly waiting for source article’s link 🙂 — here you go : http://sdn.sitecore.net/Support/Versioning%20Policy.aspx

Happy Sitecore upgrade! 🙂