Skip to main content

Posts

Showing posts with the label Sitecore

Restart unresponsive Sitecore Publishing Service using PowerShell

 We are on Sitecore 10.1.2 and we use Sitecore Publishing Service module. We often encounter random unresponsiveness of Publishing Service where content authors report that they tried publish an item or a site but the publishing dialog seemed unresponsive and errored out as in snapshot below after few seconds - When we looked at the publishing service logs, we could see that it disposed off all the connections but did not attempt at recreating them. An application pool recycle solves the problem but the catch is this blocks the content authors from publishing their changes until a developer gets to recycle the application pool for the publishing service. We had an option of scheduled application pool recycle for the Publishing service but our application is used 24x7 across the globe by content authors for editing their content. So there were chances that application pool recycle may kill any publishing jobs and then create further problems. As an attempt to solve this problem, we star

Sitecore bug 563584 - Lock and Edit stops working in Experience Editor

 The Problem While working in Experience Editor in Sitecore 10.1.2, content authors started reporting that clicking on Lock and Edit link doesnt lock the page sometimes. Content Authors have to reload the page to work or use Content Editor to Edit the page. This has been reported by multiple users at multiple times and is not consistently reproducible. The Research We have observed that when Lock and Edit is unresponsive, it doesnt trigger any requests in Network tab in browser dev tools. When Lock and Edit is responsive, it triggers several requests in Network tab. The HTML for Lock and Edit appears same in both the cases without any missing fields. The console tab doesnt contain any errors. To learn more on this issue, I created a Sitecore Support ticket. Sitecore support representative was able to reproduce the issue on her local instance as well. Below is the response from Sitecore -  "I was able to reproduce this behavior in the local environment and, since this is not the ex

Sitecore items selected in custom Multilist field not published

THE PROBLEM We are on Sitecore 10.1 and we use Sitecore Publishing Service for publishing. Recently, we encountered an issue where our items selected in a custom field (called as Multilist Dynamic Source with Search ) were not published even when Related Items checkbox was checked in the Publish Dialog. However, the items selected in the Multilist fields publish properly. Hence, we ruled out the possibility of Sitecore Publishing Service configurations not pointing to correct database that stores Link DB. We discussed that issue in a previous  blog . Multilist or any custom field based on Multilist stores the selected items as a pipe separated list of ItemIDs. You can verify this by looking at the Raw Values of the field. When a user published a page and checked the checkbox for Related Items , then the expectation was that the items selected in Multilist or the custom field of a rendering datasource shall also get published. In our case where we used the custom field based on Multilis

Default website is resolved instead of SXA site intermittently in Sitecore

 The Problem Recently, we encountered a weird problem where one of our sites in Experience Editor will resolve to default website and not to the correct site. This happened when an author or developer opened Content Editor and tried to select one of the pages in the SXA site and then clicked on Experience Editor in Publish tab to open the page in Experience Editor, the page opened with the following errors -  On checking the logs, we found that logs contains following entries for each SXA site -  We never saw these kind of errors earlier in our logs.  The Solution We started validating what is wrong with our site definitions. To our surprise, everything configured in site definitions appeared normal except the fact that a recent change was introduced to enable Enforce version presence. We soon found out a KB from Sitecore talking about the same problem - https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB1002873 According to it -  An SXA site might not be resolved

Sitecore Search for Marketing

In this blog post, I have shared information about Sitecore Search. Most of the content in this post are my notes from a webinar presented by development team of Sitecore Search that I felt I should share with you :) What is Sitecore Search? Sitecore Search is an API first product designed by Sitecore to build search experiences from scratch without the need of complex code. The APIs can be integrated in any solution and the look and feel can be configured to match the application. Sitecore SPEAK also provides some UI elements that can be integrated with these APIs to build the search experience. Sitecore Search can be a great offering while re-platforming an application. In this post, we will learn more about capabilities of Sitecore Search. How Sitecore Search can help your organization? Sitecore search is great for marketers. It empowers them to configure searchable experiences without need of technology personnel. It enhances content discovery which generates more leads. Hence, it

Sitecore Media Cache : How to find media file in it?

In Sitecore Media Cache, the images are stored in MediaCache folder using a specific convention. This means if you need to locate an image in MediaCache folder, you need to understand this convention else you have to be really lucky to be able to find your image in MediaCache. I have many times figured this out earlier and then have also forgotten it when it was not needed. Recently, while working on a production issue, I again had to recall it  to know if a media file is being served from MediaCache or not. So this time I decided to document it and share it with other developers in case they too struggle with it. If you go to App_Data/MediaCache on your Sitecore instance, this is how a typical site folder in it looks like. All the media files for sites are cached in their site specific folders only -  If you go one level inside these folders, you will see this -  The above snapshot is from an example site which has few media items only. Your actual MediaCache folder may have hundreds

