Deprecated function: Memcache::addserver

Created on 25 January 2023, almost 2 years ago
Updated 18 October 2023, about 1 year ago

Deprecated function: Memcache::addserver(): Passing null to parameter #3 ($persistent) of type bool is deprecated in Drupal\memcache_storage\DrupalMemcache->addServer() (line 87 of /home/site/modules/contrib/memcache_storage/src/DrupalMemcache.php)

php 8.1
Drupal 9.5.2

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇺🇦Ukraine proweb.ua

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

Comments & Activities

  • Issue created by @proweb.ua
  • 🇦🇺Australia Stephen Ollman Canberra

    Getting same/similar errors.

    Warning: Invalid argument supplied for foreach() in Drupal\memcache_storage\DrupalMemcachedBase->addServers() (line 164 of modules/contrib/memcache_storage/src/DrupalMemcachedBase.php).
    Drupal\memcache_storage\DrupalMemcachedBase->addServers(Array) (Line: 140)
    Drupal\memcache_storage\DrupalMemcachedBase->__construct(Array, 'default') (Line: 59)
    Drupal\memcache_storage\DrupalMemcached->__construct(Array, 'default') (Line: 86)
    Drupal\memcache_storage\DrupalMemcachedFactory->get('cache_render') (Line: 64)
    Drupal\memcache_storage\MemcachedBackendFactory->get('render') (Line: 83)
    Drupal\Core\Cache\CacheFactory->get('render') (Line: 71)
    Drupal\Core\Render\RenderCache->get(Array) (Line: 109)
    Drupal\Core\Render\PlaceholderingRenderCache->get(Array) (Line: 273)
    Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
    Drupal\Core\Render\Renderer->render(Array) (Line: 479)
    Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 83)
    __TwigTemplate_b99234c586e061ea41475f131c10f44b1c8da25027a87c5c33412de918741db3->doDisplay(Array, Array) (Line: 405)
    Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
    Twig\Template->display(Array) (Line: 390)
    Twig\Template->render(Array) (Line: 55)
    twig_render_template('themes/contrib/gin/templates/html.html.twig', Array) (Line: 384)
    Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 433)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
    Drupal\Core\Render\Renderer->render(Array) (Line: 162)
    Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 163)
    Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
    Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
    call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
    Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
    Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

    Warning: sizeof(): Parameter must be an array or an object that implements Countable in Drupal\memcache_storage\DrupalMemcachedBase->addServers() (line 174 of modules/contrib/memcache_storage/src/DrupalMemcachedBase.php).
    Drupal\memcache_storage\DrupalMemcachedBase->addServers(Array) (Line: 140)
    Drupal\memcache_storage\DrupalMemcachedBase->__construct(Array, 'default') (Line: 59)
    Drupal\memcache_storage\DrupalMemcached->__construct(Array, 'default') (Line: 86)
    Drupal\memcache_storage\DrupalMemcachedFactory->get('cache_render') (Line: 64)
    Drupal\memcache_storage\MemcachedBackendFactory->get('render') (Line: 83)
    Drupal\Core\Cache\CacheFactory->get('render') (Line: 71)
    Drupal\Core\Render\RenderCache->get(Array) (Line: 109)
    Drupal\Core\Render\PlaceholderingRenderCache->get(Array) (Line: 273)
    Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
    Drupal\Core\Render\Renderer->render(Array) (Line: 479)
    Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 83)
    __TwigTemplate_b99234c586e061ea41475f131c10f44b1c8da25027a87c5c33412de918741db3->doDisplay(Array, Array) (Line: 405)
    Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
    Twig\Template->display(Array) (Line: 390)
    Twig\Template->render(Array) (Line: 55)
    twig_render_template('themes/contrib/gin/templates/html.html.twig', Array) (Line: 384)
    Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 433)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
    Drupal\Core\Render\Renderer->render(Array) (Line: 162)
    Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 163)
    Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
    Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
    call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
    Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
    Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

    Warning: Invalid argument supplied for foreach() in Drupal\memcache_storage\DrupalMemcached->getMulti() (line 177 of modules/contrib/memcache_storage/src/DrupalMemcached.php).
    Drupal\memcache_storage\DrupalMemcached->getMulti(Array, '') (Line: 199)
    Drupal\memcache_storage\DrupalMemcachedBase->get('memcache_storage_bin_indexes') (Line: 301)
    Drupal\memcache_storage\DrupalMemcachedBase->getBinIndex('cache_render') (Line: 244)
    Drupal\memcache_storage\DrupalMemcachedBase->itemKey('toolbar:[languages:language_interface]=en:[theme]=gin:[user.permissions]=28b30bc4db7bd359b0954c99b8deafb83604cf1f40aa5e322388e109be07e303', 'cache_render') (Line: 158)
    Drupal\memcache_storage\DrupalMemcached->getMulti(Array, 'cache_render') (Line: 92)
    Drupal\memcache_storage\MemcachedBackend->getMultiple(Array, ) (Line: 82)
    Drupal\memcache_storage\MemcachedBackend->get('toolbar:[languages:language_interface]=en:[theme]=gin:[user.permissions]=28b30bc4db7bd359b0954c99b8deafb83604cf1f40aa5e322388e109be07e303') (Line: 71)
    Drupal\Core\Render\RenderCache->get(Array) (Line: 109)
    Drupal\Core\Render\PlaceholderingRenderCache->get(Array) (Line: 273)
    Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
    Drupal\Core\Render\Renderer->render(Array) (Line: 479)
    Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 83)
    __TwigTemplate_b99234c586e061ea41475f131c10f44b1c8da25027a87c5c33412de918741db3->doDisplay(Array, Array) (Line: 405)
    Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
    Twig\Template->display(Array) (Line: 390)
    Twig\Template->render(Array) (Line: 55)
    twig_render_template('themes/contrib/gin/templates/html.html.twig', Array) (Line: 384)
    Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 433)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
    Drupal\Core\Render\Renderer->render(Array) (Line: 162)
    Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 163)
    Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
    Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
    call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
    Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
    Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

    .......

  • Assigned to Shreya_98
  • @shreya_th opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • 🇮🇳India Shreya_98

    Hi @proweb.ua,
    I have fixed this issue i.e. "Deprecated function: Memcache::addserver()" and also created MR for this issue . Kindly review the changes.

    Thank you.

Production build 0.71.5 2024