Skip to content

Fatal error: Kernel Container is not available (PrestaShop 8.x) #1603

@go-sudo

Description

@go-sudo

Prerequisites

Describe the bug and add attachments

After upgrading a shop from PrestaShop 1.7.x to PrestaShop 8.x, the application crashes immediately on both Front Office and Back Office with a fatal error:

Kernel Container is not available
Fatal error: Uncaught PrestaShop\PrestaShop\Core\Exception\ContainerNotFoundException: Kernel Container is not available in /home//domains/public_html/src/Adapter/ContainerFinder.php:77 Stack trace: #0 /home//domains/public_html/classes/module/Module.php(1702): PrestaShop\PrestaShop\Adapter\ContainerFinder->getContainer() PrestaShop/PrestaShop#1 /home//domains/.com/public_html/classes/module/Module.php(1691): ModuleCore::getModuleRepository() PrestaShop/PrestaShop#2 /home//domains/.com/public_html/classes/Hook.php(884): ModuleCore::getNativeModuleList() PrestaShop/PrestaShop#3 /home//domains/.com/public_html/classes/Dispatcher.php(606): HookCore::exec() PrestaShop/PrestaShop#4 /home//domains/.com/public_html/classes/Dispatcher.php(243): DispatcherCore->loadRoutes() PrestaShop/PrestaShop#5 /home//domains/.com/public_html/classes/Dispatcher.php(201): DispatcherCore->__construct() PrestaShop/PrestaShop#6 /home///.com/public_html/index.php(28): DispatcherCore::getInstance() PrestaShop/PrestaShop#7 {main} thrown in /home//domains/.com/public_html/src/Adapter/ContainerFinder.php on line 77

The error occurs during the early bootstrap phase, before the Symfony kernel is fully initialized.
As a result, the shop becomes completely inaccessible (HTTP 500).

This issue happens even when all modules are disabled, overrides are disabled, and the Classic theme is used.

❗ Actual behavior

The shop crashes on every request (FO and BO).

A fatal error is thrown from ContainerFinder::getContainer().

No recovery is possible from the Back Office.

Clearing cache or disabling modules does not resolve the issue.

Expected behavior

PrestaShop should not throw a fatal exception when the Symfony container is not yet available.

Route loading (moduleRoutes) should be deferred until the kernel is fully booted, or

The container lookup should fail gracefully (return null) instead of crashing the application.

Steps to reproduce

🔁 Steps to reproduce

Start with a working PrestaShop 1.7.x shop.

Perform an upgrade to PrestaShop 8.x (via 1-Click Upgrade or manual replacement).

Ensure the upgrade is not a fresh install (existing database reused).

Clear the cache manually:

/var/cache/dev
/var/cache/prod

Disable all non-native modules and overrides.

Run the shop on PHP 8.2.x (also reproducible on PHP 8.1 in a broken upgrade state).

Access the Front Office or Back Office.

❌ Result

The shop crashes immediately with a fatal error:

PrestaShop\PrestaShop\Core\Exception\ContainerNotFoundException
Kernel Container is not available

Thrown from:

src/Adapter/ContainerFinder.php

During route loading (Dispatcher::loadRoutes() → moduleRoutes).

PrestaShop version(s) where the bug happened

1.7.8.11

How you installed PrestaShop

8.2.3

PHP version(s) where the bug happened

8.2.3

If your bug is related to a module, specify its name and its version

No response

Your company or customer's name goes here (if applicable).

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Blocked

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions