Infinite loop in EntityReplicate

Created on 5 December 2023, 7 months ago
Updated 6 December 2023, 7 months ago

Problem/Motivation

EntityReplicate::execute(), calls $this->executeMultiple([$object]);

Which calls Drupal\Core\Action\ActionBase::executeMultiple()

That in turn runs:

    foreach ($entities as $entity) {
      $this->execute($entity);
    }

Which lands us back in step one. For me, this seems to be appearing when I am using a Feeds module importer. This is causing my feeds to seemingly be stuck in a locked status.

Steps to reproduce

This might be happening when used in conjunction with the Feeds module. I have a content type type with nodes being created via a Feed. The only hint that I got that the issue was happening in Replicate UI is from the out of memory error message that was only visible in the ajax response body. Which I was able to see in my browser's network dev tools.

Proposed resolution

I'm not certain why these functions are calling each other in the first place. So I need some additional context from the maintainers on what is supposed to be happening.

Using Replicate UI version 8.x-1.1
Drupal Core 10.1.4

πŸ› Bug report
Status

Closed: duplicate

Version

1.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bburg Washington D.C.

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @bburg
  • πŸ‡ΊπŸ‡ΈUnited States bburg Washington D.C.
  • πŸ‡ΊπŸ‡ΈUnited States bburg Washington D.C.
  • πŸ‡ΊπŸ‡ΈUnited States bburg Washington D.C.

    For reference, here is the stack trace once it enters the loop:

    EntityReplicate.php:69, Drupal\replicate_ui\Plugin\Action\EntityReplicate->execute()
    ActionBase.php:22, Drupal\Core\Action\ActionBase->executeMultiple()
    EntityReplicate.php:69, Drupal\replicate_ui\Plugin\Action\EntityReplicate->execute()
    ActionBase.php:22, Drupal\Core\Action\ActionBase->executeMultiple()
    EntityReplicate.php:69, Drupal\replicate_ui\Plugin\Action\EntityReplicate->execute()
    EntityProcessorBase.php:374, Drupal\feeds\Feeds\Processor\EntityProcessorBase->clean()
    LazySubscriber.php:123, Drupal\feeds\EventSubscriber\LazySubscriber->Drupal\feeds\EventSubscriber\{closure:/var/www/html/web/modules/contrib/feeds/src/EventSubscriber/LazySubscriber.php:120-128}()
    ContainerAwareEventDispatcher.php:111, call_user_func:{/var/www/html/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php:111}()
    ContainerAwareEventDispatcher.php:111, Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
    EventDispatcherTrait.php:38, Drupal\feeds\FeedsExecutable->dispatchEvent()
    FeedsExecutable.php:284, Drupal\feeds\FeedsExecutable->doClean()
    FeedsExecutable.php:115, Drupal\feeds\FeedsExecutable->processItem()
    batch.inc:296, _batch_process()
    batch.inc:138, _batch_do()
    batch.inc:94, _batch_page()
    BatchController.php:49, Drupal\system\Controller\BatchController->batchPage()
    EarlyRenderingControllerWrapperSubscriber.php:123, call_user_func_array:{/var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:123}()
    EarlyRenderingControllerWrapperSubscriber.php:123, Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure:/var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:121-124}()
    Renderer.php:592, Drupal\Core\Render\Renderer->executeInRenderContext()
    EarlyRenderingControllerWrapperSubscriber.php:124, Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
    EarlyRenderingControllerWrapperSubscriber.php:97, Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure:/var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:96-98}()
    HttpKernel.php:181, Symfony\Component\HttpKernel\HttpKernel->handleRaw()
    HttpKernel.php:76, Symfony\Component\HttpKernel\HttpKernel->handle()
    RedirectMiddleware.php:44, Drupal\redirect_after_login\RedirectMiddleware->handle()
    Session.php:58, Drupal\Core\StackMiddleware\Session->handle()
    KernelPreHandle.php:48, Drupal\Core\StackMiddleware\KernelPreHandle->handle()
    PageCache.php:106, Drupal\page_cache\StackMiddleware\PageCache->pass()
    PageCache.php:85, Drupal\page_cache\StackMiddleware\PageCache->handle()
    ReverseProxyMiddleware.php:48, Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
    CloudFlareMiddleware.php:124, Drupal\cloudflare\CloudFlareMiddleware->handle()
    NegotiationMiddleware.php:51, Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
    StackedHttpKernel.php:51, Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
    DrupalKernel.php:704, Drupal\Core\DrupalKernel->handle()
    index.php:19, {main}()
    
  • Status changed to Closed: duplicate 7 months ago
  • πŸ‡¨πŸ‡­Switzerland Berdir Switzerland

    There's an existing issue for the broken action: πŸ› EntityReplicate action is broken Needs work .

    Not sure why feeds is calling that though, that seems strange to me.

  • πŸ‡ΊπŸ‡ΈUnited States bburg Washington D.C.

    It seems that if you have Replicate UI installed, with Feeds, in the feed settings, under the "Previously imported items: Select what to do with items that were previously imported, but are now no longer in the feed." setting, there are two seemingly similar options: "Delete" and "Delete Content". I believe "Delete" is the default core Drupal delete action, and "Delete Content" seems to map to an Action plugin in this module with the ID "entity_replicate:entity_node_replicate". Using that setting seems to utilize the EntityReplicate plugin that triggers the loop.

    The simple solution seems to use the intended, "Delete" plugin instead of the one related to this module. But this does bring up a few new questions. Why is this plugin appearing in the first place? Why does the plugin ID, and label seem to refer to very different activities (deleting content Vs. replicating). What is the original intended use for the methods that seem to enter the loop and is it fulfilling that intent if it just enters an infinite loop?

  • πŸ‡¨πŸ‡­Switzerland Berdir Switzerland

    Those are all valid questions that are being fixed in the other issue.

Production build 0.69.0 2024