Skip to main content

Posts

Showing posts with the label sitecore publishing service

Sitecore Publishing Service jobs fail with errors saying - The connection does not support MultipleActiveResultSets

 Recently, a fellow Sitecorian reached out to know my views on a problem he was experiencing related to Sitecore Publishing Service 7. He reported that his publishing service has been configured correctly and was working fine when he checked last. Nothing has changed since then, and all of a sudden the publish jobs have started failing. We jumped into the logs to find out what we can see and it had errors like the one below -  Error in the "TreeNodeSourceProducer" System.InvalidOperationException: The connection does not support MultipleActiveResultSets.    at System.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__126_0(Task`1 result)    at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()    at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous

No root node was present (with Id 11111111-1111-1111-1111-111111111111) - Error in Sitecore Publishing service job

 The Problem I was setting up publishing service for Sitecore instance and then published a few items but my publish jobs kept failing as in snapshot below -  I found below error in publishing service logs - 2023-11-08 23:00:26.790 +05:30 [Error] There was an error performing the publish during stage: "" System.AggregateException: One or more errors occurred. (One or more errors occurred. (No root node was present (with Id 11111111-1111-1111-1111-111111111111). (Parameter 'allNodes')))  ---> System.AggregateException: One or more errors occurred. (No root node was present (with Id 11111111-1111-1111-1111-111111111111). (Parameter 'allNodes'))  ---> System.ArgumentOutOfRangeException: No root node was present (with Id 11111111-1111-1111-1111-111111111111). (Parameter 'allNodes')    at Sitecore.Framework.Publishing.Common.DataStructures.Tree.TreeBuilder`2.Build(ITreeNodeDescriptor`2[] allNodes)    at Sitecore.Framework.Publishing.ItemIndex.FullSour

Publishing Service Failed: Could not resolve stores 'web' of type source

Problem While trying to publish an item using Sitecore Publishing Service, the publish job shows status as Failed (check snapshot below) and when user clicks on it to get more details, it says -  Could not resolve stores 'web' of type source Solution We checked the logs and it said -  2023-10-09 09:31:32.560 -04:00 [Error] Error during publish of 443f1620-188b-4f39-a9c8-ef284d9a6c6b - Error: "Could not resolve stores web of type source" System.Exception: Could not resolve stores web of type source at Sitecore.Framework.Publishing.Data.DefaultStoreFactory.CreateSources(DataAccessContextType dataAccessContext, String[] names) at Sitecore.Framework.Publishing.PublishContext..ctor(IStoreFactory storeFactory, PublishOptions publishOptions, Guid jobId, DateTime started) at Sitecore.Framework.Publishing.PublishContextFactory.Create(IStoreFactory storeFactory, PublishOptions publishOptions, Guid jobId, DateTime started) at Sitecore.Framework.Publishing.Tasks.Publi

Script to read contents of media files attached to Sitecore media library items

Ever wondered how can we read contents of files uploaded to media library without rendering them? Recently, we needed a PowerShell script to read the content of our SVGs and create a list of SVGs which contained a pattern in them. After a little research, I came up with this script -  $item =Get-Item -Path "/sitecore/media library/<filepath here>" $mediaItem = New-Object 'Sitecore.Data.Items.MediaItem' $item; $blobField = $mediaItem.InnerItem.Fields["blob"] if($blobField){         $blobStream = $blobField.GetBlobStream()         if($blobStream){             try                 {                 $contents = New-Object byte[] $blobStream.Length                 $blobStream.Read($contents, 0, $blobStream.Length) | Out-Null             }              finally              {                     $blobStream.Close()                 }             $fileText = ([System.Text.Encoding]::Default.GetString($contents))         } } In the above script, $fileText will co

PublishJobCleanUp and PublishOperationAgeBasedCleanUp tasks in Sitecore Publishing Service

We have been using Sitecore Publishing Service for a while now and it has helped to reduce the publishing time. It takes publishing operations to a separate server which is good architecture. Any hiccups on the publishing service side don't impact our Sitecore servers directly  and we have been enjoying it so far. The Problem.. We have faced few bumps as well on our publishing service ride. We have been facing an issue where our Sitecore Publishing Service will get unresponsive after a week of acting normal. This blocks publish operations, publishing dashboard flashes errors and content stops getting pushed to live servers. As a quick fix, we restart the publishing service and that helps to clear the clutter. We have been working on finding a permanent fix for it. The Solution.. (for now) We got in touch with Sitecore Support. After analyzing our application, logs etc. they suggested that our application publishes more than what Sitecore publishing service's  default settings a

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 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

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

Old versions of Sitecore pages get updated in SXA Site

We have recently upgraded our Sitecore form Sitecore 8.2 to Sitecore 10.1 and have migrated vanilla Sitecore sites to SXA sites. So far so good! Then what's the problem? THE PROBLEM One random day, a content author (lets name him GhanSingh) opened a page in Experience Editor, edited it and then saved it. May be he didn't like his changes and he thought of checking older versions of the page. He went to the page in the Content Editor and tried to check old versions of the page and to his surprise he saw something like this -  Do you notice how older versions of the page also show same Statistics data (last modified date, last modified by etc.) as the most recent version. In fact, the content author thought his actions has created multiple versions of the page and he has no way of reverting back to older versions as he don't see them anymore in the drop down. Any guesses what caused it? THE SOLUTION We thought it may be some custom event handler that gets triggered on item:sa

Related Items not published in Sitecore Publishing Service

Sitecore Publishing Service  (SPS) is an opt-in mechanism for high-performance publishing in large scale Sitecore setups. This module increases publishing throughput, reduces the amount of time spent publishing large volumes of items, and offers greater data consistency and reliability. The module also improves the user experience and provides better visual feedback to the user on the state of the publishing system. If you don't use SPS yet and if your publishing tasks take longer than expected, SPS module can be highly useful to you. In this blog, I am going to share a recent experience related to configuring SPS in scaled environment. There is a specific step in installation guide which needs to be performed explicitly in scaled environments and if you miss it, you may have problems publishing related items with the page. THE PROBLEM In our case, publishing worked correctly but none of the related items of published page got published. We reached out to community on slack and als

Sitecore Publishing Service - An error occurred while starting the application

The Publishing Service module is an optional replacement for the existing Sitecore publishing methods. This module increases publishing throughput, reduces the amount of time spent publishing large volumes of items, and offers greater data consistency and reliability. The module also improves the user experience and provides better visual feedback to the user on the state of the publishing system. We decided to use  Sitecore Publishing Service  due to large amount of content in our Site nodes and site publishes that run for more than an hour. Problem When we started implementing with Sitecore Publishing Service on our development machines by following the instructions from SPS installation guide, we got stuck at point where the SPS won't start and will give an error as in the snapshot below -  Solution To solve this problem, we started looking into the logs but the logs did not even record this activity. We were left clueless. We decided to start this service using powershell. Powe