Prestashop: Fatal error, probably memory corruption

Created on 29 May 2019  路  11Comments  路  Source: PrestaShop/PrestaShop

Describe the bug
On the client side it's an error 500, the php log show "PHP Fatal error: Uncaught PrestaShop\PrestaShop\Core\Foundation\IoC\Exception: This doesn't seem to be a class name: PrestaShop\PrestaShop\Adapter\Prlduct\PriceCalculator. in _rootdir__\src\Core\Foundation\IoC\Container.php:101"
As you can see, it search for a namespace call "Prlduct" , instead of "Product".

More over, i also notice a "PHP Fatal error: Uncaught Error: Call to undefined method Symfony\Component\Yaml\Parser::moveToPreviousLine() in _rootdir__\vendor\symfony\symfony\src\Symfony\Component\Yaml\Parser.php:743" , and of course, as you know, the method exists .

I'm not sure those errors are linked but i feel the cache is involve in some memory troubles / stack overflow ...

The version i use ( 1.7.5.1 ) is an upgrade from 1.6, where everything work find untill we put the site online, so i guess the number of access is also involve ...

To Reproduce
Unfortunaly i can not reproduce this error, it seems to happend some times, for some clients ...
Restating http server and clearing cache solve the problem for a few time ( 24/48 h )

Screenshots

Additionnal information
PrestaShop version: 1.7.5.1
PHP version: 7.2.18 x64
Apache version: 2.4.39 x64

1.7.5.1 Bug FO No change required

All 11 comments

Hi @zozizozu,

Could you please try to clear cache manually by deleting all the folder into var/cache (prod & dev).
Thanks to check and feedback.

Yes, i did clear the cache, and as i said, "clearing cache solve the problem for a few time ( 24/48 h )"

@zozizozu, thanks for your feedback.

After removal of cache try with those commands:

php -d memory_limit=-1 ./bin/console cache:clear
php -d memory_limit=-1 ./bin/console cache:clear --env=prod

Thanks to check & feedback

Actually i first did a php console , then the rm -rf
Now server is running since 24h, i let you know the next time i get this error

@zozizozu, thanks!
Waiting for your feedback.

Hi, it looks my server is still online without no troubles, sorry 掳)
I forgot to mention that i've increased RAM and CPU, maybe it helps ovoiding those troubles ...
Also forgot to said that server is running on Windows Server 2012

@zozizozu, thanks for your feedback.
since it is fixed.
I close the issue, feel free to open a new one when needed.

Thanks!

@khouloudbelguith , Ooops, it seams i only have to talk about it : i now have an error 500 accessing the backoffice ( of course, all those require failed files exists ) :

PHP Warning: require(_ROOT_DIR_\vendor\composer/../symfony/polyfill-ctype/bootstrap.php): failed to open stream: No such file or directory in _ROOT_DIR_\vendor\composerautoload_real.php on line 61
PHP Fatal error: require(): Failed opening required '_ROOT_DIR_\vendor\composer/../symfony/polyfill-ctype/bootstrap.php' (include_path='_ROOT_DIR_\vendor/pear/pear_exception;_ROOT_DIR_\vendor/pear/console_getopt;_ROOT_DIR_\vendor/pear/pear-core-minimal/src;_ROOT_DIR_\vendor/pear/archive_tar;.;C:\php\pear') in _ROOT_DIR_\vendor\composerautoload_real.php on line 61

Then i tried "php bin\console cache:clear && php bin\console cache:clear --env prod" that returns :

Warning: Uncaught Symfony\Component\Debug\Exception\ContextErrorException: Warning: require_once(_ROOT_DIR_\modules\statscatalog\vendoq\composer/autoload_static.php): failed to open stream: No such file or directory in _ROOT_DIR_\modules\statscatalog\vendor\composerautoload_real.php:28
Stack trace:

0 _ROOT_DIR_\modules\statscatalog\vendor\composerautoload_real.php(28): require_once()

1 _ROOT_DIR_\modules\statscatalog\vendorautoload.php(7): ComposerAutoloaderInit72b826fc7bd52ae9a550a3510d94a180::getLoader()

2 _ROOT_DIR_app\AppKernel.php(227): include_once('_ROOT_DIR_...')

3 _ROOT_DIR_app\AppKernel.php(76): AppKernel->enableComposerAutoloaderOnModules(Array)

4 _ROOT_DIR_\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php(488): AppKernel->registerBundles()

5 _ROOT_DIR_\vendor in _ROOT_DIR_\modules\statscatalog\vendor\composerautoload_real.php on line 28

Fatal error: ComposerAutoloaderInit72b826fc7bd52ae9a550a3510d94a180::getLoader(): Failed opening required '_ROOT_DIR_\modules\statscatalog\vendoq\composer/autoload_static.php' (include_path='_ROOT_DIR_\vendor/pear/pear_exception;_ROOT_DIR_\vendor/pear/console_getopt;_ROOT_DIR_\vendor/pear/pear-core-minimal/src;_ROOT_DIR_\vendor/pear/archive_tar;.;C:\php\pear') in _ROOT_DIR_\modules\statscatalog\vendor\composerautoload_real.php on line 28

In autoload_real.php line 28:

Compile Error: ComposerAutoloaderInit72b826fc7bd52ae9a550a3510d94a180::getLoader(): Failed opening required '_ROOT_DIR_\modules\statscatalog\vendoq\composer/autoload_static.php' (include_path='_ROOT_DIR_\vendor/pear/pear_exception;_ROOT_DIR_\vendor/pear/console_getopt;_ROOT_DIR_\vendor/pear/pear-core-minimal/src;_ROOT_DIR_\vendor/pear/archive_tar;.;C:\php\pear')

I finally remove manually var\cache , remove vendor 's directory and replace by the original vendor from the archieve, and it looks ok

@zozizozu, thanks for these clarifications.

@khouloudbelguith, Thanks to you for paying attention.
Are you sure you want to let this issue close ? I feel all these errors are linked to the cache management.
Parsing old logs files, i found some

PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Yaml\Yaml' not found in ...\src\Core\Addon\Theme\Theme.php:41

and

PHP Fatal error: Class 'Symfony\Component\HttpKernel\Kernel' not found in ...app\AppKernel.php on line 33

I guess that if core's file are not found, and existing functions are undefined, it's probably some kind of stack overflow.

Hi, I finally find out what was generate these strange behaviour : i have set opcache.enable to 0 and since 6 days, i have no errors.
Thanks again

Was this page helpful?
0 / 5 - 0 ratings