Monday, December 23, 2024

Resolving Sitecore CLI Issues Post-Upgrade: A Professional Insight

Hello All,

Following up on my previous blog post regarding the recent upgrade, I encountered several issues. One significant problem was related to the Sitecore CLI login, which functioned correctly; however, I faced errors during the "push" or "pull" operations:

Issue Description

We utilize customizations that authorize via the Content Management (CM) server instead of the Identity Server. To accommodate this, we added a custom processor patch to place our processor after SkipContextItemResolutionWhenGraphQLRequest:

patch:after="processor[@type='Sitecore.Services.GraphQL.Hosting.Mvc.Pipelines.HttpRequestBegin.SkipContextItemResolutionWhenGraphQLRequest, Sitecore.Services.GraphQL.NetFxHost']"

Post-upgrade, this stopped working. Despite extensive log reviews, we found no useful information. However, by adding the parameter --trace | Out-File "log.txt" during login and for push/pull commands, we obtained additional insights.

Investigation and Findings

After considerable investigation, we discovered changes in the processor sequence from Sitecore 10.1 to 10.4. We reached out to Sitecore support and received the following response:

"We tracked down the processor order change, which was implemented to improve performance. This affects the logic of CompositeDataProvider, specifically. The change was introduced in 10.3.

Please ensure that custom processors are placed before the TransferRoutedRequest processor but after the UserResolver processor (respect the UserResolver location due to references to Sitecore.Context.User in the custom code).

Since there are no references to Sitecore.Context.Item in the custom code, there should not be any dependency on ItemResolver/SkipContextItemResolutionWhenGraphQLRequest processor locations."

Based on this guidance, we adjusted our patch to place our processor before TransferRoutedRequest:

patch:before="processor[@type='Sitecore.Mvc.Pipelines.HttpRequest.TransferRoutedRequest, Sitecore.Mvc']"

This resolved the push and pull command issues locally. However, in the development environment, we encountered a different error:

Additional Error and Resolution


Upon further investigation, we found a solution to this error. According to a blog post, adjusting the versionComparingEnabled flag resolved similar issues. The Sitecore bug report number 560588 was referenced for more details.

https://sitecorecorner.wordpress.com/2023/05/31/issue-with-version-compatibility-feature-of-sitecore-cli-v5-1-25

The flag versionComparingEnabled was deprecated in recent versions. Even our project also not using this flag. Instead our project initially used:


JSON

"versionComparisonEnabled":true

Changing it to:


JSON

"versionComparisonEnabled":false

resolved the issue. Sitecore confirmed that setting this flag to false would not cause any problems, and using the latest version should inherently fix the issue.

Key Learnings

1. Enhanced Logging: Using --trace | Out-File "log.txt" can generate more detailed logs in Sitecore CLI.

2. Processor Sequence Changes: The order of processors has changed in the latest versions. If certain functionalities are not working, verify if there have been changes in processor order and consult Sitecore for appropriate patching of custom processors.

I hope this blog post helps you during your upgrade process or provides insights into troubleshooting similar issues. Learning from these experiences can guide us in improving our processes and avoiding similar pitfalls in the future.

I hope you enjoy this Sitecore blog. Stay tuned for more Sitecore related articles.

Till that happy Sitecoring :)

Please leave your comments or share this article if it’s useful for you.



Tuesday, December 17, 2024

Sitecore issue after upgrade | Connection string cortex.processing.engine is not found

 Hi All,

In my recent blogs, I discussed the Sitecore upgrade process from version 10.1 to 10.4. I have listed the overall steps and the issues I encountered during the upgrade. If you haven't read my last blog yet, you can check it out by visiting the following URL:

https://sitecoreknowledgeshare.blogspot.com/2024/11/sitecore-upgrade-101-to-104-part-1.html

Our upgrade work is going very well, but we have encountered one issue that frequently appears in our logs whenever we try to open the Experience Editor or a page in Preview mode. The error is as follows:

"Connection string 'cortex.processing.engine' is not found"

I tried to investigate and found a solution on Stack Overflow. Here is the link:

https://sitecore.stackexchange.com/a/35737/1146


I hope you enjoy this Sitecore blog. Stay tuned for more Sitecore related articles.

Till that happy Sitecoring :)

Please leave your comments or share this article if it’s useful for you.

Wednesday, November 13, 2024

Sitecore Upgrade 10.1 to 10.4 - Part-4

Hi All, 

Updated Sitecore Modules and Challenges Encountered

Issue 1: Post-upgrade of the SXA module, an error occurred while upgrading the content.

  • Resolution: Sitecore advised reviewing the tenant item to ensure fields such as template, themes, media library, and shared media library locations are correctly set. In our scenario, one tenant had blank values for these fields, resulting in issues during the SXA content upgrade. After correcting these values, the upgrade process succeeded.

Sitecore 10.4 Upgrade Process and Module Compatibility

List of Modules Reviewed for Sitecore Upgrade from 10.1 to 10.4

Module Name

Version

Comment

Sitecore PowerShell

Sitecore PowerShell Extensions 7.0 - IAR

Reference

Download Link

Sitecore SXA

SXA 10.4.0

Reference

Download Link

Upgrade Guide

Data Exchange Framework

Data Exchange Framework 9.0.0

Reference

Download Link

Sitecore Managed Service (CLI)

Sitecore Management Services 5.2.113

No upgrade needed, as the latest version is already in use.

Horizon

Deprecated

Not supported in Sitecore 10.4; therefore, this module was not updated. Reference

Sitecore Module Upgrade Steps

Follow the instructions for Sitecore.UpdateApp.exe from the Upgrade Installation Guide:

  1. Download the Sitecore Update App tool:
    • Sitecore Update App Tool
    • Select "Sitecore UpdateApp Tool 1.4.1" and choose "Package 1.4.1 for 10.1.3 XP" (Sitecore.UpdateApp 1.4.1 for Sitecore 10.1.3 rev. 009558 (XP).zip) for upgrading from 10.1.3 to Sitecore 10.4.
  1. Extract the zip file contents:
    • Extract to a folder, e.g., D:\Sitecore.UpdateApp.
  1. Copy the license file:
    • Copy the license file to the Data folder of the tool, e.g., D:\Sitecore.UpdateApp\Data\license.xml.
  1. Update the connections:
    • Update the connections in the D:\Sitecore.UpdateApp\App_Config\ConnectionStrings.config file to your databases. Use the core database connection if a security database is not available.
  1. Add the upgrade resources:
    • Download the upgrade resources from every module and connector to the UpdateApp tool files. Upgrade packages for different versions of the Sitecore modules can be downloaded from the Sitecore Downloads Site.
    • Unpack the ZIP file into a local folder, e.g., D:\ModulesUpgradeResources\[Module Name].
    • Copy all the subfolders and files from the Data folder, e.g., from D:\ModulesUpgradeResources\[Module Name]\X.X.X\Data.
    • Paste all the subfolders and files into the UpdateApp Data folder, e.g., D:\Sitecore.UpdateApp\Data.
    • Repeat for every module and connector.
  1. Run the UpdateApp tool:
    • Open a Command Prompt in the tool folder and run:

Shell Session

Sitecore.UpdateApp.exe clean

Sitecore Module Post-Upgrade Steps

Install the following modules on the newly upgraded Sitecore 10.4 instance:

 

This guide provides a structured approach to upgrading Sitecore from version 10.1 to 10.4, ensuring compatibility and proper installation of necessary modules. For further assistance, please refer to the provided references and guides.

Some reference Blogs which I follow:
https://www.linkedin.com/pulse/how-update-from-sitecore-9-10-step-guide-databases-marcelo-vallejo-ftube/

https://madhuanbalagan.com/sitecore-upgrade-the-update-app-tool

https://madhuanbalagan.com/sitecore-upgrade-database-scripts

https://alan-null.github.io/2017/04/sxa-upgrade-tool

https://developers.sitecore.com/downloads/Resource_files_for_Modules/1x/Resource_files_for_Modules_100

I hope you enjoy this Sitecore blog. Stay tuned for more Sitecore related articles.

Till that happy Sitecoring :)

Please leave your comments or share this article if it’s useful for you.

Sitecore Upgrade 10.1 to 10.4 - Part-3

Hi All, 

Solution and Sitecore Updates

Assembly and Code Changes

Castle.Core Downgrade:

Web.config File Update:

  • Action: Add the following entries to include binding redirects:

HTML, XML

<dependentAssembly>

  <assemblyIdentity name="Castle.Windsor" publicKeyToken="407dd0808d44fbdc" culture="neutral" />

  <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />

</dependentAssembly>

 

<dependentAssembly>

  <assemblyIdentity name="Castle.Core" publicKeyToken="407DD0808D44FBDC" culture="neutral" />

  <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />

</dependentAssembly>

Layer.config Order Adjustment:

  • Reason: The previous sequence caused issues in our project.
  • Action: Updated the order to match the configuration of the existing Sitecore 10.4 website.

Code Reference Updates

File Path

Line Number

Old Code

New Code

D:\Projects\SampleProject\src\Foundation\Pipelines\code\Pipelines\Robots.cs

9

using Sitecore.XA.Feature.SiteMetadata.Enums;

using Sitecore.XA.Foundation.SiteMetadata.Enums;

D:\Projects\SampleProject\src\Foundation\Pipelines\code\Pipelines\Robots.cs

83

.Fields[Sitecore.XA.Feature.SiteMetadata.Templates._RobotsContent.Fields.RobotsContent]?

.Fields[Sitecore.XA.Foundation.SiteMetadata.Templates._RobotsContent.Fields.RobotsContent]?

D:\Projects\SampleProject\src\Foundation\Pipelines\code\Pipelines\Robots.cs

