Quantcast
Channel: Sitecore basics!
Viewing all 178 articles
Browse latest View live

Fix for Database error during Sitecore 9 Installation

$
0
0

Challenge:

While installing Sitecore 9 for few of the exciting things I’m working on [Soon to be shared!] faced some issues. Which is obvious with any new things. I’m sure you as well. Not tried yet?! Then this quote is for you:

In a day when you don’t come across any problems, you can be sure that you are travelling in a wrong path.

https://quotefancy.com/quote/32294/Swami-Vivekananda-In-a-day-when-you-don-t-come-across-any-problems-you-can-be-sure-that

So, thought to write it down. With the goal that it helps someone, somewhere on this earth! [Might be on moon someday! :)]

I had to do couple of attemps to do Sitecore 9 Installation with same prefix. But at one point of time. It was stuck with this error:

Warning: The database containment option has been changed to None. This may result in deployment failure if the state of the database is not compliant with this containment level.

You are also facing the same? Then this post has fix for you!

Solution:

Here are the steps I did:

  1. Connected to SQL Server Management Studio and deleted databases which were with the prefix, which was trying to install.
  2. Configured Contained Database Authentication as per Installation guide’s chapter Prerequisites and Requirements [Why? Note from SC documentation “To enable SQL server to allow for the creation of users when using the Sitecore Install Framework, ensure that the target SQL Server is configured in a way that allows users and logins to be contained at the database level. To do this, set the contained database authentication server configuration option to 1 (on): “]
sp_configure 'contained database authentication', 1;
GO
RECONFIGURE;
GO

Now, try again. And if all good. You should see your brand new Sitecore 9 instance up and running!

Good reads:

  1. https://chebalt.wordpress.com/2017/11/22/sitecore-9-installation-tips/
  2. http://blog.baslijten.com/gotchas-while-installing-sitecore-9-using-the-sitecore-installation-framework/
  3. https://docs.microsoft.com/en-us/sql/relational-databases/databases/contained-databases

Hope this helps!


TDS ProxyDisabler error with Sitecore 9

$
0
0

Challenge:

While working for my SUGCON Talk I was trying to setup Sitecore solution with TDS. I came across following error while doing Get Sitecore Items:

TDS-error.png

Solution:

My Sitecore version was 9.0.1. I did some Google search. But couldn’t find anything. So, thought to reach out hedgehog team and they suggested this:

The proxy disabler issue was fixed in one of the later versions of TDS 5.6. Upgrading to the latest version of TDS should fix the problem.

And that did the trick! After upgrading to TDS 5.6 it worked. Thanks to Hedgehog support team!

Hope this helps!

Sitecore Troubleshooting Demos

$
0
0

Challenge:

Have been crafting on Sitecore since a decade and have came up with lot of unique Sitecore challenges.

Which I’ve been sharing with you via this blog, And have received good feedback from you — And I appreciate you for that. If you haven’t came across it yet. Then you can visit following links:

  1. https://sitecorebasics.wordpress.com/category/performance/
  2. https://sitecorebasics.wordpress.com/tag/troubleshooting/
  3. https://www.scribd.com/document/132658804/Sitecore-Troubleshooting-Path

While learning Debugging/Troubleshooting Tess’s blog helped me a lot. Especially Labs (You as well?!) :

https://blogs.msdn.microsoft.com/tess/2008/02/04/net-debugging-demos-information-and-setup-instructions/