Solr Search for Sitecore - Notes --Draft

SOLR SEARCH QUICK NOTES http://www.solrtutorial.com/solr-query-syntax.html BASIC CONCEPTS Solr prepares indexes. Indexes contains documents and documents contains fields. Documents can be assumed as rows in a table and fields as columns in tables. Before adding documents to index, we need to specify the schema. (not advisable to change schema after documents have been added).  The schema declares - what kinds of fields there are which field should be used as primary key which fields are required how to index and search each field When we search for a word, the word undergoes transformation to get converted to a token. SOLR then looks for these tokens in its indexes. Each token contains references to pages where it was found when SOLR was crawling and this is how search results are returned. All fields are not searchable. Many of them are maintained in indexes so that when a match is found, the field values may need to be displayed in the search results. This is done by following settin

Script to renew self-singed certificates in Sitecore

This one is an article to spread awareness about script solutions available in community but not popular.  As my self-signed certificates for Sitecore 10.0 instance expired, I want to use SIF or CLI to renew them and best also to replace thumbprints to minimize manual work. Is this possible with SIF or CLI? Or is there any ps1 script I could use. We have a LOT of test environments. As the certs have been expiring, I was complaining about the manual process I was using to change/update these. My clever co-worker Karl bowled up a powershell script that has been such a help!  This will generate a new CA cert for you to base all your self-signed certs on, or it will use one you already have. Put the pfx file in the same directory as the script. It displays all the sites in IIS and you pick the one to update - say a Sitecore 9 xconnect site, changes out the cert in the bindings, updates the thumbnails where needed in config. So easy once you've used it a couple of times. Enjoy. https://

Solr Search facet values limited to 100 only in Sitecore SXA

The Problem Recently, a Sitecore developer reported an issue where he could not get more than 100 values for a facet field in SXA search component. He tried updating Query.MaxItems and also  XA.Foundation.Search.QueryMaxItems but still did not get more that 100 values for the facet field. The Research I started looking into this out of curiosity. I checked Sitecore configs and did not find any other setting which could be affecting it. I realized soon that this was most likely something limited on SOLR side. On researching, I found out that indeed this is related to SOLR default settings. Below is the snapshot from documentation about it and more info can be found here -  The Solution So, on your SOLR Server, edit the solrconfig.xml for the index you are using. It is found in the conf folder of your index. Find the requesthandler you are using, for e.g. "/select", and add <str name="facet.limit">-1</str> as in snapshot below -       Repeat this for ea

What Sitecore MVP Kickoff webinar feels like!

Recently, I had the honor of being awarded the Sitecore MVP award for Technology in 2023. I wrote about my experience here  and promised that I will keep sharing about my learnings from the program. So, here are some insights from Sitecore MVP Kickoff webinar. The webinar basically outlines what MVP program is about. There were presentations about the roadmap for Sitecore in 2023, little bit description about different tools Sitecore is comprised of now and then some presentations from community expert Tamas Varga, Peter Brinkmann etc. where they talked about MVP program and how they can help MVPs with works related to Sitecore. Some key interesting points I learnt and that I can share with you guys are below -  What do people do to become eligible for MVP award? Below is the list of contributions that Sitecore MVPs usually make over the year- What are the benefits of being a Sitecore MVP? One of the main questions that got answered was what are the benefits of being a Sitecore MVP and

Make Sitecore instance faster using Roslyn Compiler

When we install the Sitecore instance on local, the first load is slow. After each code deploy also, it takes a while for the Sitecore instance to load and experience editor to come up. For us, the load time for Sitecore instance on local machines was around 4 minutes. We started looking for ways to minimize it and found that if we update our Web.config to use Roslyn compiler and include the relevant Nugets into the project, our load times will improve. We followed the simple steps - Go to the Project you wish to add the NuGet package and right click the project and click 'Manage NuGet Packages'. Make sure your 'Package Source' is set to nuget.org and go to the 'Browse' Tab and search Microsoft.CodeDom.Providers.DotNetCompilerPlatform. Install whichever version you desire, make sure you note which version you installed. You can learn more about it  here . After installation, deploy your project, make sure the Microsoft.CodeDom.Providers.DotNetCompilerPlatform.d

