Site is down after enabling the module

Created on 22 February 2024, 10 months ago
Updated 28 February 2024, 10 months ago

Problem/Motivation

After installing the extension to Drupal 10, my site is inaccessible and I get the following error:

The website encountered an unexpected error. Try again later.
Error: Call to undefined function Drupal\nitropack\EventSubscriber\nitropack_handle_request() in Drupal\nitropack\EventSubscriber\NitropackSubscriber->onKernelRequest() (line 87 of modules/nitropack/src/EventSubscriber/NitropackSubscriber.php).
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 157)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

Install the latest available version of the extension and enable it. Upon enabling, the site becomes inaccessible both frontend and backend. You can find the error text above.

🐛 Bug report
Status

RTBC

Version

1.1

Component

Code

Created by

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

Merge Requests

Comments & Activities

  • Issue created by @joyceflorenc3
  • First commit to issue fork.
  • Merge request !3Fixed eventsubscriber issue → (Merged) created by sumit-k
  • Status changed to Needs review 10 months ago
  • 🇮🇳India sumit-k

    After module installation encountered the following error. Raised MR!3 to fix the following issues.

    TypeError: Drupal\nitropack\EventSubscriber\NitropackSubscriber::onRespond(): Argument #1 ($event) must be of type Symfony\Component\HttpKernel\Event\FilterResponseEvent, Symfony\Component\HttpKernel\Event\ResponseEvent given in Drupal\nitropack\EventSubscriber\NitropackSubscriber->onRespond() (line 134 of modules/contrib/nitropack/src/EventSubscriber/NitropackSubscriber.php).

    The website encountered an unexpected error. Try again later.
    
    Error: Call to undefined method Symfony\Component\HttpKernel\Event\ResponseEvent::isMasterRequest() in Drupal\nitropack\EventSubscriber\NitropackSubscriber->onRespond() (line 136 of modules/contrib/nitropack/src/EventSubscriber/NitropackSubscriber.php).
  • Status changed to Fixed 10 months ago
  • I have merged your PR. Please make sure to install the module using Composer, as it relies on an external SDK.

    Please check with the latest release and let me know if you are still facing the issues.

  • Thanks a lot. Unfortunately, my website is still inaccessible, and now it shows a different error:

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

    Error: Cannot use object of type __PHP_Incomplete_Class as array in Drupal\Core\Render\RenderCache->get() (line 76 of core/lib/Drupal/Core/Render/RenderCache.php).
    Drupal\Core\Render\PlaceholderingRenderCache->get() (Line: 282)
    Drupal\Core\Render\Renderer->doRender() (Line: 458)
    Drupal\Core\Render\Renderer->doRender() (Line: 204)
    Drupal\Core\Render\Renderer->render() (Line: 474)
    Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 99)
    __TwigTemplate_08434a4b066b57b3dedb1ad0c753d0db->doDisplay() (Line: 394)
    Twig\Template->displayWithErrorHandling() (Line: 367)
    Twig\Template->display() (Line: 379)
    Twig\Template->render() (Line: 40)
    Twig\TemplateWrapper->render() (Line: 53)
    twig_render_template() (Line: 372)
    Drupal\Core\Theme\ThemeManager->render() (Line: 445)
    Drupal\Core\Render\Renderer->doRender() (Line: 204)
    Drupal\Core\Render\Renderer->render() (Line: 474)
    Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 93)
    __TwigTemplate_19a0e0ebd38dd69d0308a7cd58edc4bf->doDisplay() (Line: 394)
    Twig\Template->displayWithErrorHandling() (Line: 367)
    Twig\Template->display() (Line: 379)
    Twig\Template->render() (Line: 40)
    Twig\TemplateWrapper->render() (Line: 53)
    twig_render_template() (Line: 372)
    Drupal\Core\Theme\ThemeManager->render() (Line: 445)
    Drupal\Core\Render\Renderer->doRender() (Line: 204)
    Drupal\Core\Render\Renderer->render() (Line: 158)
    Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 592)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 153)
    Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
    Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
    call_user_func() (Line: 111)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 186)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 191)
    Drupal\page_cache\StackMiddleware\PageCache->fetch() (Line: 128)
    Drupal\page_cache\StackMiddleware\PageCache->lookup() (Line: 82)
    Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
    Drupal\Core\DrupalKernel->handle() (Line: 19)

    I did use composer as you suggest, this was the command I used:

    composer require 'drupal/nitropack:^1.1@alpha

  • 🇮🇳India sumit-k

    Verified the changes, and everything seems to be working fine on my end. I've also attached a screenshot for reference. Joyceflorenc3, could you please provide more details such as the version of Drupal core and PHP you are using? This information will help us troubleshoot any potential compatibility issues. Thanks!

  • Status changed to Active 10 months ago
  • I am using Drupal 10.2.3 and PHP 8.1.27. I tried with PHP 8.2 and 8.3 but had the same result.

    Just wanted to clarify that I am currently seeing the error only in the website's admin backend. The frontend of the website is accessible.

  • 🇮🇳India sumit-k

    Thanks for clarification Joy. It appears that I'm unable to replicate this issue on the same version. It's possible that there might be conflicts with other modules causing this behavior. Can you please share the URL where the error is coming?

  • Status changed to Needs review 10 months ago
  • 🇮🇳India sumit-k

    Updating the status to "Needs Review" to gather feedback on the patch and gather opinions from others who might be experiencing the same issue.

  • 🇮🇳India Jasjeet Kaur Brar

    @sumit, Yes, @joy is right. I am using drupal 10.2, php 8.1 version.
    You can see the website is down after enabling the module. https://prnt.sc/FbQ1r3iw0Rjv
    Even after implementing the merge request, the error is still there. https://prnt.sc/lp268lwSEikV
    the functions called in code are not defined anywhere.

  • 🇮🇳India Jasjeet Kaur Brar

    But in latest release all this issue is already taken care of.

  • Status changed to RTBC 10 months ago
  • 🇮🇳India sumit-k

    Thank you for the review, @Jasjeet. I've verified the issue on the latest release and it seems to be resolved. Your confirmation confirms that it has been addressed in the latest release. Seems Pr is merged on the latest release. In my opinion, this ticket can now be closed.

  • 🇮🇳India Jasjeet Kaur Brar

    @ thanks sumit for the review.

  • Hello Jasjeet and Sumit,

    The function called are part of Nitropack, which are injected when the module is installed by running `composer install drupal/nitropack`.

    Ref: https://github.com/atj4me/nitropack-sdk

    This package is added as a dependency in composer.json, so if the module is installed through direct upload, the dependent won't be installed, and thus shows the error.

    Regards,
    Ajith

Production build 0.71.5 2024