Sine long time, I wanted to build something similar for Sitecore community. But most of the times being super busy, and at times being lazy [Happens with you as well!? ;-)]. But when I thought to present at SUGCON India I thought this is the best time to work on this idea! (If you couldn’t attend SUGCON India then you missed a great event — Everyone did a great job to make this happen first time at India. You can see great pictures here : http://www.sugcon.in/2018-pictures/)

I’m excited to share, What I have done with you. Which I already shared at SUGCON India and SUGUAE events.

Solution:

You can get it from here : https://github.com/klpatil/SCbuggybits (Read Me file should help you to get started) This lab contains 3 Bugs in the form of 3 Labs. It will be fun to find it and fix it!

My Session slides are here : http://www.sugcon.in/wp-content/uploads/2018/05/Troubleshoot-Sitecore-Like-a-Ninja-Kiran-Patil-SUGCON-India-2018.pdf

My session video is here :

Give it a try and let me know what you think? You found new bug in your day to day life, And would like to add it scbuggybits, I encourage you to do so!

Hope this helps you to fix your issues and let’s you go home on time! 🙂

Sitecore 9 Architecture and Scaling Basics

$
0
0

Challenge:

Sitecore 9 comes with ~50 roles. Which is obvious in this Microservices era. Sitecore team has done good job documenting all the roles and scenarios as well providing videos to help us understand.

I wanted to document a quick reference, Which we can refer quickly. It helped me to connect the dots. Thought to share with you as well!

Solution:

Here you go:

While working on this document, Got connected with SUGNCR team. They were hosting their second in-person meetup. So, thought to present this topic there along with my friend – Brijesh Patel

Event was really great and nicely organized — It was really great to meet lot of Sitecore passionate people in-person.

Slides are as below:

Pre-Session survey results are as below:

As you can see ~30 people were there and average rating was 2.4. They had mid level knowledge about Storage Roles, Cloud Services and Scaling.

Our session’s goal was to increase this knowledge and that’s what has been done in above given slides. Due to some reason, we haven’t gathered post-sesion survey. But session feedback, Which we got from organizers is astonishing – Thank you so much audience!

Hope this helps!

Toolcore publishing fix for TLS 1.2

$
0
0

Challenge:

We love automation and so as our clients. For almost all our clients, We do automatic deployment. Using Teamcity and Octopus.

As you know Sitecore automatic deployment is not easy, it involves the lot of things like ASP.NET MVC Files, DLLs, Sitecore Items, and Sitecore publishing. For Sitecore publishing we use : http://fortis.ws/fortis-collection/toolcore/publishing/

Which works best. But recently it was failing and we started getting error related to TLS after integrating it with Sitecore 9.0.2 installation deployed on Azure App Service.

You are also facing same error with Toolcore Publishing module? Then this post is for you!

Solution:

We did quick search and came across this SO thread — Which has some pointers for solution : https://sitecore.stackexchange.com/questions/13706/all-sitecore-8-2-x-azure-topologies-seem-to-be-effected-because-of-tls-issues

Microsoft disabled support of TLS 1.0 on App Services recently (https://social.msdn.microsoft.com/Forums/en-US/9dace9cb-a1a8-4f77-af26-324bc2b6740e/tls-plans-for-azure-app-service?forum=windowsazurewebsitespreviewenter link description here)

Technical details can be found here: Transport Layer Security (TLS) best practices with the .NET Framework

https://kb.sitecore.net/articles/688903

Any .Net call relying on TLS 1.0 is leading to authentication issues on Azure App Services:
Exception
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. --->
System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. --->
System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host.

We tried switching our Azure App service to TLS 1.0 and it worked!

I know, You must be thinking this is not the best solution. And so, as we!

You might have noticed from above links that, If any application is making HttpRequest using .NET HttpRequest class and using TLS 1.0 then it won’t work. And Solution is either changing code (ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12) and using TLS 1.2 or compile your application using >=.NET Framework 4.6.0 version and above as it uses TLS 1.2 by default. This makes perfect sense!

But how does it impat Toolcore publishing? After digging bit we understood that FortisCollections.Toolcore.Publish.Service has .asmx web service which is deployed on Sitecore CM Server and FortisCollections.Toolcore.Publish.Runner console application has Proxy which is invoked.

This was Eureka moment!

Thought to check with Jason (repo contributor) via github : https://github.com/Fortis-Collection/Toolcore/issues/5

And parallely thought to fix it by forking it and compiling it with new version — And it worked!

Obviously, So, as you I got busy after that and never got a chance to share it back with larger community. Couple of days back, one of my colleague, reached out to me requesting compiled DLL package and that was a moment, I realized this weekend. Have to share it with larger world!

PR Created : https://github.com/Fortis-Collection/Toolcore/pulls and waiting for Jason to approve. But till then you can use it if you are also facing similar issue!

Hope you go home after fixing this! 🙂




How to reference and deploy Sitecore hotfix DLLs?

$
0
0

Challenge

Recently we were facing 503 error on our Sitecore 9.0.2 version Sitecore App deployed on Azure App (Blog on that topic soon)

We reached out to our common friends — Sitecore Support team and they gave me Two Hotfix DLLs :

  • Sitecore.Kernel
  • Sitecore.ContentSearch

Til this point of time, I got DLLs like Sitecoe.Support.SOMNUMBER.DLL and it was easy to deploy. I can copy in Assemblies/Lib folder in your directory, and reference it from your Project. And it will be deployed on higher environments.

But If you are wondering how to do it for these two DLLs? As they are coming from Sitecore’s Nuget feed in your current solution. Are you? Then this post is for you.

Solution

As you do, I also did a quick search and foud this from Sitecore’s official doc : https://doc.sitecore.com/developers/82/sitecore-experience-platform/en/sitecore-public-nuget-feed-faq.html

That was disappointing 😦 Then thought to reach out to our internal Sitecore experts and following great ideas came up:

  1. Private Nuget server : This makes sense. But have to reach out to client and ask them to spin up new nuget server and deploy DLL there. But was unable to figure out, how it will resolve from nuget references [Sitecore] and Custom nuget having same DLLs with same name.  As I was not clear and had client team’s dependencies thought to look for other solution.
  2. Local Reference : Another plan was to use old school approach, Where you created Assemblies/Libraries/Libs folder under your Project directory and instead of nuget use local reference in all your projects. But it had two challenges:
    1. We are using Helix and we have lot of projects, where we need to do these updates ~20. Which I was not sold.
    2. In future, If we have to do version upgrade. We have to again do these changes manually for all projects. Lot of work Now and in future – not efficient. So, thought to think of another approach
  3. Post build step : Another idea was to provide post build steps in last project, which copies hotfix’d DLLs. That could have fixed local development environment challenges. But we use Teamcity, Octopack and Octopus deployment and this idea would need additional steps from DevOps team. Which is fine for now. But in future — Same efforts needs to be done to undo it. So, this was also not a good idea.

Then I applied my 99 things learning, Step away from keyboard : https://github.com/97-things/97-things-every-programmer-should-know/blob/master/en/thing_69/README.md

And got a new idea:

By default nugget looks for DLL file from Packages folder and if exist, it doesn’t download and uses it as a reference DLL. For example : Sitecore.Kernel.DLL can be found under <YOURPROJDIR>\packages\Sitecore.Kernel.NoReferences.9.0.180604\lib\NET462

This was Eureka moment. Where I thought to do this:

  1. Copy new DLL from Sitecore hotfix package and pasted it under
    <YOURPROJDIR>\packages\Sitecore.Kernel.NoReferences.9.0.180604\lib\NET462
  2. Committed : Packages folder and
    Sitecore.Kernel.NoReferences.9.0.180604\lib\NET462 folders
  3. That’s it!
  4. it worked on Local – Teamcity and Octopus!

This helped? You found better approach than this? I’m all ears!

Happy Coding! 🙂

Custom language for Sitecore Azure PaaS Web Apps

$
0
0

Challenge:

We are porting one of our client’s App from Older Sitecore version and infrastructure (IaaS) to Sitecore 9 and Azure Paas Web App.

They have 20+ languages and we learnt that they have few custom languages as well (en-TH, en-VN, en-ae). You might get excited and say, You can use : https://marketplace.sitecore.net/en/Modules/Custom_Language_Registration.aspx

But If you said so, Then you must’ve missed last line, App is on Azure PaaS web App. And Custom Language Tool is Windows desktop application. Which you can’t run on Azure web App. Interesting?

Wondering, How we resolved it? And you are also facing similar challenges? Then this post is for you.

Solution:

First of all, we did quick search and found following links:

This link found from first link is really nice read and confirms one thing THAT IT’S NOT POSSIBLE to do and then provokes some really good questions : https://blogs.msdn.microsoft.com/benjaminperkins/2018/06/11/implementing-custom-cultures-cultureinfo-localize-azure-app-service/

You cannot, at this moment, create a custom culture on an Azure App Service.  Cultures are part of the standard operating system and require changes to the registry to modify or add them.  An Azure App Service runs in a sandbox which does not allow code or script to modify the registry.  I do not work on the team responsible for this Windows feature, but I have confidence the team puts lots of diligence into providing the fundamental capabilities to match the requirements of most global cultures.

Second blog gave some good alternative solution using URL Rewrite.

But before we do that, We thought to see what all cultures and languages are available on Azure Web App  and was able to get that list. You can also download it from here : https://drive.google.com/open?id=1lmNoZPJRyvkTaAPo8dTMaEaM0VVidhdE

We couldn’t find exact language. But we found alternative languages, Which we could use for our Sitecore solution and after consulting with our client we used it! Reference list is as below:

  • en-TH -> th-TH
  • en-VN -> vi-VN
  • en-ae->ar-ae

Hope you found this helpful!


Sitecore 9 Compatible Cache Tuner

$
0
0

Challenge:

In ~9 years of Sitecore experience have been happy to contribute 8 modules on Sitecore Marketplace (If you are new to Sitecore world and not aware of this, then let me explain you — It is Sitecore’s Play Store [Android]/App Store [iOs] where anyone (Including you) can contribute any Sitecore module ):

Contributed modules

Out of these modules, Which modules I really feel proud of and Cache Tuner is one of that. The reason behind it is — It is still widely used by community and lot of community members have already recommended it in community. Thank you folks!

This was my first shared module : https://sitecorebasics.wordpress.com/2011/04/28/cache-tuner-my-first-shared-source-module/ As you can see it was on old platform trac and If you tried tuning Sitecore cache then you must have come across Cache Tuning guide which has some rules based on which you tune Sitecore caches. CacheTuner helps you automate that, Sounds interesting? Read Cache Tuner guide : https://sitecorebasics.wordpress.com/2011/04/27/cache-tuner-user-guide/

Recently, I was trying to use it for my current project which is on Sitecore 9.0.2 and as soon as I ran it I got error due to Sitecore’s changes in Caching API (Sitecore 8.2).

Changes are mainly done to support DI and that’s why none of the methods are returning concrete classes.

https://briancaos.wordpress.com/2018/10/31/sitecore-9-caching-sitecore-caching-cachemanager-getallcaches-changed-from-sitecore-8/

Solution:

I thought to spend time today to make it Sitecore 9 compatible, and you will be happy to know that now CacheTuner supports >=8.2 version. Needless to say, you have to rely on old CacheTuner for earlier versions. [You are still on older version? It’s time to upgrade :-)]

Have also created git repo for updated CacheTuner module : https://github.com/klpatil/CacheTuner

This is my Christmas gift for all of you, Have a Happy Holidays!

 


Troubleshoot and fix crashing Sitecore 902 Application on Azure App

$
0
0

Challenge:

Currently we are working for one of our client application, Which is on Sitecore 9.0.2 and deployed on Azure App. It was working fine for sometime and one fine day, post deployment application was not coming up. This was client’s QA environment and in lot of developers and QA team members were keenly looking up to us to resolve this ASAP. So, we can hit our sprint goal.

We tried the lot of options to make it up and running. But we could only see following page (503):

We tried to check logs. But nothing fruitful was found. DevOps team already had Azure ARM Template. So, we thought to install new environment from scratch and redeployed and that worked for a while. But after few days, Same issue happened on QA Environment.

Now, This was the time for us to generate a crash dump and analyze it [You also thought so?]. But then we realized that this is Azure App and DebugDiag won’t work here. Sounds interesting right? [Life is not as easy, as it seems to be]. But each challenge has solution in this world. And that’s true for this challenge as well. If you are also facing similar challenge or you are keen to know how we solved this, then this post is for you!

Solution:

  1. Quick google search suggested this post : https://kb.sitecore.net/articles/983839 we checked those things. But with no luck.
  2. Application insights also didn’t help : https://doc.sitecore.com/developers/90/sitecore-experience-management/en/analyze-sitecore-logs-with-application-insights.html
  3. Then we came across, Sitecore’s KB article for Advanced Troubleshooting on Azure App (Was not able to generate dump using it, It might be due to my overlook and few information seems not up-to-date [Azure Portal is always changing]) : https://kb.sitecore.net/articles/111669
  4. Then found this great article, Which gave me some hints : https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/app-service/troubleshoot-http-502-http-503.md

I decided to delve in to Azure Portal and based on what I learnt try something out (I will quickly remind you this is QA environment and roughly ~12 folks are affected by this and overall sprint plan/project plan.)

  • Selected Diagnose and Solve Problems, Which has a lot of interesting options as shown below (Diagnostic Tools is an option, Which I was looking for) – a.k.a. DaaS:
Diagnose and Solve Problems
  • When I clicked on “Memory Dump” [One of the sub option of Diagnostic tools]. It brought few more options:
  • Selected “Collect Memory Dump” option [Make sure you have selected ASP.NET in top]. As soon as you click on that Azure checks whether your tier has this service support or not? [Microsoft — One more opportunity to make money :). But they deserve with what they have done. And when your application is business critical and has impact on revenue, Then no harm in investing in this – it’s all business!]. Based on your tier you will see next screen. This is what I see:

