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.