Publishing to Experience Edge might fail with System.Reflection.TargetInvocationException


Description

Publishing to Experience Edge might fail with an unhandled exception:

#Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
...

The root cause of the issue is a missing template for some item that is subject to publishing. The following error pointing to the actual missing template might also be found in the logs:

ERROR Data template '{Item_ID}' not found for item '/sitecore/Item_path' in 'master' database

Solution

To resolve the issue, for Sitecore XP 10.2 and Sitecore Headless Rendering 20, download and install the cumulative hotfixes for the Experience Edge Connector moduleĀ that are available in KB1003202.