Sunday, February 17, 2019

Sitecore Error Troubleshooting: Sitecore 9.1 Current Content Database returns Master Database in Content Delivery Web Site

Sitecore Error Troubleshooting: Sitecore 9.1 Current Content Database returns Master Database in Content Delivery Web Site

Error Details: I was debugging the code base after sending the request from publishing website in Sitecore 9.1 and Sitecore.Context.Database was returning Master Database instead of Web database.

To troubleshoot the issue “Sitecore.Context.Database was returning Master Database”, I checked the Site definition configuration file to verify that site pointing to Master Database or Web Database and found that configuration was showing Sitecore website pointing to Web database”.

To troubleshoot more to identify the root cause of issue, I checked the configuration of Sitecore 9.1 website using the http://<host name>/sitecore/admin/showconfig.aspx:

In the above configuration file, I found that Site B pointing to Master Database with the help of role based configuration patch file:
This file was containing the Unicorn Source Folder related configuration details including the role base patch file for Standalone mode (a single Sitecore instance performing all server roles or local development environment) where database pointing to Master database.

Due to this rule-based configuration setting, Sitecore website Current Context was pointing to the Master Database instead of Web database. After removing this rule based configuration, Sitecore website current context start pointing to Web database when request coming from the published website.

This rule based configuration coming up with Habitat demo solution for Habitat Website and needs to be deployed on Development machine only and do not need to be pushed to the higher environments.

Reference Articles:

Saturday, February 02, 2019

Sitecore Error Troubleshooting: Experience Editor and Preview mode Error- Rendering view QuickbarButton.cshtml

Error Details: [InvalidOperationException]: Error while rendering view: &#39;/sitecore/shell/client/Sitecore/Speak/Ribbon/Controls/QuickbarButton/QuickbarButton.cshtml&#39; (model: &#39;Sitecore.Mvc.Presentation.RenderingModel, Sitecore.Mvc&#39;).

The one of the feature of Sitecore is to support multisite using single instance of Sitecore and for this we can utilize the Sitecore patch file to setup the new site:

      <site name="BrandA"
    startItem="/Home" />
      <site name="BrandB"

Recently I was working on a Sitecore 9.1 project where we need to convert single site implementation into multiple managed websites, so I requested one of the team member to perform this task.
After setting up the BrandB website, we started getting error in Sitecore Experience Editor and Preview mode while accessing the page from BrandB:- Ribbon was not loading and Sitecore loading screen was in active mode only:

BrandB Site Patch file:

Error Analysis: To verify this issue,

1. I checked the log file:

And found [InvalidOperationException]: Error while rendering view: &#39;/sitecore/shell/client/Sitecore/Speak/Ribbon/Controls/QuickbarButton/QuickbarButton.cshtml&#39; .

2. BrandA site was working fine.

3. Removed the Site patch file and SiteB started working fine, in this case it was taking the default website setting. <site name=”website”….> is the default setting that comes with Sitecore.

Cause of Error:
Again, I investigated the BrandB patch file and found that Preview.DefaultSite setting was pointing to BrandA and due to this Ribbon was not loading in Experience Editor and Preview mode.

In multisite configuration, the value of Rendering.SiteResolving value set as “true” at /App_Config/Sitecore.config which helps in site resolving, so cross-site links can be rendered with correct hostname, language, and virtual folder.

In my case, the Experience Editor and Preview mode are being opened in the context of the site defined in the Preview.DefaultSite setting i.e. SiteA, due to this unexpected error “Server Error in '/' Application.” was coming in the place of Ribbon.

To resolve this issue, I changed the Site name to SiteB in Preview.DefaultSite setting and now site context site resolved successfully and started loading the Ribbon correctly in Experience Editor and Preview mode.

Useful articles:


Friday, February 01, 2019

Sitecore Technology MVP 2019 Award

Sitecore® Technology MVP 2019 Award

Sitecore®  Announces 2019 Most Valuable Professionals, Spanning More Than 30 Countries and 150 Companies on 31st January 2019.

This Sitecore® MVP Program, recognizes individuals whose Sitecore expertise helps drive innovation and digital transformation.

This year (2019), I am honored to be awarded as Sitecore Technology MVP from India. 

Congrats to all my fellow Sitecore MVP’s for 2019.

The Sitecore Technology MVP: An individual with seasoned technical experience who actively participates in online and offline communities to share their knowledge and expertise with developers, marketers, strategists, Sitecore partners and customers.

Thanks to Sitecore and Sitecore MVP Community for your support.

Sitecore Press Release:
Sitecore 2019 MVP list:

Once again Thanks to Sitecore and Sitecore MVP Community for awarding me Sitecore Technology MVP 2019.

Sitecore® Technology MVP 2020-2019

Featured Post

Sitecore Error Troubleshooting: Node.js error while setting Sitecore JSS Integrated Mode

Sitecore Error Troubleshooting: Node.js error while setting Sitecore JSS Integrated Mode Problem Statement: I was setting up th...

Total Pageviews

State Counter


About Me

My photo
Based in Bangalore, INDIA, Amit is a Sitecore MVP and MCC. He has an MCA from the U.P.T.U., INDIA and holds certifications including Sitecore and SharePoint 2007/2010. He is an contributor to Sitecore/MSDN communities and Amit have experience in Sitecore, ASP.Net with C#, MVC, SharePoint, Classic ASP, VB,Macros,HTML,JavaScript,JSON,BootStrap and AngularJS.


Follow me on Twitter