92

if (settingsItem != null && settingsItem.Fields[Sitecore.XA.Feature.SiteMetadata.Templates.Sitemap._SitemapSettings.Fields.SitemapMode]

if (settingsItem != null && settingsItem.Fields[Sitecore.XA.Foundation.SiteMetadata.Templates.Sitemap._SitemapSettings.Fields.SitemapMode]

D:\Projects\SampleProject\src\Foundation\Pipelines\code\Pipelines\RobotsforNonProd.cs

9

using Sitecore.XA.Feature.SiteMetadata.Enums;

using Sitecore.XA.Foundation.SiteMetadata.Enums;

D:\Projects\SampleProject\src\Foundation\Pipelines\code\Pipelines\RobotsforNonProd.cs

84

.Fields[Sitecore.XA.Feature.SiteMetadata.Templates._RobotsContent.Fields.RobotsContent]?

.Fields[Sitecore.XA.Foundation.SiteMetadata.Templates._RobotsContent.Fields.RobotsContent]?

D:\Projects\SampleProject\src\Foundation\Pipelines\code\Pipelines\RobotsforNonProd.cs

101

if (settingsItem != null && settingsItem.Fields[Sitecore.XA.Feature.SiteMetadata.Templates.Sitemap._SitemapSettings.Fields.SitemapMode]

if (settingsItem != null && settingsItem.Fields[Sitecore.XA.Foundation.SiteMetadata.Templates.Sitemap._SitemapSettings.Fields.SitemapMode]

D:\Projects\SampleProject\src\Foundation\Pipelines\code\Pipelines\SitemapXmlChangeSchemeToHttps.cs

7

using Sitecore.XA.Feature.SiteMetadata.Enums;

using Sitecore.XA.Foundation.SiteMetadata.Enums;

D:\Projects\SampleProject\src\Foundation\Pipelines\code\Pipelines\SitemapXmlChangeSchemeToHttps.cs

8

using Sitecore.XA.Feature.SiteMetadata.Sitemap;

using Sitecore.XA.Foundation.SiteMetadata.Sitemap;

D:\Projects\SampleProject\src\Foundation\Pipelines\code\Pipelines\SitemapXmlChangeSchemeToHttps.cs

48

SitemapChangeFrequency sitemapChangeFrequency = obj1.Fields[Sitecore.XA.Feature.SiteMetadata.Templates.Sitemap._Sitemap.Fields.ChangeFrequency].ToEnum<SitemapChangeFrequency>();

SitemapChangeFrequency sitemapChangeFrequency = obj1.Fields[Sitecore.XA.Foundation.SiteMetadata.Templates.Sitemap._Sitemap.Fields.ChangeFrequency].ToEnum<SitemapChangeFrequency>();

D:\Projects\SampleProject\src\Foundation\Pipelines\code\Pipelines\SitemapXmlChangeSchemeToHttps.cs

85

var target = ((ReferenceField)item.Fields[Sitecore.XA.Feature.SiteMetadata.Templates.Sitemap._Sitemap.Fields.Priority]);

var target = ((ReferenceField)item.Fields[Sitecore.XA.Foundation.SiteMetadata.Templates.Sitemap._Sitemap.Fields.Priority]);

D:\Projects\SampleProject\src\Foundation\Pipelines\code\Pipelines\SitemapXmlChangeSchemeToHttps.cs

98

return string.IsNullOrEmpty(item.Fields[Sitecore.XA.Feature.SiteMetadata.Templates.Sitemap._Sitemap.Fields.Priority]?.Value);

return string.IsNullOrEmpty(item.Fields[Sitecore.XA.Foundation.SiteMetadata.Templates.Sitemap._Sitemap.Fields.Priority]?.Value);

This table provides a clear overview of the changes made to the references in the specified files.

 

Issue and Resolution

CS1705 Error:

  • Description: Assembly 'Sitecore.Kernel' uses 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=7.0.0.0', which is higher than the referenced assembly version 3.1.5.0.
  • Cause: Sitecore.Analytics update required 'Microsoft.Extensions.DependencyInjection.Abstractions' version 6.0.0, while Sitecore.Kernel expects version 7.0.
  • Resolution: Updated 'Microsoft.Extensions.DependencyInjection.Abstractions' to version 7.0.

Web.Config.xdt Entry Issue:

  • Problematic Entry:

HTML, XML

<add type="Sitecore.Analytics.Media.MediaRequestSessionModule, Sitecore.Analytics" name="MediaRequestSessionModule"/>

Build Error:

  • Description: A missing RestSharp reference due to a version mismatch in the package config and the csproj file.
  • Resolution: Ensure the RestSharp reference is correctly aligned in both the package config and the csproj file.

I hope you enjoy this Sitecore blog. Stay tuned for more Sitecore related articles.

Till that happy Sitecoring :)

Please leave your comments or share this article if it’s useful for you.