Jump to content

Activating Prestashop checkout module gives fatal error


Recommended Posts

Hi, I have recently upgraded my shop from Prestashop 1.7 to 8.2.4 and everything is just fine except that when I try to activate Prestashop checkout or Paypal modules this is what I get: 

Fatal error: Uncaught PrestaShop\PrestaShop\Core\Exception\ContainerNotFoundException: Kernel Container is not available in /home/silvesyx/test.silvestricamerashop.it/silvesyx/src/Adapter/ContainerFinder.php:77 Stack trace: #0 /home/silvesyx/test.silvestricamerashop.it/silvesyx/classes/module/Module.php(1702): PrestaShop\PrestaShop\Adapter\ContainerFinder->getContainer() #1 /home/silvesyx/test.silvestricamerashop.it/silvesyx/classes/module/Module.php(1691): ModuleCore::getModuleRepository() #2 /home/silvesyx/test.silvestricamerashop.it/silvesyx/classes/Hook.php(884): ModuleCore::getNativeModuleList() #3 /home/silvesyx/test.silvestricamerashop.it/silvesyx/classes/Dispatcher.php(606): HookCore::exec('moduleRoutes', Array, NULL, true, false) #4 /home/silvesyx/test.silvestricamerashop.it/silvesyx/classes/Dispatcher.php(243): DispatcherCore->loadRoutes() #5 /home/silvesyx/test.silvestricamerashop.it/silvesyx/classes/Dispatcher.php(201): DispatcherCore->__construct(Object(Symfony\Component\HttpFoundation\Request)) #6 /home/silvesyx/test.silvestricamerashop.it/silvesyx/index.php(28): DispatcherCore::getInstance() #7 {main} thrown in /home/silvesyx/test.silvestricamerashop.it/silvesyx/src/Adapter/ContainerFinder.php on line 77

Overraid desabled, cache cleared from BO, manually and on Chrome.

Any suggestion, please?

Link to comment
Share on other sites

5 minutes ago, ComGrafPL said:

Tried to totally remove those modules, clear cache from VAR and install manually?

Ok, modules removed and var/cache cleared, sorry but what do you mean by installing the module manually? uploading it to file manager? what is the correct procedure?

Link to comment
Share on other sites

That stack trace is the classic moduleRoutes hook getting executed too early (Front Office legacy dispatcher is loading routes, but the Symfony kernel/container isn’t bootstrapped yet). On upgrades 1.7 → 8.x this can happen when a module ends up registered on moduleRoutes in the DB, and FO then dies with:

ContainerNotFoundException: Kernel Container is not available

A proven fix (used for ps_checkout, same idea for PayPal) is: remove that module’s moduleRoutes hook registration (and remove the hook alias row if present).

Fix (DB) — safest/fastest

  1. Backup your database first.
  2. Open phpMyAdmin (or CLI) and run these queries, replacing PREFIX_ with your table prefix (often ps_):

DELETE FROM PREFIX_hook_module
WHERE id_module = (SELECT id_module FROM PREFIX_module WHERE name = 'ps_checkout')
AND id_hook = (SELECT id_hook FROM PREFIX_hook WHERE name = 'moduleRoutes');

DELETE FROM PREFIX_hook_alias
WHERE alias = 'moduleRoutes';

This exact approach is what solved the same crash after activating ps_checkout.

For PayPal (usually ps_paypal)

DELETE FROM PREFIX_hook_module
WHERE id_module = (SELECT id_module FROM PREFIX_module WHERE name = 'ps_paypal')
AND id_hook = (SELECT id_hook FROM PREFIX_hook WHERE name = 'moduleRoutes');

DELETE FROM PREFIX_hook_alias
WHERE alias = 'moduleRoutes';

Then clear cache

 

Link to comment
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
×
×
  • Create New...