After upgrade to Magento 2.4 I get "Class configured_block_cache does not exist"

After upgrade to Magento 2.4 I get "Class configured_block_cache does not exist"

July 10, 2026 · Illustrated author avatarBy Stefan Bogdanescu
After upgrade to Magento 2.4 I get "Class configured_block_cache does not exist"

Troubleshooting “Class configured_block_cache does not exist” Error After Magento 2.4 Upgrade

If you’ve recently upgraded your Magento 2 store to version 2.4 and are encountering the error “Class configured_block_cache does not exist,” you’re not alone. This issue appears to be related to the Content Security Policy (CSP) module introduced in Magento 2.4.

Understanding the Problem

The error occurs because the CSP module defines a cache instance named configured_block_cache and attempts to use it during runtime. However, this cache does not actually exist by default in your system configuration.

Here’s what’s happening behind the scenes:

  1. The CSP module defines the Magento\Csp\Model\BlockCache class with an argument for the cache name: <argument name="cache" xsi:type="object">configured_block_cache</argument>.

  2. During the generation of metadata files (like generated/metadata/frontend.php), this configuration is applied, resulting in a reference to a non-existent cache.

  3. When you access your storefront or admin area after the upgrade, Magento attempts to instantiate the Magento\Csp\Model\BlockCache class, which leads to the reflection exception you’re seeing.

Potential Causes and Workarounds

There are a few possible reasons why this issue might occur:

  1. Incomplete Upgrade Process: Ensure that your upgrade was completed successfully without any errors or interruptions in the process.

  2. Conflicting Configuration Settings: Check if there are any conflicting cache configurations in your custom theme, extensions, or environment configuration files (like env.php).

  3. Missed Recompilation Steps: After updating to Magento 2.4, it’s crucial to recompile and clear static content to ensure that the new changes take effect properly.

Step-by-Step Solution

To resolve this issue, follow these steps:

  1. Recompile Your Code:

    php bin/magento setup:di:compile
    
  2. Clear Static Content:

    php bin/magento cache:clean
    php bin/magento cache:flush
    
  3. Check and Reset Cache Types: Use the following commands to reset all cache types:

    php bin/magento cache:disable
    php bin/magento cache:clean
    php bin/magento cache:flush
    php bin/magento cache:enable
    
  4. Disable and Re-enable CSP Module: If the above steps don’t resolve the issue, try temporarily disabling the CSP module by renaming its directory:

    mv app/code/Magento/Csp app/code/Magento/Csp.disabled
    

    Then re-enable it after verifying that the error is resolved:

    mv app/code/Magento/Csp.disabled app/code/Magento/Csp
    php bin/magento setup:di:compile
    php bin/magento cache:clean
    php bin/magento cache:flush
    

Conclusion

The “Class configured_block_cache does not exist” error typically occurs due to an incomplete upgrade process or conflicting configuration settings. By following the steps outlined above, you should be able to resolve this issue and minimize any potential downtime for your store.

Remember to always backup your data before performing any major operations on your Magento 2 store. If you’re unsure about any aspect of the upgrade process, consider seeking assistance from a professional developer or contacting Laravel Company for expert guidance and support.

In most cases, recompiling your code, clearing static content, and resetting cache types should be sufficient to resolve this problem. If you continue to experience difficulties, feel free to reach out to our team of Magento experts at Laravel Company for a more in-depth analysis and customized solution tailored to your specific needs.

Magento 2 Cache Security Extensions

Our network