When trying to run even simple command like:
php bin/magento cache:clean
It just stucks. Though some of the command like
php bin/magento cache:disable
php bin/magento cache:enable
php bin/magento index:reindex
do run. but for the commands, which stucks, when I see the server load keeps increasing to staggering number like form 1% it goes up to 35%
I am not able to find out where is the issue. in the same installation, I was able to run these commands.
update:if I run the command with memory_limit=-1
the script never seems to end, but if I limit it like
`memory_limit=10G'
I get this error
Running schema recurring...PHP Fatal error: Allowed memory size of 10737418240 bytes exhausted (tried to allocate 20480 bytes) in /web/vendor/magento/framework/App/State.php on line 152
the relevant code on line 152 reads like this:
/**
* Get area code
*
* @return string
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function getAreaCode()
{
if (!isset($this->_areaCode)) {
throw new \Magento\Framework\Exception\LocalizedException(
new \Magento\Framework\Phrase('Area code is not set')
);
}
return $this->_areaCode;
}
and the module which seems responsible for the error, the code looks like this:
class AppState
{
/**
* @var \Magento\Framework\App\State
*/
protected $state;
/**
* @param \Magento\Framework\App\State $state
*/
public function __construct(\Magento\Framework\App\State $state) {
$this->state = $state;
}
/**
* @return bool
*/
public function isFrontendArea()
{
try {
if ($this->state->getAreaCode() == Area::AREA_ADMINHTML) {
return false;
}
} catch (LocalizedException $e) {
/* Area is not initialized. Do nothing. */
return true;
}
return true;
}
}
I think this info is enough for any expert to find the issue I am facing.
Thanks.