The article describes how to rebuild Path Analyzer maps in a scaled Sitecore XP environment.
SELECT DISTINCT [ChannelId] FROM [Shard0].[xdb_collection].[Interactions]If this query outputs any values (not existing channels), these channels must be fixed, for example, by replacing them with the widely-used channel ‘{B418E4F2-1013-4B42-A053-B6D4DCA988BF}’ (Shard0, for example):
WHERE [ChannelId] NOT IN (SELECT [ID] FROM [SitecoreMaster].[dbo].[Items] where [TemplateID] = '{3B4FDE65-16A8-491D-BF15-99CE83CF3506}')
UPDATE [Shard0].[xdb_collection].[Interactions] SET [ChannelId] = '{B418E4F2-1013-4B42-A053-B6D4DCA988BF}'Note: '00000000-0000-0000-0000-000000000000' ChannelId is also a not valid value.
WHERE [ChannelId] = 'VALUE-FROM-PREVIOUS-QUERY'
ERROR Exception while processing item Sitecore.Analytics.Core.ItemBatch`1[Sitecore.XConnect.Interaction] in task GUID-of-task-from-table-ProcessingTasks.
Exception: System.InvalidOperationException
Message: ExecuteReader requires an open and available Connection. The connection's current state is closed.
Source: System.Data
at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
…
at Sitecore.PathAnalyzer.Processing.TreeAggregator.Aggregate(ItemBatch`1 batch)
…
DELETE FROM [Processing.Tasks].[xdb_processing_tasks].[ProcessingTasks]
WHERE ([Description] = 'Build Map Agent' OR [Description] = 'Rebuild ALL Deployed Maps') AND [Status] < 2
<root>
<priority value="DEBUG" />
<appender-ref ref="LogFileAppender" />
</root>
For Sitecore XP Scaled, where Processing and Reporting roles are separate instances:
DELETE FROM [Reporting].[dbo].[Trail_Interactions]
DELETE FROM [Reporting].[dbo].[Trail_PathAnalyzer]
DELETE FROM [Reporting].[dbo].[TreeDefinitions]
DELETE FROM [Reporting].[dbo].[Trees]
For other topology configurations:
DELETE FROM [Reporting].[dbo].[TreeDefinitions]
DELETE FROM [Reporting].[dbo].[Trees]
SELECT COUNT(*) FROM [Reporting].[dbo].[Trees]
SELECT * FROM [Processing.Tasks].[xdb_processing_tasks].[ProcessingTasks]
WHERE [Description] = 'Build Map Agent' OR [Description] = 'Rebuild ALL Deployed Maps'
[Status]: Pending = 0, Processing = 1, Completed = 2, Failed = 3, Expired = 4, Canceled = 5
[Progress]: Number of currently processed interactions
[Total]: Total number of interactions that are expected to be processed
While the Path Analyzer rebuilding process creates maps backward from the current date, "live" Path Analyzer activity should create maps for new interactions forward from the current date, so no missing maps are expected.