OpenMage / magento-lts

Official OpenMage LTS codebase | Migrate easily from Magento Community Edition in minutes! Download the source code for free or contribute to OpenMage LTS | Security vulnerability patches, bug fixes, performance improvements and more.
https://www.openmage.org
Open Software License 3.0
863 stars 438 forks source link

Fatal error after upgrading from 20.1.1 to 20.8 when clearing cache from Admin Page #4018

Closed samex closed 1 month ago

samex commented 1 month ago

After upgrading OpenMage from version 20.1.1 to 20.8, I encountered a fatal error when attempting to clear the cache from the Admin Page.

Environment:

  1. OpenMage 20.8
  2. PHP Version 7.4.28, Apache, MariaDB

Reproduce

  1. Update OpenMage from version 20.1.1 to 20.8.
  2. Flush the cache from the admin page.

Expected

  1. Cache should be cleared without errors.
  2. Website should function correctly.

Actual result

  1. Error message is displayed on any page:
    
    Fatal error:  Uncaught Error: Call to undefined method Mage_Core_Model_Config::getCacheSaveLock() in /app/htdocs/app/code/core/Mage/Core/Model/App.php:436
    Stack trace:
    #0 /app/htdocs/app/code/core/Mage/Core/Model/App.php(347): Mage_Core_Model_App->_initModules()
    # 1 /app/htdocs/app/Mage.php(761): Mage_Core_Model_App->run(Array)
    # 2 /app/htdocs/index.php(56): Mage::run('', 'store')
    # 3 {main}

Next Error: Call to undefined method Mage_Core_Model_Config::releaseCacheSaveLock() in /app/htdocs/app/code/core/Mage/Core/Model/App.php:449 Stack trace:

0 /app/htdocs/app/code/core/Mage/Core/Model/App.php(347): Mage_Core_Model_App->_initModules()

1 /app/htdocs/app/Mage.php(761): Mage_Core_Model_App->run(Array)

2 /app/htdocs/index.php(56): Mage::run('', 'store')

3 {main}

thrown in /app/htdocs/app/code/core/Mage/Core/Model/App.php on line 449


Workaround: 

**If the cache is flushed from CLI, the site works correctly, but clearing the cache from the admin page results in the above error.**

I have tried using PHP 8.2, but encountered numerous errors with third-party modules that need to be resolved. PHP 7.4 still seems to work for now.
fballiano commented 1 month ago

I can't reproduce the error on a fresh install

Screenshot 2024-05-28 alle 09 29 48

the method is in the correct file

Screenshot 2024-05-28 alle 09 30 51

do you have something in app/code/local/Mage overriding core files?

samex commented 1 month ago

Thank you for your quick and accurate response. Indeed, I had core files in the code/local directory. I deleted them, and now it is working as expected. Thanks again!