Finally, We have Dump analysis report and this is what we found:

[[HelperMethodFrame_1OBJ] (System.Threading.Monitor.Enter)] System.Threading.Monitor.Enter(System.Object) Sitecore_Kernel!Sitecore.DependencyInjection.LazyResetable`1[[System.__Canon, mscorlib]].get_Value()+5e Sitecore_Kernel!Sitecore.Security.AccessControl.AccessRight.FromName(System.String)+34
Sitecore_Kernel!Sitecore.Security.AccessControl.ItemAccess.CanRead()+1c Sitecore_Kernel!Sitecore.Data.Managers.ItemProvider.ApplySecurity(Sitecore.Data.Items.Item, Sitecore.SecurityModel.SecurityCheck)+51 Sitecore_ContentTesting!Sitecore.ContentTesting.Pipelines.ItemProvider.GetItem.GetItemUnderTestProcessor.Process(Sitecore.Pipelines.ItemProvider.GetItem.GetItemArgs)+b3
Sitecore_ContentTesting!DynamicClass.(System.Object, System.Object)+f Sitecore_Kernel!Sitecore.Pipelines.CorePipeline.Run(Sitecore.Pipelines.PipelineArgs)+1e4 Sitecore_Kernel!Sitecore.Data.Managers.DefaultItemManager.GetItem(Sitecore.Data.ID, Sitecore.Globalization.Language, Sitecore.Data.Version, Sitecore.Data.Database, Sitecore.SecurityModel.SecurityCheck)+131 Sitecore_Kernel!Sitecore.Data.Managers.DefaultItemManager.GetItem(Sitecore.Data.ID, Sitecore.Globalization.Language, Sitecore.Data.Version, Sitecore.Data.Database)+93 Sitecore_Kernel!Sitecore.Data.Managers.ItemManager.GetItem(Sitecore.Data.ID, Sitecore.Globalization.Language, Sitecore.Data.Version, Sitecore.Data.Database)+9a Sitecore_Marketing_xMgmt!Sitecore.Marketing.Definitions.Outcomes.Data.ItemDb.ItemOutcomeDefinitionRepository..ctor(Microsoft.Extensions.Logging.ILogger`1, System.String, Boolean, Sitecore.Marketing.Definitions.Repository.IDefinitionRecordMapper`1)+345 Sitecore_Marketing_xMgmt!Sitecore.Marketing.Definitions.Outcomes.Data.ItemDb.ItemOutcomeDefinitionRepository..ctor(Microsoft.Extensions.Logging.ILogger`1, Sitecore.Marketing.IItemRepositoriesSettings, Sitecore.Marketing.Definitions.Repository.IDefinitionRecordMapper`1)+e4
[[DebuggerU2MCatchHandlerFrame]]


Other threads:
** Microsoft_Extensions_DependencyInjection_Abstractions!Microsoft.Extensions.Internal.ActivatorUtilities.GetServiceOrCreateInstance(System.IServiceProvider, System.Type)+21 Sitecore_Kernel!Sitecore.Configuration.DefaultFactory.CreateFromServiceProvider(System.Xml.XmlNode, Boolean)+1ae Sitecore_Kernel!Sitecore.Configuration.DefaultFactory.CreateObject(System.Xml.XmlNode, System.String[], Boolean, Sitecore.Configuration.IFactoryHelper)+8a Sitecore_Kernel!Sitecore.Configuration.DefaultFactory.CreateObject(System.Xml.XmlNode, System.String[], Boolean)+48 Sitecore_Kernel!Sitecore.Configuration.DefaultFactory.CreateObject(System.String, System.String[], Boolean)+27c Sitecore_Kernel!Sitecore.Configuration.DefaultFactory.CreateFromReference(System.Xml.XmlNode, System.String[], Boolean)+a6 Sitecore_Kernel!Sitecore.Configuration.DefaultFactory.CreateObject(System.Xml.XmlNode, System.String[], Boolean, Sitecore.Configuration.IFactoryHelper)+74 Sitecore_Kernel!Sitecore.Configuration.DefaultFactory.CreateObject(System.Xml.XmlNode, System.String[], Boolean)+48 Sitecore_Kernel!Sitecore.Configuration.DefaultFactory.GetInnerObject(System.Xml.XmlNode, System.String[], Boolean)+6d Sitecore_Kernel!Sitecore.Configuration.DefaultFactory.GetConstructorParameters(System.Xml.XmlNode, System.String[], Boolean)+a1 Sitecore_Kernel!Sitecore.Configuration.DefaultFactory.CreateFromTypeName(System.Xml.XmlNode, System.String[], Boolean)+5e Sitecore_Kernel!Sitecore.Configuration.DefaultFactory.CreateObject(System.Xml.XmlNode, System.String[], Boolean, Sitecore.Configuration.IFactoryHelper)+a3 Sitecore_Kernel!Sitecore.Configuration.DefaultFactory.CreateObject(System.Xml.XmlNode, System.String[], Boolean)+48 Sitecore_Kernel!Sitecore.Configuration.DefaultFactory.CreateObject(System.String, System.String[], Boolean)+27c Sitecore_PathAnalyzer!Sitecore.PathAnalyzer.ApplicationContainer.CreateObject[[System.__Canon, mscorlib]](System.String)+de Sitecore_PathAnalyzer!Sitecore.PathAnalyzer.ApplicationContainer.GetOrCreateProcessingPool(System.Guid ByRef)+29
**
Microsoft_Extensions_DependencyInjection_Abstractions!Microsoft.Extensions.Internal.ActivatorUtilities.GetServiceOrCreateInstance(System.IServiceProvider, System.Type)+21 Sitecore_Kernel!Sitecore.Configuration.DefaultFactory.CreateFromServiceProvider(System.Xml.XmlNode, Boolean)+1ae Sitecore_Kernel!Sitecore.Configuration.DefaultFactory.CreateObject(System.Xml.XmlNode, System.String[], Boolean, Sitecore.Configuration.IFactoryHelper)+8a Sitecore_Kernel!Sitecore.Configuration.DefaultFactory.CreateObject(System.Xml.XmlNode, System.String[], Boolean)+48 Sitecore_Kernel!Sitecore.Configuration.DefaultFactory.CreateObject(System.String, System.String[], Boolean)+27c Sitecore_Kernel!Sitecore.Configuration.DefaultFactory.CreateFromReference(System.Xml.XmlNode, System.String[], Boolean)+a6

After analyzing all stacktraces we concluded that, it is mainly in Sitecore Stack, and then we raised a Sitecore support ticket and shared all relevant information with them.

Sitecore support team were able to rectify the issue in a day and get back to us with following information:

Please use the following hotfix to resolve the issue:
https://dl.sitecore.net/hotfix/SC Hotfix 235278-2 CMS.Core 11.1.2 ContentSearch 3.1.2.zip
To install the hotfix open the archive and follow instructions in the readme.txt file.

The issue is scheduled to be fixed in next Sitecore release.
To track the future status of the issue please use reference numbers 228602, 218852, 208222, 209972

Sitecore has accepted that 9.0.2 has this BUG and it is in Core architecture. That’s why Sitecore.Kernel and Sitecore.ContentSearch DLLs has been updated and shared with us.

Support package has steps to install hotfix using Sitecore Installation Wizard. But as our application was down and we couldn’t see any screen. We extracted Hotfix package and copied files in relevant directory.

It has a step to do Config changes manually. But was able to create patch file out of those steps [It was not straightforward, And I think that’s why SC Support team gave us manual steps]. Sharing Patch file with you.

Hope you found this post helpful!

 

 

Cache Tuner V2

$
0
0

Hello Everyone, Sorry for being away for a while. I got busy due to personal and professional commitments. But I’m back with lot of new learnings which I’ve planned to share with you.

Cache Tuner is one of my favorite modules [Widely accepted and appreciated by Sitecore community – Thanks for your appreciation, It motivates me to work on weekend to update this module instead of watching India-Australia match 😉], and thought to update it to handle few of the following use cases:

  1. Sitecore 9.1 Compatible : As you know, Sitecore made big architectural changes in Version 8.2 to make Sitecore caching much more better and extensible. But it broke few tools like CacheTuner and so others. In December, updated Cache Tuner to use new API : https://sitecorebasics.wordpress.com/2018/12/25/sitecore-9-compatible-cache-tuner/ While I was working on Cache Tuner V2, Thought to validate it on my Sitecore 9.1 Instance to make sure it works — And it indeed works! So, I have done all my validation on Sitecore 9.1. So, you can try with your new 9.1 instance with confidence. But please remember – If you find something new, Please report it on github or create PR with fix 🙂
  2. Drill down cache and clear specific cache : Since childhood, I’ve been always curious to know – How stuff works? (I’m sure for most of you as well, that’s why you are in this field). Same has been true for Sitecore Caching as well. As you know Sitecore caching uses same structure like HashTable. Where you have Key – Value pair. Along with that, Sitecore also has nested Hashtable. Which means one Key’s Value will also have another hashtable with Key – Value. At times when you are troubleshooting caching challenges, You must have thought of this. Is this caching issue or not? And to do that, Usually, what you do is, Use Sitecore Admin cache page to clear all cache and if it fixes the issue. Then it’s caching issue else it is something else. Sounds similar? You can do this on lower environment. But what if you must do same thing on production environment? During that you must be thinking. What If:
    1. I can see what’s inside each cache entry e.g. Click on YOURSITE[HTML] and see whether component which you are trying to troubleshoot exists or not in that list. I can clear specific Cache instead of FULL Cache e.g. You can just clear YOURSITE[HTML] cache and see whether it fixes your issues or not, Without affecting other caches. If you got excited and say — I know there’s module in marketplace which does exactly same thing – Then I would say cool down, as I also had same excitement, with this module : https://marketplace.sitecore.net/en/Modules/S/Sitecore_Cache_Admin.aspx Which I used a lot, And would like to Thanks this Module Admin. As this feature of Cache Tuner V2 is inspired from this module. But this module is not updated to support new Caching API Changes. Now, All above things are possible with CacheTunerV2 — I believe, This feature will be super helpful to community. And I’m excited to know your feedback on this.
  3. Clear all cache : Instead of relying on Cache Admin page, you can do it using CacheTuner page [Note : Please make sure you delete your cache tuner page, as soon as you are done with your Caching Tuning and troubleshooting. As CacheTuner page is not yet secure page]

Sounds exciting? And curios to know more about this. Let’s do it:

Screenshots:

Clear all Button
If Cache key has value, Then it will be clickable. If you would like to drill down and see what’s inside — please click desired cache key. Which will open Cache Detail page in new window with details of clicked cache key.
Cache detail page for website[html] cache key looks like this. #1 – Shows total number of cache entries stored in clicked cache, #2 – Cache details – In this example it is showing you how HTML Cache is getting stored for each component. #3 – Using “Clear Me!” button you can click particular cache. In this example website[html]

How to use it?

  1. Download from Cache Tuner V2 release : https://github.com/klpatil/CacheTuner/tree/CacheTunerV2 (Take a note of CacheTunerV2 branch and you can refer Release section : https://github.com/klpatil/CacheTuner/releases/tag/CTV2.0)
  2. Copy it under your desired folder. I recommend to have everything under CTV2 folder e.g. Webroot/MyTools/CTV2/* (All Cache Tuner v2 files in same folder)
  3. Access Cache Tuner V2 as per your copied folder e.g. https://<mysite>/mytools/ctv2/cachetuner.aspx
  4. That’s it – Fix you Caching issue and go home, your loved ones are waiting for you!

Hope you found this useful, There are few useful features in my roadmap. Thought to share with you. In case, you want to contribute to module.

Future release:

  1. Add Authorization
  2. Drill down cache details for all types, as of now it only supports few caching types only. And it should handle most of the use cases.
  3. Clear specific cache entry – As of now you can’t clear specific cache entry. You can clear specific cache container. e.g Instead of clearing website[html] would like to have a feature to clear cache entry which is inside website[html]
  4. Anything I missed? I’m all ears!

Old links:

https://sitecorebasics.wordpress.com/2011/04/27/cache-tuner-user-guide/

Thank you so much for reading!

SolrCloud with Sitecore troubleshooting

$
0
0

Challenge:

Recently we launched highly scalable Sitecore Projects for few of our Enterprise level Sitecore clients. And during that faced some challenges with SolrCloud. Which I again faced in last week and thought to share it pen down. So, I can share with you and I can also refer, When I face it again.

Solution:

So, If you are new to Sitecore or haven’t worked with Solr or SolrCloud and need some basic knowledge. I will share few great articles already posted by our community members:

Above articles are good to get basic knowledge, Once you have that and If you are keen to set it up in ensemble (Dictionary : a group of musicians, actors, or dancers who perform together.)mode. Ensemble mode means — Imagine your Sitecore application is your concert happening on the web and to make sure you have great concert. Three Solr nodes are performing together! For Setup there are few links. But I found following links super helpful:

Once your setup is done, It will look like this:

sitecore solrcloud
Solr cloud setup – Image courtesy : https://github.com/ivanbuzyka/Sitecore.SolrCloudConfiguration/wiki

So far so good. And lot of folks can get setup done. But as soon as you connect with Sitecore. You might come across some challenges in your day to day life working with SolrCloud. If they come they are hard to troubleshoot as they are in JAVA Tech Stack, Which will be tough for any Sitecore Developer – As they are different Tech Stack. Also, at times those errors are hard to decrypt and at times hard to locate as well. Here are my learnings which might help you, When you face challenges with SolrCloud and Sitecore.

Scenario#1

After few days of connecting to SolrCloud and couple of weeks before go-live. Our Sitecore log files were busy with follwoing errors:

2019-03-26T15:58:40 PID[4988] Error ManagedPoolThread #5 15:58:40 ERROR 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.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj)
at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args)
at (Object , Object )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
at Sitecore.Jobs.Job.DoExecute()
at Sitecore.Jobs.Job.ThreadEntry(Object state)

Nested Exception

Exception: SolrNet.Exceptions.SolrConnectionException
Message: The underlying connection was closed: The connection was closed unexpectedly.
Source: SolrNet
at SolrNet.Impl.SolrConnection.PostStream(String relativeUrl, String contentType, Stream content, IEnumerable1 parameters) at SolrNet.Impl.SolrConnection.Post(String relativeUrl, String s) at SolrNet.Impl.SolrBasicServer1.SendAndParseHeader(ISolrCommand cmd)
at Sitecore.ContentSearch.SolrProvider.SolrBatchUpdateContext.AddRange(IEnumerable1 group, Int32 groupSize) at Sitecore.ContentSearch.SolrProvider.SolrBatchUpdateContext.Commit() at Sitecore.ContentSearch.AbstractSearchIndex.PerformUpdate(IEnumerable1 indexableInfo, IndexingOptions indexingOptions)

Nested Exception

Exception: System.Net.WebException
Message: The underlying connection was closed: The connection was closed unexpectedly.
Source: System
at System.Net.HttpWebRequest.GetResponse()
at HttpWebAdapters.Adapters.HttpWebRequestAdapter.GetResponse()
at SolrNet.Impl.SolrConnection.GetResponse(IHttpWebRequest request)

This was happening on each CRUD operation — Which is logical. As you know Sitecore triggers partial index rebuild on each CRUD operation. We invested huge amount of hours on this and then finally, we learnt that Solr and ZK servers were not running on HTTPS. How to find and fix that? Here we go:

  1. You go to each of your ZK files and make sure your ZK Configurations are correct – Especially hostnames, and respective entries should be there in host files and make sure ZK is registered to run on HTTPS (See Step #7 – zkcli -zkhost “10.100.1.10:2181,10.100.1.11:2181,10.100.1.12:2181” -cmd clusterprop -name urlScheme -val https) : https://github.com/ivanbuzyka/Sitecore.SolrCloudConfiguration/wiki/3.-Install-Zookeeper-as-a-service
  2. Make sure your Solr is configured to run on HTTPS — Two things to check Solr hostname (SOLR_HOST – They should be different for each Solr) and Certificate entries.
  3. Make sure ports and firewalls are open : https://github.com/ivanbuzyka/Sitecore.SolrCloudConfiguration/wiki/Ports-and-firewalls-etc
  4. Few troubleshooting tips : it is hard to pin point SolrCloud challenges. Following tips might help you in that.
    1. Run each SolrCloud and ZK Instance separately — Which means don’t do ensemble mode. Just have one Solr and ZK entry and run it. Start ZK and Solr using Command prompt. So, you can see what’s going on behind the scenes – Few commands:
      1. solr start -cloud -p 8983 -z “10.100.1.11:2181” -f – To run Single Solr with ZK. Make sure your ZK has only single entry and is up and running. Open individual Solr URL and ensure it works in isolated mode.Do this for each instance and if all good, then and only then run it in isolated mode. When you run in ensemble mode. Look for Leader and follower values in command prompt : http://amrutbudihal.blogspot.com/2012/07/zookeeper-leader-election-and-group.htmlCommon problem – Which I have seen is – ZK is not registered to run in HTTPS mode — (Which happens from this command : zkcli -zkhost “10.100.1.10:2181,10.100.1.11:2181,10.100.1.12:2181” -cmd clusterprop -name urlScheme -val https). How to check ZK is running in HTTPS mode or not?: (Good reference : https://www.searchstax.com/docs/hc/zkcli-zookeeper-searchstax.html)
        1. Execute “zkcli.bat -z “ZKIP:ZKPORT” -cmd list from one of the server – As shown below and look for “urlScheme” value. if your ZK is on HTTPS. Then you should see HTTPS here. Do it for all other ZK. This command also ensures your network and firewall is allowing communication between each ZK nodes.†

Scenario #2

After fixing above error, noticed following error in log file:

2019-03-30T15:16:37 PID[7596] Error 18068 15:16:37 ERROR The remote name could not be resolved: ‘uat1-solrcloud.scbasics.com’
Exception: SolrNet.Exceptions.SolrConnectionException
Message: The remote name could not be resolved: ‘uat1-solrcloud.scbasics.com’
Source: SolrNet
at SolrNet.Impl.SolrConnection.Get(String relativeUrl, IEnumerable1 parameters) at SolrNet.Impl.SolrCoreAdmin.Status(String coreName) at Sitecore.ContentSearch.SolrNetExtension.Cloud.DefaultReplicaStatusProvider.GetReplicaStatus(Replica replica) at Sitecore.ContentSearch.SolrProvider.SolrCloudIndexSummary.GetReplicaIndex(Replica replica) at System.Linq.Enumerable.<>c__DisplayClass7_03.b__0(TSource x)
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Linq.Enumerable.Sum(IEnumerable1 source)
at Sitecore.ContentSearch.SolrProvider.SolrCloudIndexSummary.get_NumberOfDocuments()
at Sitecore.ContentSearch.Client.Forms.IndexingManagerWizard.BuildIndexCheckbox(String name, String header, ListString selected, ListString indexMap)

Nested Exception

Exception: System.Net.WebException
Message: The remote name could not be resolved: ‘uat1-solrcloud.scbasics.com’

Luckily this one was easy, This is known issue and don’t have any functional impact, It will not show you document count etc. Information in Sitecore indexing manager : https://sitecore.stackexchange.com/questions/8263/object-reference-error-in-sitecore-contentsearch-solrprovider-solrindexsummary-g

In Summary, As all other things ZK and SolrCloud are not rocket science. You just need to know right tools, right commands, right mindset and above all great patience to troubleshoot this. Hope this post helps you go home on time!

Thanks to my colleague Abhishek from whom I learnt few of these things and Thanks to Google as well!

Sitecore Geolocation Basics

$
0
0

Challenge:

Sitecore Geolocation service is OOTB and available for free with unlimited lookups. And lot of great community folks have shared in-depth articles to get started. But still have seen people facing challenges with Geolocation. So, wanted to consolidate all good resources and real-world challenges in this post. So, it helps you have a smooth process of getting started with Sitecore Geolocation service.

Solution:

If you are new to Sitecore Geolocation and would like to know more about it. e.g. Why? What and How? As I mentioned earlier, few community folks have done great job blogging about it. I will share few of those here:

How can I activate Geolocation?

With Sitecore 9, Geolocation is available OOTB. You just need to activate it from App Center. For that you have to login to App Center. To login and activate, you need to either use same email address which you used for purchasing your Sitecore license or contact your Sitecore contact, and s(he) will give you one Form (PDF) using which you can allow other user to access App Center.

Once you login and activate Geolocation from Appcenter. You should be all set. If your environment is scaled, you just need to get this activated from CM only.

You need to do this one-time activity for all your environments e.g. INT/QA/UAT/STAGE/PROD.

No Geolocation data on first request

Sitecore Geolocation works asynchronously, due to that at times you might not see geolocation data on first request/for new IP, Which is not in cache.

Sitecore GeoIP logic
Geolocation flow (Image Courtesy : https://www.brimit.com/blog/sitecore-geoip-geolocation-module-how-it-works )

Sitecore community has few solutions for this challenge:

  1. https://kb.sitecore.net/articles/320734 : Here solution1 uses delay logic — Which personally, I would like to avoid for heavy traffic website. Solution2 suggests using Custom provider.
  2. https://www.brimit.com/blog/sitecore-geoip-geolocation-module-how-it-works : Brimit team, has done a great job and created Fallback module. Which seems derived from Solution2 suggested in last article. We’ve used this for one of our client — And it’s working fine!
  3. https://www.redmoon.london/sitecore-ip-geolocation-service-resolving-geoip-information-on-the-first-request-using-circuit-breaker-design-pattern/ : Recently came to know about this approach — Which is using Circuit breaker approach. I haven’t personally tried this. But good to explore.

How to troubleshoot?

Sitecore geolocation works fine in lower environments. But as soon as you go on higher environments, you start noticing that it doesn’t work. Few of the reasons behind that are:

  1. Application Gateway
  2. Load balancer
  3. Reverse proxy
  4. Corporate Proxy
  5. Firewall

Your Production environment will have either/all of the above things and they might cause trouble in overall working mechanism of Geolocation.

For any troubleshooting you need right tools. Let me share few of those:

  • https://kb.sitecore.net/articles/798498 : Sitecore has done good job documenting all the steps. Especially TestIP.aspx page. Use this to do quick test of geolocation configuration.
  • https://gist.github.com/klpatil/d4c5d242b715ac8c6213366e85be585c : I have also created GeoLocation Test page, which prints Geolocation information, all request headers. Here, you need to closely observe — X-Forwarded-For header. It should have Client’s IP address. How to check that?
    • Open https://www.whatismyip.com/ and take a note of IPV4 address.
    • Now. Open GeolocationTest page and IPV4 address should be value for X-Forwarded-For header. If it’s not – Then something is not rightly configured.

Let’s understand about each possibility and solution:

This image depicts this challenge nicely (Image Courtesy : https://mikael.com/2018/09/sitecore-x-forwarded-for-handling/)

Hope this helped, Have I missed scenario which you faced? Please share, I will amend it in this post.

Happy Geo-locating! 🙂

Does your Sitecore Azure App Index rebuild got stuck?

$
0
0

Challenge:

For one of our solution, Index rebuild was getting stuck after deployment (Jobs.aspx will show sitecore_Web_index is running since hours and it won’t complete till you restart and rebuild again). It never happened for other clients. One thing about this solution was it was on Azure App.

Solution:

As you do, We also did quick google search and found good posts around same topic. But neither of it was helpful.

So, we started digging more on our own.

Our solution was having Solr Switching configurations. So, we thought to check some records in Core DB. Want to know more about it? This post explains it nicely : https://sitecoresaga.wordpress.com/2016/02/27/solr-index-changing-existing-solr-index-configuration-to-point-to-a-new-collection/

  • From KUDU – We found out MachineName
  • Fired following query against Core DB:
  • We noticed lot of duplicate entries. Which we were not expecting to see.

We reached out to Sitecore and they suggested us to change Instance name setting to use custom name instead of default (Which is combination of website and machine name): <setting name=”InstanceName” value=”” />. We set this value to MYCLIENT-VM on our CM Server and this fixed issue!

How?

As you know Sitecore Web Apps are Azure Web Apps and Azure spins up new VM and swaps it on the fly. Which means your machine name will change. And Sitecore EventQueue relies a lot on Instance name value. Read this nice post to know more about EventQueue : https://www.geekhive.com/buzz/post/2018/02/sitecore-event-queue-visual-diagram/

Sitecore 91 Azure PaaS Identity service error

$
0
0

Challenge:

Recently we were trying to setup Sitecore 9.1 (XP Single) on Azure PaaS with Sitecore’s ARM Template : https://github.com/Sitecore/Sitecore-Azure-Quickstart-Templates/tree/master/Sitecore%209.1.1/XPSingle

We were able to run setup successfully. But post login, it was showing blank screen. Instead of Sitecore Launchpad.

And we noticed following error on Identity server:

019-08-05T21:02:26.6633964+00:00 [FTL] (Sitecore STS/RD0003FF6419BC) Unhandled exception: “IDX10630: The ‘[PII is hidden by default. Set the ‘ShowPII’ flag in IdentityModelEventSource.cs to true to reveal it.]’ for signing cannot be smaller than ‘[PII is hidden by default. Set the ‘ShowPII’ flag in IdentityModelEventSource.cs to true to reveal it.]’ bits. KeySize: ‘[PII is hidden by default. Set the ‘ShowPII’ flag in IdentityModelEventSource.cs to true to reveal it.]’.
Parameter name: key.KeySize”
System.ArgumentOutOfRangeException: IDX10630: The ‘[PII is hidden by default. Set the ‘ShowPII’ flag in IdentityModelEventSource.cs to true to reveal it.]’ for signing cannot be smaller than ‘[PII is hidden by default. Set the ‘ShowPII’ flag in IdentityModelEventSource.cs to true to reveal it.]’ bits. KeySize: ‘[PII is hidden by default. Set the ‘ShowPII’ flag in IdentityModelEventSource.cs to true to reveal it.]’.
Parameter name: key.KeySize
   at Microsoft.IdentityModel.Tokens.AsymmetricSignatureProvider.ValidateAsymmetricSecurityKeySize(SecurityKey key, String algorithm, Boolean willCreateSignatures)
   at Microsoft.IdentityModel.Tokens.AsymmetricSignatureProvider..ctor(SecurityKey key, String algorithm, Boolean willCreateSignatures)
   at Microsoft.IdentityModel.Tokens.CryptoProviderFactory.CreateSignatureProvider(SecurityKey key, String algorithm, Boolean willCreateSignatures)
   at Microsoft.IdentityModel.Tokens.CryptoProviderFactory.CreateForSigning(SecurityKey key, String algorithm)
   at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.CreateEncodedSignature(String input, SigningCredentials signingCredentials)
   at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.WriteToken(SecurityToken token)
   at IdentityServer4.Services.DefaultTokenCreationService.CreateJwtAsync(JwtSecurityToken jwt)
   at IdentityServer4.Services.DefaultTokenCreationService.CreateTokenAsync(Token token)
   at IdentityServer4.Services.DefaultTokenService.CreateSecurityTokenAsync(Token token)
   at IdentityServer4.ResponseHandling.AuthorizeResponseGenerator.CreateImplicitFlowResponseAsync(ValidatedAuthorizeRequest request, String authorizationCode)
   at IdentityServer4.ResponseHandling.AuthorizeResponseGenerator.CreateHybridFlowResponseAsync(ValidatedAuthorizeRequest request)
   at IdentityServer4.ResponseHandling.AuthorizeResponseGenerator.CreateResponseAsync(ValidatedAuthorizeRequest request)
   at IdentityServer4.Endpoints.AuthorizeEndpointBase.ProcessAuthorizeRequestAsync(NameValueCollection parameters, ClaimsPrincipal user, ConsentResponse consent)
   at IdentityServer4.Endpoints.AuthorizeCallbackEndpoint.ProcessAsync(HttpContext context)
   at IdentityServer4.Endpoints.AuthorizeCallbackEndpoint.ProcessAsync(HttpContext context)
   at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events)
2019-08-05T21:02:26.6665182+00:00 [ERR] (Sitecore STS/RD0003FF6419BC) Connection id “”0HLOPSKHN4OKD””, Request id “”0HLOPSKHN4OKD:00000005″”: An unhandled exception was thrown by the application.
System.ArgumentOutOfRangeException: IDX10630: The ‘[PII is hidden by default. Set the ‘ShowPII’ flag in IdentityModelEventSource.cs to true to reveal it.]’ for signing cannot be smaller than ‘[PII is hidden by default. Set the ‘ShowPII’ flag in IdentityModelEventSource.cs to true to reveal it.]’ bits. KeySize: ‘[PII is hidden by default. Set the ‘ShowPII’ flag in IdentityModelEventSource.cs to true to reveal it.]’.
Parameter name: key.KeySize

If you are also facing similar issue or noticing same error, then this post may have a solution for you.

Solution:

To troubleshoot this further, we had to look at each role to find out what was going on under the hood:

  1. CM Server:
    1. Logs : We were not able to find anything useful. Config file : We checked Config file here \App_Config\Sitecore\Owin.Authentication.IdentityServer\Sitecore.Owin.Authentication.IdentityServer.config and it also had nothing suspicious.
  2. Identity Server :
    1. We could see above listed error in Identity server’s log

It was tough to decrypt that error. Because it’s not general stack trace. So, thought to do quick google search and found only one link, which was related to Sitecore.

Once we couldn’t find anything. We thought to reach out to Sitecore and they were able to help us.

This is what Sitecore support shared:

Looking at the exception it seems the same issue reported here:
https://github.com/IdentityServer/IdentityServer3/issues/2845

In order to solve it you will need a new certificate with 2048 bits key length.

We checked our Certificate and it was using 1024 bits. And as soon as we generated new certificate with 2048, reinstalled Sitecore app and we were able to fix this error.

One more thing — When you delete app from portal. It doesn’t clean certificate. So, before redeploying your app with new certificate. Please make sure all old certificated are deleted.

Hope this helps!

NullReferenceException when trying to load Coveo indexes in Indexing Manager

$
0
0

Challenge:

After successful configuration of Coveo instance, We thought to add Coveo transform files in our deployment process and do deployment.

As soon as we did deployment we started noticing following Stacktrace:

120 13:19:48 ERROR [Sitecore Services]: HTTP GET URL https://scbasics/coveo/api/index/v1/indexes   Exception System.NullReferenceException: Object reference not set to an instance of an object.  at Coveo.SearchProvider.AbstractSearchIndexSummary.<get_NumberOfDocuments>b__42_1()  at Coveo.SearchProvider.AbstractSearchIndexSummary.TryPerformCallToIndexCommunication[T](Func`1 p_CallToIndexCommunication, T p_DefaultValue) .................................................................System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()  at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)  at System.Linq.Enumerable.ToList[TSource]System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown ---

