Warning: array_flip(): Can only flip string and integer values, entry skipped in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 312 of /core/lib/Drupal/Core/Entity/EntityStorageBase.php

Created on 16 May 2023, about 1 year ago
Updated 8 June 2023, about 1 year ago

This error is registered every time I run the cron:
-
Warning: array_flip(): Can only flip string and integer values, entry skipped in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 312 of /core/lib/Drupal/Core/Entity/EntityStorageBase.php

πŸ› Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom Londova

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

Comments & Activities

  • Issue created by @Londova
  • Status changed to Postponed: needs info about 1 year ago
  • πŸ‡©πŸ‡ͺGermany gbyte Berlin

    Unfortunately this is very little information to work with.

    Does the error go away when you disable the module or delete the sitemaps? Can you provide a stack trace? Is it possible to you to try and reproduce this on a fresh Drupal install?

  • πŸ‡¬πŸ‡§United Kingdom Londova

    @gbyte

    Yes, I uninstalled the module and the error doesn't appear anymore.
    Here is the full error message:
    ---
    Warning: array_flip(): Can only flip string and integer values, entry skipped in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 312 of /.../core/lib/Drupal/Core/Entity/EntityStorageBase.php)
    #0 /.../core/includes/bootstrap.inc(347): _drupal_error_handler_real()
    #1 [internal function]: _drupal_error_handler()
    #2 /.../core/lib/Drupal/Core/Entity/EntityStorageBase.php(312): array_flip()
    #3 /.../core/lib/Drupal/Core/Entity/EntityStorageBase.php(296): Drupal\Core\Entity\EntityStorageBase->loadMultiple()
    #4 /.../modules/simple_sitemap/src/Entity/EntityHelper.php(218): Drupal\Core\Entity\EntityStorageBase->load()
    #5 /.../modules/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/CustomUrlGenerator.php(152): Drupal\simple_sitemap\Entity\EntityHelper->getEntityFromUrlObject()
    #6 /.../modules/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGeneratorBase.php(248): Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\CustomUrlGenerator->processDataSet()
    #7 /.../modules/simple_sitemap/src/Queue/QueueWorker.php(360): Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\EntityUrlGeneratorBase->generate()
    #8 /.../modules/simple_sitemap/src/Queue/QueueWorker.php(324): Drupal\simple_sitemap\Queue\QueueWorker->generateResultsFromElement()
    #9 /.../modules/simple_sitemap/src/Manager/Generator.php(174): Drupal\simple_sitemap\Queue\QueueWorker->generate()
    #10 /.../modules/simple_sitemap/simple_sitemap.module(72): Drupal\simple_sitemap\Manager\Generator->generate()
    #11 /.../core/lib/Drupal/Core/Cron.php(250): simple_sitemap_cron()
    #12 /.../core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Cron->Drupal\Core\{closure}()
    #13 /.../core/lib/Drupal/Core/Cron.php(258): Drupal\Core\Extension\ModuleHandler->invokeAllWith()
    #14 /.../core/lib/Drupal/Core/Cron.php(136): Drupal\Core\Cron->invokeCronHandlers()
    #15 /.../core/lib/Drupal/Core/ProxyClass/Cron.php(75): Drupal\Core\Cron->run()
    #16 /.../modules/admin_toolbar/admin_toolbar_tools/src/Controller/ToolbarController.php(272): Drupal\Core\ProxyClass\Cron->run()
    #17 [internal function]: Drupal\admin_toolbar_tools\Controller\ToolbarController->runCron()
    #18 /.../core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
    #19 /.../core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #20 /.../core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
    #21 /.../core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
    #22 /.../vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #23 /.../vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
    #24 /.../core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
    #25 /.../core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
    #26 /.../core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
    #27 /.../core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
    #28 /.../core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
    #29 /.../core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
    #30 /.../vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
    #31 /.../core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle()
    #32 /.../index.php(19): Drupal\Core\DrupalKernel->handle()
    #33 {main}

  • πŸ‡ΊπŸ‡ΈUnited States sidgrafix

    I'm getting the same error every time cron is triggered for this module.

    Drupal 9.5.9, PHP 8.1.13, Apache 2.4.38

    dblog message with stack:

    Warning: array_flip(): Can only flip string and integer values, entry skipped in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 312 of /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php)
    #0 /var/www/html/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real(2, 'array_flip(): C...', '/var/www/html/w...', 312)
    #1 [internal function]: _drupal_error_handler(2, 'array_flip(): C...', '/var/www/html/w...', 312)
    #2 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(312): array_flip(Array)
    #3 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(296): Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array)
    #4 /var/www/html/web/modules/contrib/simple_sitemap/src/Entity/EntityHelper.php(218): Drupal\Core\Entity\EntityStorageBase->load(NULL)
    #5 /var/www/html/web/modules/contrib/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityMenuLinkContentUrlGenerator.php(206): Drupal\simple_sitemap\Entity\EntityHelper->getEntityFromUrlObject(Object(Drupal\Core\Url))
    #6 /var/www/html/web/modules/contrib/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGeneratorBase.php(248): Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\EntityMenuLinkContentUrlGenerator->processDataSet(Object(Drupal\menu_link_content\Plugin\Menu\MenuLinkContent))
    #7 /var/www/html/web/modules/contrib/simple_sitemap/src/Queue/QueueWorker.php(360): Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\EntityUrlGeneratorBase->generate(Object(Drupal\menu_link_content\Plugin\Menu\MenuLinkContent))
    #8 /var/www/html/web/modules/contrib/simple_sitemap/src/Queue/QueueWorker.php(324): Drupal\simple_sitemap\Queue\QueueWorker->generateResultsFromElement(Object(stdClass))
    #9 /var/www/html/web/modules/contrib/simple_sitemap/src/Manager/Generator.php(174): Drupal\simple_sitemap\Queue\QueueWorker->generate('cron')
    #10 /var/www/html/web/modules/contrib/simple_sitemap/simple_sitemap.module(72): Drupal\simple_sitemap\Manager\Generator->generate('cron')
    #11 [internal function]: simple_sitemap_cron()
    #12 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(417): call_user_func_array(Object(Closure), Array)
    #13 /var/www/html/web/modules/contrib/simple_cron/src/Plugin/SimpleCron/Cron.php(70): Drupal\Core\Extension\ModuleHandler->invoke('simple_sitemap', 'cron')
    #14 /var/www/html/web/modules/contrib/simple_cron/src/Entity/CronJob.php(326): Drupal\simple_cron\Plugin\SimpleCron\Cron->process()
    #15 /var/www/html/web/modules/contrib/simple_cron/src/SimpleCron.php(102): Drupal\simple_cron\Entity\CronJob->run(1684767603, false)
    #16 /var/www/html/web/modules/contrib/simple_cron/src/ProxyClass/SimpleCron.php(70): Drupal\simple_cron\SimpleCron->run()
    #17 /var/www/html/web/core/modules/system/src/CronController.php(46): Drupal\simple_cron\ProxyClass\SimpleCron->run()
    #18 [internal function]: Drupal\system\CronController->run()
    #19 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
    #20 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #21 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
    #22 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
    #23 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #24 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
    #25 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #26 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #27 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #28 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #29 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #30 /var/www/html/web/modules/contrib/advban/src/AdvbanMiddleware.php(57): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #31 /var/www/html/web/core/modules/ban/src/BanMiddleware.php(50): Drupal\advban\AdvbanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #32 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #33 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #34 /var/www/html/web/modules/contrib/remove_http_headers/src/StackMiddleware/RemoveHttpHeadersMiddleware.php(49): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #35 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #36 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #37 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
    #38 {main}
    

    Other than that the module still appears to be working fine! I use simple_cron and run all cron as single url handled by crontab file on host.

  • πŸ‡ΊπŸ‡ΈUnited States TolstoyDotCom L.A.

    I wasn't able to duplicate this, but if you look for the file core/lib/Drupal/Core/Entity/EntityStorageBase.php and then add this on line 295 or so it should output the problematic data:

    if (!is_scalar($id)) { echo '<pre>BAD VALUE ' . print_r($id, TRUE); exit; }

    So, it should look like:

      public function load($id) {
        if (!is_scalar($id)) { echo '<pre>BAD VALUE ' . print_r($id, TRUE); exit; }
        assert(!is_null($id), sprintf('Cannot load the "%s" entity with NULL ID.', $this->entityTypeId));
        $entities = $this->loadMultiple([$id]);
        return $entities[$id] ?? NULL;
      }
    

    After doing that, run cron from admin/reports/status

  • πŸ‡¬πŸ‡§United Kingdom Londova

    @TolstoyDotCom
    Following your instructions, I got the following message:
    BAD VALUE (on a white screen).

    No any message was logged.

  • πŸ‡ΊπŸ‡ΈUnited States sidgrafix

    Here's a little more info regarding the error.

    I haven't had anytime to debug this further or trying the mod suggested by TolstoyDotCom.

    However checking through dblog's I noticed the array_flip() warning is only triggered by cron on days that simple_sitemap submits to search engines. Specifically cron.simple_sitemap for me is set to run once every hour but only produces the log warning on days that queue.simple_sitemap_engine_submit is triggered (which for me is also a cron job that is scheduled for once an hour - where I use the simple_cron module for both cron and queue workers, each job as a single url) hopefully that doesn't confuse things...

    On days when sitemap isn't submitted (6 out of 7) both jobs run fine and produce no errors or warning. On the 1 day sitemap is submitted to search engines this is what happens:

    I get 2 slightly different dblogs with array_flip() warning at the same time one after the other in dblog (again when cron.simple_sitemap job is triggered on the hour)

    Here is the first stack trace:

    Warning: array_flip(): Can only flip string and integer values, entry skipped in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 312 of /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php)
    #0 /var/www/html/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real(2, 'array_flip(): C...', '/var/www/html/w...', 312)
    #1 [internal function]: _drupal_error_handler(2, 'array_flip(): C...', '/var/www/html/w...', 312)
    #2 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(312): array_flip(Array)
    #3 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(296): Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array)
    #4 /var/www/html/web/modules/contrib/simple_sitemap/src/Entity/EntityHelper.php(218): Drupal\Core\Entity\EntityStorageBase->load(NULL)
    #5 /var/www/html/web/modules/contrib/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityMenuLinkContentUrlGenerator.php(206): Drupal\simple_sitemap\Entity\EntityHelper->getEntityFromUrlObject(Object(Drupal\Core\Url))
    #6 /var/www/html/web/modules/contrib/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGeneratorBase.php(248): Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\EntityMenuLinkContentUrlGenerator->processDataSet(Object(Drupal\menu_link_content\Plugin\Menu\MenuLinkContent))
    #7 /var/www/html/web/modules/contrib/simple_sitemap/src/Queue/QueueWorker.php(360): Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\EntityUrlGeneratorBase->generate(Object(Drupal\menu_link_content\Plugin\Menu\MenuLinkContent))
    #8 /var/www/html/web/modules/contrib/simple_sitemap/src/Queue/QueueWorker.php(324): Drupal\simple_sitemap\Queue\QueueWorker->generateResultsFromElement(Object(stdClass))
    #9 /var/www/html/web/modules/contrib/simple_sitemap/src/Manager/Generator.php(174): Drupal\simple_sitemap\Queue\QueueWorker->generate('cron')
    #10 /var/www/html/web/modules/contrib/simple_sitemap/simple_sitemap.module(72): Drupal\simple_sitemap\Manager\Generator->generate('cron')
    #11 [internal function]: simple_sitemap_cron()
    #12 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(417): call_user_func_array(Object(Closure), Array)
    #13 /var/www/html/web/modules/contrib/simple_cron/src/Plugin/SimpleCron/Cron.php(70): Drupal\Core\Extension\ModuleHandler->invoke('simple_sitemap', 'cron')
    #14 /var/www/html/web/modules/contrib/simple_cron/src/Entity/CronJob.php(326): Drupal\simple_cron\Plugin\SimpleCron\Cron->process()
    #15 /var/www/html/web/modules/contrib/simple_cron/src/SimpleCron.php(102): Drupal\simple_cron\Entity\CronJob->run(1685980801, false)
    #16 /var/www/html/web/modules/contrib/simple_cron/src/ProxyClass/SimpleCron.php(70): Drupal\simple_cron\SimpleCron->run()
    #17 /var/www/html/web/core/modules/system/src/CronController.php(46): Drupal\simple_cron\ProxyClass\SimpleCron->run()
    #18 [internal function]: Drupal\system\CronController->run()
    #19 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
    #20 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #21 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
    #22 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
    #23 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #24 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
    #25 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #26 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #27 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #28 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #29 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #30 /var/www/html/web/modules/contrib/advban/src/AdvbanMiddleware.php(57): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #31 /var/www/html/web/core/modules/ban/src/BanMiddleware.php(50): Drupal\advban\AdvbanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #32 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #33 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #34 /var/www/html/web/modules/contrib/remove_http_headers/src/StackMiddleware/RemoveHttpHeadersMiddleware.php(49): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #35 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #36 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #37 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
    #38 {main}
    

    Here is the second:

    Warning: array_flip(): Can only flip string and integer values, entry skipped in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 312 of /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php)
    #0 /var/www/html/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real(2, 'array_flip(): C...', '/var/www/html/w...', 312)
    #1 [internal function]: _drupal_error_handler(2, 'array_flip(): C...', '/var/www/html/w...', 312)
    #2 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(312): array_flip(Array)
    #3 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(296): Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array)
    #4 /var/www/html/web/modules/contrib/simple_sitemap/src/Entity/EntityHelper.php(218): Drupal\Core\Entity\EntityStorageBase->load(NULL)
    #5 /var/www/html/web/modules/contrib/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/CustomUrlGenerator.php(152): Drupal\simple_sitemap\Entity\EntityHelper->getEntityFromUrlObject(Object(Drupal\Core\Url))
    #6 /var/www/html/web/modules/contrib/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGeneratorBase.php(248): Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\CustomUrlGenerator->processDataSet(Array)
    #7 /var/www/html/web/modules/contrib/simple_sitemap/src/Queue/QueueWorker.php(360): Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\EntityUrlGeneratorBase->generate(Array)
    #8 /var/www/html/web/modules/contrib/simple_sitemap/src/Queue/QueueWorker.php(324): Drupal\simple_sitemap\Queue\QueueWorker->generateResultsFromElement(Object(stdClass))
    #9 /var/www/html/web/modules/contrib/simple_sitemap/src/Manager/Generator.php(174): Drupal\simple_sitemap\Queue\QueueWorker->generate('cron')
    #10 /var/www/html/web/modules/contrib/simple_sitemap/simple_sitemap.module(72): Drupal\simple_sitemap\Manager\Generator->generate('cron')
    #11 [internal function]: simple_sitemap_cron()
    #12 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(417): call_user_func_array(Object(Closure), Array)
    #13 /var/www/html/web/modules/contrib/simple_cron/src/Plugin/SimpleCron/Cron.php(70): Drupal\Core\Extension\ModuleHandler->invoke('simple_sitemap', 'cron')
    #14 /var/www/html/web/modules/contrib/simple_cron/src/Entity/CronJob.php(326): Drupal\simple_cron\Plugin\SimpleCron\Cron->process()
    #15 /var/www/html/web/modules/contrib/simple_cron/src/SimpleCron.php(102): Drupal\simple_cron\Entity\CronJob->run(1685980801, false)
    #16 /var/www/html/web/modules/contrib/simple_cron/src/ProxyClass/SimpleCron.php(70): Drupal\simple_cron\SimpleCron->run()
    #17 /var/www/html/web/core/modules/system/src/CronController.php(46): Drupal\simple_cron\ProxyClass\SimpleCron->run()
    #18 [internal function]: Drupal\system\CronController->run()
    #19 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
    #20 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #21 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
    #22 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
    #23 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #24 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
    #25 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #26 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #27 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #28 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #29 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #30 /var/www/html/web/modules/contrib/advban/src/AdvbanMiddleware.php(57): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #31 /var/www/html/web/core/modules/ban/src/BanMiddleware.php(50): Drupal\advban\AdvbanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #32 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #33 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #34 /var/www/html/web/modules/contrib/remove_http_headers/src/StackMiddleware/RemoveHttpHeadersMiddleware.php(49): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #35 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #36 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #37 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
    #38 {main}
    

    My bad as originally I thought they were the same and didn't report there are 2 happening.

    Here is the weird part this all occurs 3 hours before queue.simple_sitemap_engine_submit job does the actual submit to search engines.

    It only happens on the day sitemap is scheduled to submit to search engines, and only happens 3 hours beforehand (always, per review of several weeks worth of logs). As to the best of my knowledge (aside from the warning) everything still works as expected.

    If/When I have some time I can set up a test with the suggestion from TolstoyDotCom, likely the day before search engine submit is scheduled (without changing any cron job scheduling via crontab -e on the host) to see if I get the info your looking for as running cron after modification likely wouldn't produce any meaningful results considering it doesn't occur on every cron run or day. I'm just not sure when I'll have time.

    Should someone be able to tackle this before I can, hopefully the information I provided will help.

  • Status changed to Active about 1 year ago
  • πŸ‡©πŸ‡ͺGermany gbyte Berlin

    OK so apparently this is a thing. Looking forward to a way to reproduce it and/or a MR. Please test/write against the dev version.

    @sidgrafix Thanks for looking into it! Strange this happens for you on days the sitemap gets submitted as the logs seem to indicate CustomUrlGenerator and EntityMenuLinkContentUrlGenerator are at fault, which run during sitemap generation (not submission).

  • πŸ‡ΊπŸ‡ΈUnited States sidgrafix

    @gbyte I don't know for sure, but if what your saying is true that actually does make sense (at least in my case) as I have Sitemap generation interval set to 1 week in "Sitemaps settings" and then for "Search engines settings" Submission Interval set to 1 week as well. Looks like they just ended up being on the same day per each's weekly interval 3 hours apart. I would guess the warning is occurring when sitemap regenerates the sitemap during cron (as also in settings I have "Regenerate the sitemaps during cron runs" checked on, which I think is default setting).

    It looks like it was a coincidental (and completely unrelated) addition in the information I last provided which made it seem "strange" that the warning was appearing on the same day sitemap submits the latest generated sitemap to search engine. The fact that the error triggered by cron.simple_sitemap on same day queue.simple_sitemap_engine_submit is run is only do to settings (my bad) as it was just something I noticed consistently in the logs - sitemap submit exactly 3 hours after the array_flip() warning occurred each week.

    Unless it's some weird thing with my setup, this should be reproducible. I may have some time towards the end of the week to run some tests on a fresh Drupal install but I make no promises in that regard, I'll try my best to get back to this as soon as I can..

  • Assigned to gbyte
  • πŸ‡©πŸ‡ͺGermany gbyte Berlin
    • gbyte β†’ committed 743e1047 on 4.x
      Issue #3360853 by Londova, gbyte, sidgrafix: Warning: array_flip(): Can...
  • Status changed to Fixed about 1 year ago
  • πŸ‡©πŸ‡ͺGermany gbyte Berlin

    I found the problem; solution has been commited to dev. Thanks!

  • πŸ‡ΊπŸ‡ΈUnited States sidgrafix

    @gbyte

    Apparently it's in latest 4.1.5 to.. (which just makes me chuckle)..not at you, myself!

    I just tried to apply patch to v4.1.4 to test (not realizing "aside from dev package" you also updated the main package) which must have been after I looked things over this morning.
    - so obviously the patch failed thanks to composer updating simple_sitemap to the latest "already patch" version, at first I thought perhaps there was a difference in line count between dev and release versions of file EntityHelper.php
    - so I cloned/copied the module after the fail and was gonna do my own patch to test and when I opened the file I saw it was updated already and couldn't help but laugh at myself.

    Thank you, I needed a good laugh today!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024