meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sap_hybris_commerce:cms_cockpit_wcms:common_reasons_of_synchronisation_failures [2021/04/30 15:36] – duplicate content slots for pages Antonio Robirosasap_hybris_commerce:cms_cockpit_wcms:common_reasons_of_synchronisation_failures [2022/10/23 10:02] (current) – [Common reasons of synchronisation failures] Antonio Robirosa
Line 2: Line 2:
  
 A common complain of the users which edit content using the CMS Cockpit is that the synchronisation stops working quite often. During September and October 2015 I solved around 37 cases and found 16 different causes of sync errors. This is a summary of the categories of errors and tips or measures to prevent them. A common complain of the users which edit content using the CMS Cockpit is that the synchronisation stops working quite often. During September and October 2015 I solved around 37 cases and found 16 different causes of sync errors. This is a summary of the categories of errors and tips or measures to prevent them.
 +
 +Hybris usually only reports “An exception occurred during synchronization” in the logs, so you have to further analyse that the cause of the failure is.
  
 ===== Procedure to find out why the synchronization isn't working ===== ===== Procedure to find out why the synchronization isn't working =====
Line 58: Line 60:
  
 **In every case the item with the error must have been modified after the last synchronization.** If it isn't, the sync process is going to ignore it unless you select "force update" on the synchronisation wizard in hMC. **To teach the WCMS users to synchronize any change before removing a component, page or navigation node and to remove access to other catalogues** reduces the occurrence of the above cases. **In every case the item with the error must have been modified after the last synchronization.** If it isn't, the sync process is going to ignore it unless you select "force update" on the synchronisation wizard in hMC. **To teach the WCMS users to synchronize any change before removing a component, page or navigation node and to remove access to other catalogues** reduces the occurrence of the above cases.
 +
 +==== Useful tips to troubleshoot exceptions during the creation/copy of the target sync-item ====
 +
 +If you get an error similar to:
 +<code>
 +d.h.p.c.j.s.AbstractItemCopyContext : An exception occured during synchronization for item: 8796388590637 of type: Content Slot-Beziehung für eine Seitenvorlage
 +</code>
 +Put a breakpoint inside de.hybris.platform.catalog.jalo.synchronization.GenericCatalogCopyContext#copy(de.hybris.platform.catalog.jalo.synchronization.ItemCopyCreator, de.hybris.platform.jalo.Item, de.hybris.platform.jalo.Item, de.hybris.platform.catalog.jalo.ItemSyncTimestamp) to find out what exception was thrown. The sync job don't log the stacktrace of this exception.
 +
 +The cause are usually validate interceptors or after save listeners which prevent creating the target hybris item.
 +
 +==== Userful flexible search queries ====
 +=== Find navigation entries with invalid or missing PKs ===
 +<code>
 +select {c.id} catalog, {cv.version} catalogVersion, {ne.uid} UIDEntry, {ne.pk} pkEntry
 +from {CMSNavigationEntry as ne
 +    JOIN CatalogVersion as cv
 +   ON {cv.pk} = {ne.catalogVersion}
 + JOIN Catalog as c
 +   ON {c.pk} = {cv.catalog}
 +}
 +where {ne.item} is null
 +or NOT EXISTS ({{
 +        SELECT 1
 +        FROM {CMSItem AS i}
 +        WHERE {i:pk} = {ne.item}
 +    }})
 +</code>
 +
  
 ==== Duplicate CMS Items ==== ==== Duplicate CMS Items ====
  
-In one project the synchronisation created duplicate same code or uid— medias, contentslots and navigation nodes. Although the multi-threading in the synchronization was turned off((property catalog.sync.workers)), the system kept generating duplicate medias. The cause of the error is still unknown but **unique indexes for the column catalogVersion and code/uid** on the tables medias, contentslot, cmscomponent, cmsnavigationnode, cmsnavigationentry, slotsfortemplate and slotsforpage solved the issue. After the creation of the index no error message or stack trace is shown in the logs, so further investigation of the issue couldn't be done.+In one project the synchronisation created duplicate **same code or uid** medias, contentslots and navigation nodes. Although the multi-threading in the synchronization was turned off((property catalog.sync.workers)), the system kept generating duplicate medias. The cause of the error is still unknown but **unique indexes for the column catalogVersion and code/uid** on the tables medias, contentslot, cmscomponent, cmsnavigationnode, cmsnavigationentry, slotsfortemplate and slotsforpage solved the issue. After the creation of the index no error message or stack trace is shown in the logs, so further investigation of the issue couldn't be done.
  
 ==== Tips ==== ==== Tips ====