If you are already facing this error and trying to find a solution. Then this post might help you.

Solution:

  • We also checked Coveo Diagnostics page, and it was showing all green.
  • Command center was not showing list of indexes
  • Sitecore log file was showing above stack trace for each Command center screen load
  • As you do, we also did quick google search and came across this post from my colleague – Dan S.

https://connect.coveo.com/s/question/0D50d00006UQwvjCAD/nullreferenceexception-when-trying-to-load-indexes-in-indexing-manager

We checked all our config files. But we haven’t found anything suspicious.

After spending lot of time, we could figure this out. After looking at log file from start — We found following entry:

As soon as we seen this, We thought to check Coveo admin user (We recommend different user for Coveo) was locked out somehow.

This might have been locked out due to deployment errors/transformation errors. But stacktrace what we seen in staring of this post didn’t help us pin point that.

So, It is good to check full log file. As there are few main errors will happen during Initialization only.

Special thanks to Varun to work along with me to troubleshoot this.


Coveo for Sitecore (C4S) Quick Start guide

$
0
0

Challenge:

Your client/your company has got Coveo for Sitecore license and you have to get your Coveo implementation done. And you have few of the following questions:

  • How to approach?
  • Does Coveo replaces Solr/AzureSearch?
  • Coveo for Sitecore setup is complex?
  • Coveo is on Cloud only?
  • How much development time it takes? I must develop everything on my own?
  • Can I have Coveo on premise setup?
  • From where I should start?

