cancel
Showing results for 
Search instead for 
Did you mean: 

External script run perfect after clear browser cache otherwise show error

External script run perfect after clear browser cache otherwise show error

Hi Team,

 

I have created some external scripts for create/update product, upload product image, create product options.

All script was working fine in old server, New server configuration is also same old server but now in new server I am facing some strange issue.

These all magento 2.4.2 external scripts work fine after clear browser cache means after clear browse cache script run without any error but same script If I run second time it show below error but if I again clear browser cache than it again start working?

Any one have any idea where is the issue, 

 

error is below:

PHP Fatal error: Magento\Framework\Message\Manager::addMessage(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Magento\Framework\Message\Collection" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in /vendor/magento/framework/Message/Manager.php on line 146

 

We are using redis cache

 

Any one have any clue why this is happening?

 

Thanks

 

 

2 REPLIES 2

Re: External script run perfect after clear browser cache otherwise show error

Create a file in your root doc and use this code:

<?php
$output = shell_exec('php bin/magento cache:clean');
echo "<pre>$output</pre>";
?>

 

Re: External script run perfect after clear browser cache otherwise show error

Hi @shikharomac645 ,

 

I have added your code and run but it is not showing anything?

Can you let me know what do you want to get check?

 

Thanks