The website encountered an unexpected error. Please try again later.

Created on 17 July 2023, over 1 year ago
Updated 20 July 2023, over 1 year ago

Updated from Visitors 8.x-2.14 to 8.x-2.15, and got a "The website encountered an unexpected error. Please try again later.". Didn't have time to investigate too much other than logging information. I rolled back to version 8.x-2.14 and things went back to normal.

Thanks.

The website encountered an unexpected error. Please try again later.

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "visitors.visibility". in Drupal\Component\DependencyInjection\Container->get() (line 157 of core/lib/Drupal/Component/DependencyInjection/Container.php).

Drupal::service() (Line: 274)
visitors_page_attachments_alter() (Line: 562)
Drupal\Core\Extension\ModuleHandler->alter() (Line: 323)
Drupal\Core\Render\MainContent\HtmlRenderer->invokePageAttachmentHooks() (Line: 289)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 290)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
call_user_func() (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 57)
Drupal\advban\AdvbanMiddleware->handle() (Line: 50)
Drupal\ban\BanMiddleware->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 718)
Drupal\Core\DrupalKernel->handle() (Line: 19)

The website encountered an unexpected error. Please try again later.
Error: Class "Drupal\visitors\EventSubscriber\KernelTerminateSubscriber" not found in Drupal\Component\DependencyInjection\Container->createService() (line 259 of core/lib/Drupal/Component/DependencyInjection/Container.php).

Drupal\Component\DependencyInjection\Container->createService() (Line: 177)
Drupal\Component\DependencyInjection\Container->get() (Line: 136)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 103)
Symfony\Component\HttpKernel\HttpKernel->terminate() (Line: 32)
Stack\StackedHttpKernel->terminate() (Line: 702)
Drupal\Core\DrupalKernel->terminate() (Line: 22)

πŸ› Bug report
Status

Fixed

Version

2.15

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States corE

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

Comments & Activities

  • Issue created by @corE
  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    Hi @corE,

    Tank you for reporting the bug.

    How did you install the update? Did you use composer? Did you put your site into Maintenace mode before install 8.x-2.15?

    The error is referencing new services added in 8.x-2.15: visitors.visibility. It is also refencing another service/class KernelTerminateSubscriber which was removed.

    The cache needs to be cleared so Drupal knows about available services. The visitors_update_8216 function will also clear the cache. You should be able to go to http:///update.php to run the update.

    I can understand the frustration of a white screen of death. If we put the contents of visitors_entity_view(), in a try/catch, it should prevent one of the errors.

    KernelTerminateSubscriber has been removed. I think clearing the cache is the only way to clear the second error.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    50 pass
  • @bluegeek9 opened merge request.
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    50 pass
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    50 pass
    • bluegeek9 β†’ committed d0c50b17 on 8.x-2.x
      Issue #3375094: The website encountered an unexpected error. Please try...
  • πŸ‡ΊπŸ‡ΈUnited States corE

    Thank you bluegeek9;

    I installed via admin UI update screen... put into maint mode and cleared cache before update download, but not after. After it downloaded is when I noticed the white screen and did not proceed to update.php. I didn't have time to do much so I just grabbed the error info and restored the old files (ftp). I'll take another try later. My apologies if I reported in error (or if reported a non-issue).

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

    Hi corE,

    I was able to fix the white screen of death issue with a try/catch. The KernelTerminateSubscriber error gets logged to Recent messages, but doesn't break the site.

    I am testing 8.x-2.16. We added a view counter like the statistics module.

  • Status changed to Fixed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024