Then this post is for you only!

Solution:

Before I go in step by step approach let me try to answer few of the above common questions:

  1. Coveo doesn’t replace Solr/AzureSearch/Lucene [If you are still using Lucene]. Even if you have Coveo you will need to use Solr/AzureSearch because Sitecore still relies on it. Also, for some of the functionality which doesn’t need Machine learning and relevance based tuning capabilities. Would strongly recommend not to use Coveo. But use Solr/AzureSearch. As Coveo has query limits and Coveo is not right fit for those kinds of needs.
  2. Coveo for Sitecore is only available on Cloud — Coveo has stopped giving on premise version any more. Coveo for Cloud setup is straight forward and in cloud.

I hope these answers few of your basic questions. You have more? please drop a note in comment section of this post.

Have been involved in few of the Coveo for Sitecore implementations and based on my learning came up with my approach towards starting Coveo project.

Before you delve further, I’m not Coveo Guru. And following list is just few pointers based on my learning. Hope it works for you as well. And I encourage you to amend to this list. So, someone can have smooth start on Coveo as you had

For saving my keystrokes, As I’ve also limited keystrokes left : https://keysleft.com/ instead of writing Coveo for Sitecore, I will mention C4S. They both are same.

Let’s delve in to this:

Hope you found this information helpful. If yes, then Thanks to Coveo team, Few awesome community members for all such helpful material for someone to get started.

