Jump to content

PHP Fatal error - Kernel Container is not available in /var/www/html/www/src/Adapter/ContainerFinder.php:77


Alpescol
 Share

Recommended Posts

Hi,

I upgraded my shop to last version and since I can't delete or create new client in BO and I can't create or change an order in BO.

When we check the logs during going to customers or orders menu, there is this message :

PHP Fatal error: Uncaught PrestaShop\PrestaShop\Core\Exception\ContainerNotFoundException: Kernel Container is not available in /var/www/html/www/src/Adapter/ContainerFinder.php:77
Stack trace:
#0 /var/www/html/www/classes/Tools.php(786): PrestaShop\PrestaShop\Adapter\ContainerFinder->getContainer()
#1 /var/www/html/www/classes/Notification.php(133): ToolsCore::getContextLocale(Object(Context))
#2 /var/www/html/www/classes/Notification.php(57): NotificationCore::getLastElementsIdsByType('order', '985')
#3 /var/www/html/www/admin224l20wmu/ajax.php(78): NotificationCore->getLastElements()
#4 {main} thrown in /var/www/html/www/src/Adapter/ContainerFinder.php on line 77

PrestaShop version: 1.7.7.5 / PHP version: 7.3.23

Has anyone ever had this problem and know how to fix it ?

Share this post


Link to post
Share on other sites

  • 3 months later...

This issue is still prevalent.... trying to understand why since 1st November,2021 Orders transacted through the WorldPay 7.0.0 module (Prestashop's own module) is throwing these errors. The error messages are generated when a customer makes transaction by Credit Card which is authorised and money taken, but the order does not generate into Back Office: (Orders for pay on collect are unaffected).

AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught PrestaShop\\PrestaShop\\Core\\Exception\\ContainerNotFoundException: Kernel Container is not available in /var/www/vhosts/httpdocs/src/Adapter/ContainerFinder.php:77\nStack trace:\n
#0 /var/www/vhosts/httpdocs/classes/Tools.php(797): PrestaShop\\PrestaShop\\Adapter\\ContainerFinder->getContainer()\n
#1 /var/www/vhosts/httpdocs/classes/PaymentModule.php(437): ToolsCore::getContextLocale()\n
#2 /var/www/vhosts/httpdocs/modules/worldpay/validation.php(117): PaymentModuleCore->validateOrder()\n
#3 {main}\n  thrown in /var/www/vhosts/httpdocs/src/Adapter/ContainerFinder.php on line 77'

Prestashop Version:  1.7.8.0
PHP Version: 7.4.25

Did anyone look at this?

Share this post


Link to post
Share on other sites

  • 1 month later...

@pbmasters it happened to me too in a module, I just had to initialize the kernel in the module/frontController as shown in a similar issue here

public function __construct()
  {
    parent::__construct();	
    // ... 
    // ... 
    global $kernel;
    if(!$kernel){ 
      require_once _PS_ROOT_DIR_.'/app/AppKernel.php';
      $kernel = new \AppKernel('prod', false);
      $kernel->boot(); 
    }
    // ... 

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More