Tuesday 5 April 2016

Object reference not set error when open Path Analyzer in Sitecore


Issue: Object reference not set error when open Sitecore Path Analyzer  After upgrade from 7.5 to 8.1 update 2

How ever this error was present in 8.1 Initial update too. Thanks to chris who give me direction where to look it save my time. However that solution is not fix actual problem it It show sitecore root in select map dropdown which is not correct list of maps.

When I try to open Path Analyzer for the first time after upgrade to 8.1 update 2 and Initial release, I get an follwong error in the MapSelector.cshtml file, Object reference not set to an instance of an object.
 
helper.MakeTreeDefinition("TreeDefinitionFilter", fieldsWrapper, selectedTreeDefinitionId.ToString(), mapRootId.ToString());
The mapRootId object.  That parameter is empty when launching the Path Analyser, so the method expecting this value but  finds nothing.  This happens on line 32: 
 

 
var mapRootId = parametersHelper.GetMapRootId();
 
 
 
The  problem is that GetMapRootId() is retuning a null value from this command, when that Mapselector Component parameter doesn’t exist. 
 

Solutions:

 

To fix above issue follow the steps below
1. Go Sitecore Desktop
2. switch Database to Core
3. Go  to the path below
 /sitecore/client/Applications/PathAnalyzer/Common/Layouts/Renderings/MapSelector/MapSelector Parameters/__Standard Values
 
4.Find Field called DefaultMapRoot  set following id {6768BE32-A142-4BA4-A02F-01D810FBF7FE}
 
5. close  sitecore clean browser cookies
6. Go to Path Analyzer .................

 
 
Enjoy
 
 

 


 




Tuesday 23 February 2016

Sitecore Zero DownTime Deployment..................Possible?

In Sitecore deployment its alway a issue of downtime may be couple minutes to few miute as both content delivery share same Web Database and content package installed on CM and just code drop on CDs so you alway come in situation  where you need to wait  until template/ layout deploy and then publish and site back on track. Its is Chicken and Egg situation which should deploy first and some times you need to apply some manual steps on some content before you published it.

There are couple of Ways you can deploy without down time one of the way is show in Sitecore Scaling guide for Disaster recovery servers used as temporary/ permanent switch to  live traffic for user after deployment. Which increase servers cost and lots of over heads.

My client do not wants add new servers to infrastructure  as they don't have enough resources to manage all servers and achieve No down time while deployment.

Following Diagram is very common across Sitecore deployment.
Standard Sitecore architecture  is two or more Content Delivery servers one Content Management Server one  Solr with Zookeper to sync Solr Node, Sql Cluster for Load balacing Sql. like below. I assume Core Database is required and all of us know.

There is option for solr and Lucene to switch index while rebuild index no down time for solr content. We can't use that feature as we are having Nutch for site search.




We have automated lots of  step using Teamcity and octopus steps like Sanity Check after deployment complited and generate report of any broken link or page error. I am going in to details but I am showing some basing settings  how to achive. 

There are few steps you need to do

Add new Web Publishing Target. 


Visit John West Blog or Nehemiah Jeyakumar

Add new Web Index or Any costom Index Core.

Copy existing Web Index Named "Sitecore_Web_Index or any custom and got Sitecore_web2_index
folder and find core.properties Open and change Name property  with "Sitecore_Web2_index

Update Index Update Strategies

Go to Sitecore.ContentSearch.DefaultConfigurations.config
Add following new Strategy Which allow to update index to both Solr index same time  while  normal operation of cm. So we hare update content on both solr index.

<onPublishEndAsyncWeb2 type="Sitecore.ContentSearch.Maintenance.Strategies.OnPublishEndAsynchronousStrategy, Sitecore.ContentSearch">
<param desc="database">web2</param>
<!-- Whether or not a full index rebuild should be triggered when the number of items in the EventQueue exceeds the number specified
in ContentSearch.FullRebuildItemCountThreshold. -->
<CheckForThreshold>true</CheckForThreshold>
 </onPublishEndAsyncWeb2>


 Configure Solr Index.config

Add following or as per your need

<!-- WEB INDEX configuration -->
          <index id="sitecore_web2_index" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
            <param desc="name">$(id)</param>
            <param desc="core">$(id)</param>
            <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
            <configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" />
            <strategies hint="list:AddStrategy">
              <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsyncWeb2" />
            </strategies>
            <locations hint="list:AddCrawler">
              <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
                <Database>web</Database>
                <Root>/sitecore/content/home</Root>
              </crawler>
            </locations>
           <!-- <locations hint="list:AddCrawler">
              <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
                <Database>web</Database>
                <Root>/sitecore/content/demo</Root>
              </crawler>
            </locations>-->
          </index>


Change Code  to switch index  

In our case Searcm manager configure based on one of App setting value  so we can chagne index to search content from that index.

Nutch Feeding to both Index Sitecore_Web_Index and Sitecore_Web2_Index.




Now configuration is ready All you need to run deployment in following order. We are using octopus deploy so we have lots of flexibility to chagne configuration using powershellshell script.

1. Remove one Content delivery Server from Load Balancer its depend on load balancer software API.
2. Stop Nutch for feeding index
2. Change App Setting to for Site Search TO Sitecore_Web2_Index on CM and CD both.
3. Set Default publishing target On CM only to Web2 Database. Instead of Web|Web2 in DefaultPublishingTargets in web.config file, you can set mutliple target separated by pipe
4. Set Site Definition Database Attribute to Web2 (CM and one CD)
4. Deploy Sitecore Item to  cm and code to CM and CD
5. Publish content to  Web2 Publishing target
6. Run test script to regression check of you site.


If successful  all above steps run second part of deployment.

1. Add back first server and remove other server from load balancer.

2. Change configuration for search
3. Set Site definition to Web2
3. Deploy code package to content delivery.
4. Add server To Load balancer.

Finally steps
Set DefaultPublishingTargets to Back to web|web2 on CM so manual publish sync content and update index correctly.


In Next deployment just switch web2 to web and deploy to server.

Enjoy No downtime deployment....

I have test this and with Solr index....Not tested with Lucene.













Sitecore Content Editor Search-Tags with User Friendly Facets tags

Its is very surprised that Sitecore beautiful feature people are not using it. Sitecore support very large content using Sitecore Item Bucket which was created as sitecore 6.6 module couple of year ago but now its part of sitecore Sitecore Item bucket. Item Buckets is a system that lets you store millions of content items in one container. You can convert individual items in the content tree into item buckets that can contain any number of subitems. These subitems are not listed in the content tree and do not have a direct parent-child relationship with the item bucket item.

One Really good feature is tagging content and seach based on tagging. We have thousands of pictures and content for one of my client they are struggling to find content. So I introduced them tagging feature. To enabled Tags filter for search Go to Item /sitecore/system/Settings/Buckets/Facets/Tags  and Enabled Checkbox Global.
so we can filter content based on tags applied but we discover that Tags are showing some strange Id like below.




Sitecore Has settiing for enabled User friendly name for Tags.

 Find Sitecore.Bucket.config file and find 
<setting name="BucketConfiguration.ResolveFacetValueToFriendlyName" value="false"/>

Repace with 
<setting name="BucketConfiguration.ResolveFacetValueToFriendlyName" value="true"/>

just rebuild index master index  you will see following.



Its Nice Feature...............

I was looking weather someone has face similar issue but found out yes is very common.
I had implemented computed field and use that field for facets. But after looking more in details find out above configuration out of box from Sitecore.

Thanks for visiting.......