Skip to Content

Catalog Synchronization in a business process action is resulting in error "error in worker SyncWorker"

I am trying to synchronize the catalog using CatalogVersionSyncJob from one of the actions in a business process. While doing this, I am getting an error "error in worker SyncWorker : Entity not found ( pk = 8796617343477 name = 'de.hybris.platform.persistence.processing_CronJob' type code = '501' db table = 'cronjobs')" in the log and none of the items are getting synchronized. Can someone tell me what could be the root cause for this error.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 17, 2017 at 05:07 PM

    Faced same issue. Resolved it by triggering event from process action and running SyncJob in event listener. For me sync performs well only via SetupSyncJobService, performing job via DefaultCatalogSynchronizationService causes exception in SyncWorker.

    Example of event listener:

         @Override
         protected void onEvent(StartCatalogSyncEvent startCatalogSyncEvent) {
             PerformResult resultEnglish = setupSyncJobService.executeCatalogSyncJob(String.format("%sProductCatalog", FIVER));
             PerformResult resultGerman = fiverSetupSyncJobService.executeCatalogSyncJob(
                     fiverSetupSyncJobService.getCatalogVersion(FIVER_PRODUCT_CATALOG, STAGED_CATALOG_VERSION),
                     fiverSetupSyncJobService.getCatalogVersion(GERMAN_PRODUCT_CATALOG, ONLINE_CATALOG_VERSION));
     
             if (StringUtils.isNotBlank(startCatalogSyncEvent.getProcessCode())) {
                 BusinessProcessModel processModel = businessProcessService.getProcess(startCatalogSyncEvent.getProcessCode());
                 if (processModel instanceof ProductImportProcessModel) {
                     if (CronJobResult.SUCCESS.equals(resultEnglish.getResult()) && CronJobResult.SUCCESS.equals(resultGerman.getResult())) {
                         ((ProductImportProcessModel) processModel).setSyncSuccess(Boolean.TRUE);
                     } else {
                         ((ProductImportProcessModel) processModel).setFailMessage("Sync error. English result: " + resultEnglish.getResult().getCode() + ". German result: " + resultGerman.getResult().getCode() + ".");
                     }
                 }
                 businessProcessService.triggerEvent(startCatalogSyncEvent.getProcessCode() + "_SynchronizationEnd");
             }
         }
    
     
    
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 22, 2019 at 05:30 PM

    Hi guys,

    I am having the same issue when executing the synchronization of a Product from a Groovy script using

    SyncResult syncResult = catalogSynchronizationService.performSynchronization( itemsToSync, syncJob, cfg );

    Could this be related with transactions? I guess both Business Process actions and groovy script work with transactions.

    Regards,

    Mauro

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.