Everything has been there already. This post has just indexed all the information in single post — Like Coveo does with your data!

Happy Coveo Implementation! 🙂

Featured image credits : https://blog.coveo.com/coveo-for-sitecore-5-the-ultimate-search-recommendations-engine-for-sitecore/

Module : Hotfix Checker (HFC)

$
0
0

Challenge:

As a Developer/Architect you always want to make sure your Sitecore app has latest and greatest hot fixes deployed.

Hot fixes are part/heart of any product. Sitecore being enterprise level CMS and with this IaaS/PaaS/Micro service world. New scenarios gets identified which introduces one new hotfix.

Over the years, community has identified that it’s tough to be in sync with all Sitecore hot fixes for your current solution. At the same time, you don’t want your team to spend N number of hours investigating something which is already identified by Sitecore team and they already have hot fix out there.

To solve this challenge Sitecore team, came up with an idea of Github repository : https://github.com/SitecoreSupport

But it was still tough to search and locate any particular hot fix which applies to your Sitecore version. https://twitter.com/MariaBorhem and https://twitter.com/bramstoopcom identified this challenge and they came up with https://www.sitecorehotfixversionselector.com/ using this URL, you can search and check all available Sitecore hot fixes. It also has RSS Feed. Which is being plugged in Sitecore Slack’s #hotfixfeed channel.