Error while writing serialized item - Serialized version contained a blank language value - Sitecore Serialization error in CLI

Sitecore Content Serialization (SCS) is a system for serializing, sharing, and deploying content items, as well as keeping them in version control. It combines best of both Unicorn and TDS tools used widely in Sitecore applications for content serialization. If you havent used it yet, you should give it a try and learn more from  here . The Problem Recently, while performing a dotnet sitecore ser pull command to get latest updates of an item into source control, I got the below errors -  System.InvalidOperationException: Error while writing serialized item C:\projects\MyProbject.Website\src\Project\MyProjct\code\module\serialization\MySite\Home.yml ---> System.InvalidOperationException: Serialized version contained a blank language value! So this looked familiar with invariant language issue where an item may have field values in a language that doesn't exist or to put simply no language or blank language. This makes the item an invalid item and hence, it fails the serializati

Experience of a first time Sitecore MVP

The Journey I have been working in Sitecore for almost 10 years now. When I was a beginner in Sitecore, I was highly impressed by the incredible community support. In fact, my initial Sitecore learning path was entirely based on community written blogs on Sitecore. During a discussion with my then technology lead Neeraj Gulia , he proposed the idea that I should start giving back to developer community whenever I get chance. Just like I have been helped by many developers via online blogs, stackoverflow etc., I should also try to help others. Fast forward a few years and I met  Nehemiah Jeyakumar  (now an MVP). He had a big archive of his technical notes in the form Sitecore blogs. I realized my first blog dont have to be perfect and it can be as simple as notes to a specific problem for reference in future. That's when I probably created my first blog post on Sitecore. At that time, I didn't knew about the Sitecore MVP program. Over the years, I gained more confidence to write

Contributions to Sitecore community in 2022

Hello All! This year I learnt many new cool stuff about Sitecore 10 especially Docker, Sitecore Publishing Service, SXA etc. I wish I could touch other products of Sitecore as well. I will try to do that in 2023.  I would take this opportunity to list what I have done this year.  BLOG POSTS Below are the links to all my blogs which I have published in year 2022 on Sitecore.  https://ghanendras.blogspot.com/2022/11/all-items-removed-from-sitecore-web-db.html https://ghanendras.blogspot.com/2022/11/limit-on-number-of-sxa-sites-sitecore.html https://ghanendras.blogspot.com/2022/11/old-versions-of-sitecore-pages-get.html https://ghanendras.blogspot.com/2022/11/related-items-not-published-in-sitecore.html https://ghanendras.blogspot.com/2022/09/replace-sxa-based-selectrendering.html https://ghanendras.blogspot.com/2022/05/sitecore-10-queues-removed-in-data.html https://ghanendras.blogspot.com/2022/03/bug-in-sitecore-10-unable-to-move-out.html https://ghanendras.blogspot.com/2022/04/sitecore

Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException in Sitecore Publishing Servie

This happened recently i n our publishing service when we started seeing below error that caused publishing to fail for items-  Mvc.ExceptionHandling.AbpExceptionFilter - Reading the request body timed out due to data arriving too slowly. See MinRequestBodyDataRate. Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Reading the request body timed out due to data arriving too slowly. See MinRequestBodyDataRate. On investigating, it was found that our job queue was somewhat big, and our operations table were very large. This could be what's causing this issue to occur in publishing service. We connected with Sitecore support and they recommended to modify the cleanup tasks on the publishing service side to clear these tables more often. This can be achieved by using the below patch on publishing service side -  <?xml version="1.0" encoding="utf-8"?> <Settings>   <Commands>     <Web>       <Services>         <Add> 

All items removed from Sitecore Web DB due to this bug in Sitecore Publishing Service v5

In this post, I am going to talk about a very weird issue we faced and how we troubleshooted it. One fine morning, a QA in our team updated us that she is unable to see anything on CD server. All she sees is the Sitecore aspx page with error saying layout not found. We started looking for the item in web db to find out what was wrong and phewww, web db was missing all the items we had built ever. To fix this issue temporarily, we published everything from master to web db. But this kept happening over and over. We started looking at the Publishing Dashboard to get any cues and we saw hundreds of queued jobs as in snapshot below -  These jobs seem to be getting queued automatically. We started investigating logs in Sitecore cm instance and on publishing service machine to get any traces of what is happening. We also found that our publishing service instance went unresponsive due to such large number of requests. We recycled its application pool to get it back to working state. We check