One fine morning, I was thinking to simplify this further. I wanted someone to do automatic comparison for my Sitecore version and tell me the result. You also think the same? Then Hotfix checker [a.k.a. HFC] is for you!

Solution:

  • HFC simplifies all steps, which you as a human will do to compare your installed hot fixes and Sitecore’s recommended hot fix.
  • This is how result looks like:
HFC V 1.0

Curious to try this out? Please visit : https://klpatil.github.io/HotFixChecker/

I would like to give a huge shout out and lot of credits to Maria and Bram for simplifying data and providing me feed to access this data – Thank you, Thank you, Thank you folks!

Have a bug free Sitecore application!

Sitecore Package Deployer (SPD) learnings

$
0
0

Challenge:

We love automation, I hope you too! If you/your company culture, don’t have time to automate then following is a good read:

https://97-things-every-x-should-know.gitbooks.io/97-things-every-programmer-should-know/content/en/thing_78/

Image result for we are busy

As you know in Sitecore eco system, Templates/Layouts/Rendering/Items are as critical and important as your code files.

There are few ways to automate Sitecore Items deployment. We have been relying on SPD – Sitecore Package Deployer.

It just works! But recently we faced two nice challenges with it and this post is about those challenges and our approach towards solving it.

Eager to know more about it? Let’s read:

Solution:

Package installation order

Generally, we generate 3 update packages out of our 3 TDS solution:

  1. TDS.Core : Core DB related item updates.
  2. TDS.Master : Master DB related item updates, Excluding Content section.
  3. TDS.Master.Content : Master DB related item updates, Only Content section.

During deployment, we used to face one challenge that at times, TDS.Master.Content update package will install before TDS.Master update package. In other words, Item will be installed first it’s template.

Unfortunately, there is no easy way to control this using SPD. We tried options and out of that following solution has worked for us:

With the help of SPD Team, we learnt that SPD installs packages in alphabetical order.

We used that learning to solve our challenge. We prefixed “A”, “B”, “C” for our TDS packages in TDS’s Update Package configuration.

TDS Update Package Configuration

After above configuration, TDS Update package names were:

  1. A.TDS.Core.update
  2. B.TDS.Master.update
  3. C.TDS.Master.Content.update

During our research we also came across, Package bundling : http://hedgehogdevelopment.github.io/tds/chapter4.html#package-bundling – This is something we haven’t tried. But this should also solve problem. Will leave this for your brevity to try this!

And that fixed our ordering issue! 🙂 But wait – Is life that easy? It’s not – We faced another challenge. Which is mentioned below.

Sync Package Installation :

We have XP Scaled environment, Where CM and CD is isolated and our Octopus deployment has following steps:

  1. Deploy TDS Update packages on CM Environment : Deploys update package on CM Environments under SPD folder.
  2. Wait for TDS Update package installation : There is no easy way to monitor update package installation. So, there was some configured wait time in power shell before going to next step.
  3. Perform Sitecore publish : Triggers Sitecore publish.

Above process works perfectly fine for few items. But as items grew it was hard to configure accurate “Wait time” for step#2. At times, Sitecore publish used to get triggered even step #2 was not completed.

We did a quick search to solve this problem and we found this post : https://sitecorerap.wordpress.com/2017/09/26/synchronous-deployments-with-sitecore-package-deployer/

As you can see from above post, it suggests updating few core DLLs. Which we wanted to avoid.

After some research we came up with following option:

  1. We disabled this agent : “<agent type=”Hhogdev.SitecorePackageDeployer.Tasks.InstallPackage, Hhogdev.SitecorePackageDeployer” method=”Run” interval=”00:01:00″/> “ which will not install package automatically.
  2. We added a octopus step which does following things:
    1. It triggers Update package install using this URL : [YourSite]/sitecore/admin/StartSitecorePackageDeployer.aspx [You can also call it with force parameter : [YourSite]/sitecore/admin/StartSitecorePackageDeployer.aspx?force=1] – This post explains this nicely : https://prcode.blog/2018/08/08/quick-tips-for-the-sitecore-package-deployer/ – At times we have been noticing failure. So, we used force parameter and it helped us make this process stable!
    2. SPD generates “JSON” file for each update package. As soon as package installation is done. And adds status “success”/”failure”. Our PS Script monitors this and it will keep monitoring till all packages are installed and their respective JSON files are created. If all are success then it proceeds to next step, which is Sitecore publishing else it aborts Octopus deployment process.[Credits : https://twitter.com/vyas_manglesh]

Above solutions helped us stabilize our Sitecore item deployment process. Hope it does for you as well! You do it differently and more efficiently? Why don’s share with world? Blog it!

Happy Deployment! [Go home, your loves ones are waiting for you!]

Sitecore Publishing Service Nirvana

$
0
0

Challenge:

Recently SUGNCR team provided (Thank you team!) me an opportunity to share my learnings on “Sitecore Publishing Service (SPS)”.

This year – I’ve used all power of SPS for our Enterprise clients. And the more I used it the more I love it. Have come across few common questions/myths from Sitecore community folks. During this webinar was I’ve attempted to answer all those basic questions and make your SPS on-boarding as smooth as possible.

Eager to get hold of it? Let’s delve into it.

Solution:

  • You can watch Webinar from here :

It also has nice story which will help you understand why we need Sitecore publishing service.

Read from Left to right

Hope this helps you!

Happy Sitecore publishing! 🙂

Have you noticed OOTB Sitecore Diagnostics Service (Beta)?

$
0
0

Recently, I was trying to generate Sitecore Support Package using SSPG.

Which looks like following on last step:


Following screen got revealed as soon as I clicked on Done button.

In past, I’ve used SDT (Sitecore Diagnostics Tool) in the past for validating Sitecore instance (I’m sure you as well). But after Azure Web Apps you can’t install SDT. SDS latest version has reesolved this issue, where you can provide SSPG generated package to SDT as input and same analysis will be done by SDT.

As always Sitecore team has gone one step further to SDT as part of Sitecore Support Package generator admin page. When you click on “Agree and Continue”, Tool will upload SSPG Package and provide you analysis report. Which looks like following — Which is Standard SDT report.

Hope this makes your diagnostics faster – Thank to Sitecore!

Viewing all 178 articles
Browse latest View live