cron error Cannot instantiate interface magenot 2Syntax error, unexpected '.' in ObjectManagerFactoryAbstractFactory.phpMagento 2 : after upgrading magento 2 with command site not workingUncaught Error: Cannot instantiate interface Developer.php“There has been an error processing your request” in Admin area after installationFatal error on FrameworkMagento 2.2.2 - Admin Configuration loading problemHow to install extension using composer - Magento EE 2.2 ( Production )Magento 2: Can't install or uninstall plugins in magento 2Fatal error: Uncaught TypeError: Argument 1 passed to __construct() must be of the type array, null give

If Earth is tilted, why is Polaris always above the same spot?

Where did the extra Pym particles come from in Endgame?

Stateful vs non-stateful app

What's the polite way to say "I need to urinate"?

What is the strongest case that can be made in favour of the UK regaining some control over fishing policy after Brexit?

What word means to make something obsolete?

Can I get candy for a Pokemon I haven't caught yet?

Reverse the word in a string with the same order in javascript

Was there a Viking Exchange as well as a Columbian one?

Do generators produce a fixed load?

Confusion about capacitors

Unexpected email from Yorkshire Bank

Does the EU Common Fisheries Policy cover British Overseas Territories?

Pressure to defend the relevance of one's area of mathematics

When and why did journal article titles become descriptive, rather than creatively allusive?

You look catfish vs You look like a catfish

Pulling the rope with one hand is as heavy as with two hands?

Has any spacecraft ever had the ability to directly communicate with civilian air traffic control?

Binary Numbers Magic Trick

Why do TACANs not have a symbol for compulsory reporting?

Can solid acids and bases have pH values? If not, how are they classified as acids or bases?

Is it possible to Ready a spell to be cast just before the start of your next turn by having the trigger be an ally's attack?

When did stoichiometry begin to be taught in U.S. high schools?

Multiple options for Pseudonyms



cron error Cannot instantiate interface magenot 2


Syntax error, unexpected '.' in ObjectManagerFactoryAbstractFactory.phpMagento 2 : after upgrading magento 2 with command site not workingUncaught Error: Cannot instantiate interface Developer.php“There has been an error processing your request” in Admin area after installationFatal error on FrameworkMagento 2.2.2 - Admin Configuration loading problemHow to install extension using composer - Magento EE 2.2 ( Production )Magento 2: Can't install or uninstall plugins in magento 2Fatal error: Uncaught TypeError: Argument 1 passed to __construct() must be of the type array, null give






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I'm getting the following error on magento cron execution:



Fatal error: Uncaught Error: Cannot instantiate interface MagentoFrameworkLockLockManagerInterface in /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111
Stack trace:
#0 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): MagentoFrameworkObjectManagerFactoryAbstractFactory->createObject('Magento\Framewo...', Array)
#1 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): MagentoFrameworkObjectManagerFactoryCompiled->create('Magento\Framewo...')
#2 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): MagentoFrameworkObjectManagerFactoryCompiled->get('Magento\Framewo...')
#3 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): MagentoFrameworkObjectManagerFactoryCompiled->create('KiwiCommerce\Cr...')
#4 /home/mywebsite/public_html/vendor/magento/framework/Event/ObserverFactory.php(33): MagentoFrame in /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111


What can I do to fix this?



-----UPDATE------



I just discovered that error was caused by an extension that tries to use MagentoFrameworkLockLockManagerInterface in a constructor.
Here's a sample of the code:



namespace KiwiCommerceCronSchedulerObserver;

use MagentoFrameworkAppState;
use MagentoFrameworkConsoleCli;
use MagentoFrameworkEventObserverInterface;
use MagentoCronModelSchedule;
use MagentoFrameworkProfilerDriverStandardStat;
use MagentoFrameworkProfilerDriverStandardStatFactory;

class ProcessCronQueueObserverDefault extends MagentoCronObserverProcessCronQueueObserver
{

private $logger;
private $state;
private $scheduleHelper = null;
private $jobHelper = null;
private $lockManager;
private $invalid = [];

public function __construct(
MagentoFrameworkObjectManagerInterface $objectManager,
MagentoCronModelScheduleFactory $scheduleFactory,
MagentoFrameworkAppCacheInterface $cache,
MagentoCronModelConfigInterface $config,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoFrameworkAppConsoleRequest $request,
MagentoFrameworkShellInterface $shell,
MagentoFrameworkStdlibDateTimeDateTime $dateTime,
MagentoFrameworkProcessPhpExecutableFinderFactory $phpExecutableFinderFactory,
PsrLogLoggerInterface $logger,
MagentoFrameworkAppState $state,
StatFactory $statFactory,
MagentoFrameworkLockLockManagerInterface $lockManager,
KiwiCommerceCronSchedulerHelperSchedule $scheduleHelper,
KiwiCommerceCronSchedulerHelperCronjob $jobHelper
)

$construct= "__construct"; // in order to bypass the compiler
parent::$construct($objectManager, $scheduleFactory, $cache, $config, $scopeConfig, $request, $shell, $dateTime, $phpExecutableFinderFactory, $logger, $state, $statFactory, $lockManager);
$this->logger = $logger;
$this->state = $state;
$this->lockManager = $lockManager;
$this->scheduleHelper = $scheduleHelper;
$this->jobHelper = $jobHelper;



Still don't know how to fix it though.



---- extension di.xml ------



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoCronObserverProcessCronQueueObserver" type="KiwiCommerceCronSchedulerObserverProcessCronQueueObserver" />
</config>









share|improve this question
























  • In case your interface still won't be loaded, check your di.xml and validate that a preference is available.

    – Aasim Goriya
    Feb 4 at 12:04











  • @AasimGoriya can you explain in details, what am I looking for exactly in di.xml file?

    – zekia
    Feb 4 at 12:08











  • can you please add your di.xml here ?

    – Aasim Goriya
    Feb 4 at 12:11











  • You could also ask KiwiCommerce support about this error in their module, maybe they have an update or a fix.

    – Antoine Martin
    Feb 4 at 12:14











  • this is core di.xml which is not needed, please add your custom module's di.xml which is located on your module's /etc/ directory

    – Aasim Goriya
    Feb 4 at 13:27

















1















I'm getting the following error on magento cron execution:



Fatal error: Uncaught Error: Cannot instantiate interface MagentoFrameworkLockLockManagerInterface in /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111
Stack trace:
#0 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): MagentoFrameworkObjectManagerFactoryAbstractFactory->createObject('Magento\Framewo...', Array)
#1 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): MagentoFrameworkObjectManagerFactoryCompiled->create('Magento\Framewo...')
#2 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): MagentoFrameworkObjectManagerFactoryCompiled->get('Magento\Framewo...')
#3 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): MagentoFrameworkObjectManagerFactoryCompiled->create('KiwiCommerce\Cr...')
#4 /home/mywebsite/public_html/vendor/magento/framework/Event/ObserverFactory.php(33): MagentoFrame in /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111


What can I do to fix this?



-----UPDATE------



I just discovered that error was caused by an extension that tries to use MagentoFrameworkLockLockManagerInterface in a constructor.
Here's a sample of the code:



namespace KiwiCommerceCronSchedulerObserver;

use MagentoFrameworkAppState;
use MagentoFrameworkConsoleCli;
use MagentoFrameworkEventObserverInterface;
use MagentoCronModelSchedule;
use MagentoFrameworkProfilerDriverStandardStat;
use MagentoFrameworkProfilerDriverStandardStatFactory;

class ProcessCronQueueObserverDefault extends MagentoCronObserverProcessCronQueueObserver
{

private $logger;
private $state;
private $scheduleHelper = null;
private $jobHelper = null;
private $lockManager;
private $invalid = [];

public function __construct(
MagentoFrameworkObjectManagerInterface $objectManager,
MagentoCronModelScheduleFactory $scheduleFactory,
MagentoFrameworkAppCacheInterface $cache,
MagentoCronModelConfigInterface $config,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoFrameworkAppConsoleRequest $request,
MagentoFrameworkShellInterface $shell,
MagentoFrameworkStdlibDateTimeDateTime $dateTime,
MagentoFrameworkProcessPhpExecutableFinderFactory $phpExecutableFinderFactory,
PsrLogLoggerInterface $logger,
MagentoFrameworkAppState $state,
StatFactory $statFactory,
MagentoFrameworkLockLockManagerInterface $lockManager,
KiwiCommerceCronSchedulerHelperSchedule $scheduleHelper,
KiwiCommerceCronSchedulerHelperCronjob $jobHelper
)

$construct= "__construct"; // in order to bypass the compiler
parent::$construct($objectManager, $scheduleFactory, $cache, $config, $scopeConfig, $request, $shell, $dateTime, $phpExecutableFinderFactory, $logger, $state, $statFactory, $lockManager);
$this->logger = $logger;
$this->state = $state;
$this->lockManager = $lockManager;
$this->scheduleHelper = $scheduleHelper;
$this->jobHelper = $jobHelper;



Still don't know how to fix it though.



---- extension di.xml ------



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoCronObserverProcessCronQueueObserver" type="KiwiCommerceCronSchedulerObserverProcessCronQueueObserver" />
</config>









share|improve this question
























  • In case your interface still won't be loaded, check your di.xml and validate that a preference is available.

    – Aasim Goriya
    Feb 4 at 12:04











  • @AasimGoriya can you explain in details, what am I looking for exactly in di.xml file?

    – zekia
    Feb 4 at 12:08











  • can you please add your di.xml here ?

    – Aasim Goriya
    Feb 4 at 12:11











  • You could also ask KiwiCommerce support about this error in their module, maybe they have an update or a fix.

    – Antoine Martin
    Feb 4 at 12:14











  • this is core di.xml which is not needed, please add your custom module's di.xml which is located on your module's /etc/ directory

    – Aasim Goriya
    Feb 4 at 13:27













1












1








1








I'm getting the following error on magento cron execution:



Fatal error: Uncaught Error: Cannot instantiate interface MagentoFrameworkLockLockManagerInterface in /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111
Stack trace:
#0 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): MagentoFrameworkObjectManagerFactoryAbstractFactory->createObject('Magento\Framewo...', Array)
#1 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): MagentoFrameworkObjectManagerFactoryCompiled->create('Magento\Framewo...')
#2 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): MagentoFrameworkObjectManagerFactoryCompiled->get('Magento\Framewo...')
#3 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): MagentoFrameworkObjectManagerFactoryCompiled->create('KiwiCommerce\Cr...')
#4 /home/mywebsite/public_html/vendor/magento/framework/Event/ObserverFactory.php(33): MagentoFrame in /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111


What can I do to fix this?



-----UPDATE------



I just discovered that error was caused by an extension that tries to use MagentoFrameworkLockLockManagerInterface in a constructor.
Here's a sample of the code:



namespace KiwiCommerceCronSchedulerObserver;

use MagentoFrameworkAppState;
use MagentoFrameworkConsoleCli;
use MagentoFrameworkEventObserverInterface;
use MagentoCronModelSchedule;
use MagentoFrameworkProfilerDriverStandardStat;
use MagentoFrameworkProfilerDriverStandardStatFactory;

class ProcessCronQueueObserverDefault extends MagentoCronObserverProcessCronQueueObserver
{

private $logger;
private $state;
private $scheduleHelper = null;
private $jobHelper = null;
private $lockManager;
private $invalid = [];

public function __construct(
MagentoFrameworkObjectManagerInterface $objectManager,
MagentoCronModelScheduleFactory $scheduleFactory,
MagentoFrameworkAppCacheInterface $cache,
MagentoCronModelConfigInterface $config,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoFrameworkAppConsoleRequest $request,
MagentoFrameworkShellInterface $shell,
MagentoFrameworkStdlibDateTimeDateTime $dateTime,
MagentoFrameworkProcessPhpExecutableFinderFactory $phpExecutableFinderFactory,
PsrLogLoggerInterface $logger,
MagentoFrameworkAppState $state,
StatFactory $statFactory,
MagentoFrameworkLockLockManagerInterface $lockManager,
KiwiCommerceCronSchedulerHelperSchedule $scheduleHelper,
KiwiCommerceCronSchedulerHelperCronjob $jobHelper
)

$construct= "__construct"; // in order to bypass the compiler
parent::$construct($objectManager, $scheduleFactory, $cache, $config, $scopeConfig, $request, $shell, $dateTime, $phpExecutableFinderFactory, $logger, $state, $statFactory, $lockManager);
$this->logger = $logger;
$this->state = $state;
$this->lockManager = $lockManager;
$this->scheduleHelper = $scheduleHelper;
$this->jobHelper = $jobHelper;



Still don't know how to fix it though.



---- extension di.xml ------



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoCronObserverProcessCronQueueObserver" type="KiwiCommerceCronSchedulerObserverProcessCronQueueObserver" />
</config>









share|improve this question
















I'm getting the following error on magento cron execution:



Fatal error: Uncaught Error: Cannot instantiate interface MagentoFrameworkLockLockManagerInterface in /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111
Stack trace:
#0 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): MagentoFrameworkObjectManagerFactoryAbstractFactory->createObject('Magento\Framewo...', Array)
#1 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): MagentoFrameworkObjectManagerFactoryCompiled->create('Magento\Framewo...')
#2 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): MagentoFrameworkObjectManagerFactoryCompiled->get('Magento\Framewo...')
#3 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): MagentoFrameworkObjectManagerFactoryCompiled->create('KiwiCommerce\Cr...')
#4 /home/mywebsite/public_html/vendor/magento/framework/Event/ObserverFactory.php(33): MagentoFrame in /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111


What can I do to fix this?



-----UPDATE------



I just discovered that error was caused by an extension that tries to use MagentoFrameworkLockLockManagerInterface in a constructor.
Here's a sample of the code:



namespace KiwiCommerceCronSchedulerObserver;

use MagentoFrameworkAppState;
use MagentoFrameworkConsoleCli;
use MagentoFrameworkEventObserverInterface;
use MagentoCronModelSchedule;
use MagentoFrameworkProfilerDriverStandardStat;
use MagentoFrameworkProfilerDriverStandardStatFactory;

class ProcessCronQueueObserverDefault extends MagentoCronObserverProcessCronQueueObserver
{

private $logger;
private $state;
private $scheduleHelper = null;
private $jobHelper = null;
private $lockManager;
private $invalid = [];

public function __construct(
MagentoFrameworkObjectManagerInterface $objectManager,
MagentoCronModelScheduleFactory $scheduleFactory,
MagentoFrameworkAppCacheInterface $cache,
MagentoCronModelConfigInterface $config,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoFrameworkAppConsoleRequest $request,
MagentoFrameworkShellInterface $shell,
MagentoFrameworkStdlibDateTimeDateTime $dateTime,
MagentoFrameworkProcessPhpExecutableFinderFactory $phpExecutableFinderFactory,
PsrLogLoggerInterface $logger,
MagentoFrameworkAppState $state,
StatFactory $statFactory,
MagentoFrameworkLockLockManagerInterface $lockManager,
KiwiCommerceCronSchedulerHelperSchedule $scheduleHelper,
KiwiCommerceCronSchedulerHelperCronjob $jobHelper
)

$construct= "__construct"; // in order to bypass the compiler
parent::$construct($objectManager, $scheduleFactory, $cache, $config, $scopeConfig, $request, $shell, $dateTime, $phpExecutableFinderFactory, $logger, $state, $statFactory, $lockManager);
$this->logger = $logger;
$this->state = $state;
$this->lockManager = $lockManager;
$this->scheduleHelper = $scheduleHelper;
$this->jobHelper = $jobHelper;



Still don't know how to fix it though.



---- extension di.xml ------



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoCronObserverProcessCronQueueObserver" type="KiwiCommerceCronSchedulerObserverProcessCronQueueObserver" />
</config>






magento2.2 error cron






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 4 at 13:30







zekia

















asked Feb 4 at 11:20









zekiazekia

1353622




1353622












  • In case your interface still won't be loaded, check your di.xml and validate that a preference is available.

    – Aasim Goriya
    Feb 4 at 12:04











  • @AasimGoriya can you explain in details, what am I looking for exactly in di.xml file?

    – zekia
    Feb 4 at 12:08











  • can you please add your di.xml here ?

    – Aasim Goriya
    Feb 4 at 12:11











  • You could also ask KiwiCommerce support about this error in their module, maybe they have an update or a fix.

    – Antoine Martin
    Feb 4 at 12:14











  • this is core di.xml which is not needed, please add your custom module's di.xml which is located on your module's /etc/ directory

    – Aasim Goriya
    Feb 4 at 13:27

















  • In case your interface still won't be loaded, check your di.xml and validate that a preference is available.

    – Aasim Goriya
    Feb 4 at 12:04











  • @AasimGoriya can you explain in details, what am I looking for exactly in di.xml file?

    – zekia
    Feb 4 at 12:08











  • can you please add your di.xml here ?

    – Aasim Goriya
    Feb 4 at 12:11











  • You could also ask KiwiCommerce support about this error in their module, maybe they have an update or a fix.

    – Antoine Martin
    Feb 4 at 12:14











  • this is core di.xml which is not needed, please add your custom module's di.xml which is located on your module's /etc/ directory

    – Aasim Goriya
    Feb 4 at 13:27
















In case your interface still won't be loaded, check your di.xml and validate that a preference is available.

– Aasim Goriya
Feb 4 at 12:04





In case your interface still won't be loaded, check your di.xml and validate that a preference is available.

– Aasim Goriya
Feb 4 at 12:04













@AasimGoriya can you explain in details, what am I looking for exactly in di.xml file?

– zekia
Feb 4 at 12:08





@AasimGoriya can you explain in details, what am I looking for exactly in di.xml file?

– zekia
Feb 4 at 12:08













can you please add your di.xml here ?

– Aasim Goriya
Feb 4 at 12:11





can you please add your di.xml here ?

– Aasim Goriya
Feb 4 at 12:11













You could also ask KiwiCommerce support about this error in their module, maybe they have an update or a fix.

– Antoine Martin
Feb 4 at 12:14





You could also ask KiwiCommerce support about this error in their module, maybe they have an update or a fix.

– Antoine Martin
Feb 4 at 12:14













this is core di.xml which is not needed, please add your custom module's di.xml which is located on your module's /etc/ directory

– Aasim Goriya
Feb 4 at 13:27





this is core di.xml which is not needed, please add your custom module's di.xml which is located on your module's /etc/ directory

– Aasim Goriya
Feb 4 at 13:27










2 Answers
2






active

oldest

votes


















0














Maybe you could also ask KiwiCommerce support about this error in their module, maybe they have an update or a fix.



They share their phone and e-mail on their official website.






share|improve this answer

























  • I have checked these things, but the solution is somewhere else

    – zekia
    Feb 4 at 11:35











  • Hm, it really looks like a permission issue... Check also if every permissions are good in /var/ folder. If they are... Maybe i'm wrong finally :)

    – Antoine Martin
    Feb 4 at 11:41











  • please see my question update

    – zekia
    Feb 4 at 11:55


















0














Remove file in KiwiCommerceCronSchedulerObserverProcessCronQueueObserverDefault.inc file and put below code in ProcessCronQueueObserver.php



<?php
namespace KiwiCommerceCronSchedulerObserver;

use MagentoFrameworkAppState;
use MagentoFrameworkConsoleCli;
use MagentoFrameworkEventObserverInterface;
use MagentoCronModelSchedule;

class ProcessCronQueueObserver extends MagentoCronObserverProcessCronQueueObserver

private $logger;
private $state;
private $scheduleHelper = null;
private $jobHelper = null;

public function __construct(
MagentoFrameworkObjectManagerInterface $objectManager,
MagentoCronModelScheduleFactory $scheduleFactory,
MagentoFrameworkAppCacheInterface $cache,
MagentoCronModelConfigInterface $config,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoFrameworkAppConsoleRequest $request,
MagentoFrameworkShellInterface $shell,
MagentoFrameworkStdlibDateTimeDateTime $dateTime,
MagentoFrameworkProcessPhpExecutableFinderFactory $phpExecutableFinderFactory,
PsrLogLoggerInterface $logger,
MagentoFrameworkAppState $state,
KiwiCommerceCronSchedulerHelperSchedule $scheduleHelper,
KiwiCommerceCronSchedulerHelperCronjob $jobHelper
)
$construct= "__construct"; // in order to bypass the compiler
parent::$construct($objectManager, $scheduleFactory, $cache, $config,
$scopeConfig, $request, $shell, $dateTime, $phpExecutableFinderFactory,
$logger, $state);
$this->logger = $logger;
$this->state = $state;
$this->scheduleHelper = $scheduleHelper;
$this->jobHelper = $jobHelper;


public function execute(MagentoFrameworkEventObserver $observer)

#Handle Fatal Error
$runningSchedule = null;
register_shutdown_function(function () use (&$runningSchedule)
$errorMessage = error_get_last();
if ($errorMessage)
if ($runningSchedule != null)
$s = $runningSchedule;
$s->setStatus(MagentoCronModelSchedule::STATUS_ERROR);
$s->setErrorMessage($errorMessage['message']);
$s->setErrorFile($errorMessage['file']);
$s->setErrorLine($errorMessage['line']);
$s->save();


);

$pendingJobs = $this->_getPendingSchedules();
$currentTime = $this->dateTime->gmtTimestamp();
$jobGroupsRoot = $this->_config->getJobs();

$phpPath = $this->phpExecutableFinder->find() ?: 'php';

foreach ($jobGroupsRoot as $groupId => $jobsRoot)
$this->_cleanup($groupId);
$this->_generate($groupId);
if ($this->_request->getParam('group') !== null
&& $this->_request->getParam('group') !== ''' . ($groupId) . '''
&& $this->_request->getParam('group') !== $groupId
)
continue;

if (($this->_request->getParam(self::STANDALONE_PROCESS_STARTED) !== '1') && (
$this->_scopeConfig->getValue(
'system/cron/' . $groupId . '/use_separate_process',
MagentoStoreModelScopeInterface::SCOPE_STORE
) == 1
)
)
$this->_shell->execute(
$phpPath . ' %s cron:run --group=' . $groupId . ' --' . Cli::INPUT_KEY_BOOTSTRAP . '='
. self::STANDALONE_PROCESS_STARTED . '=1',
[
BP . '/bin/magento'
]
);
continue;


/** @var MagentoCronModelSchedule $schedule */
foreach ($pendingJobs as $schedule)
$runningSchedule = $schedule;
$jobConfig = isset($jobsRoot[$schedule->getJobCode()]) ? $jobsRoot[$schedule->getJobCode()] : null;
if (!$jobConfig)
continue;


$scheduledTime = strtotime($schedule->getScheduledAt());
if ($scheduledTime > $currentTime)
continue;


try
if ($schedule->tryLockJob())
$this->scheduleHelper->setPid($schedule);
$cpu_before = getrusage();
$this->_runJob($scheduledTime, $currentTime, $jobConfig, $schedule, $groupId);
$cpu_after = getrusage();
$this->scheduleHelper->setCpuUsage($cpu_after, $cpu_before, $schedule);
$this->scheduleHelper->setMemoryUsage($schedule);

catch (Exception $e)
$schedule->setMessages($e->getMessage());
$schedule->setErrorMessage($e->getMessage());
$schedule->setErrorLine($e->getLine());

if ($schedule->getStatus() === Schedule::STATUS_ERROR)
$this->logger->critical($e);

if ($schedule->getStatus() === Schedule::STATUS_MISSED
&& $this->state->getMode() === State::MODE_DEVELOPER
)
$this->logger->info(
sprintf(
"%s Schedule Id: %s Job Code: %s",
$schedule->getMessages(),
$schedule->getScheduleId(),
$schedule->getJobCode()
)
);


$schedule->save();




/**
* @param string $jobCode
* @param string $cronExpression
* @param int $timeInterval
* @param array $exists
* @return void
*/
protected function saveSchedule($jobCode, $cronExpression, $timeInterval, $exists)

$result = $this->jobHelper->isJobActive($jobCode);

if ($result)
parent::saveSchedule($jobCode, $cronExpression, $timeInterval, $exists);







share|improve this answer























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f260380%2fcron-error-cannot-instantiate-interface-magenot-2%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Maybe you could also ask KiwiCommerce support about this error in their module, maybe they have an update or a fix.



    They share their phone and e-mail on their official website.






    share|improve this answer

























    • I have checked these things, but the solution is somewhere else

      – zekia
      Feb 4 at 11:35











    • Hm, it really looks like a permission issue... Check also if every permissions are good in /var/ folder. If they are... Maybe i'm wrong finally :)

      – Antoine Martin
      Feb 4 at 11:41











    • please see my question update

      – zekia
      Feb 4 at 11:55















    0














    Maybe you could also ask KiwiCommerce support about this error in their module, maybe they have an update or a fix.



    They share their phone and e-mail on their official website.






    share|improve this answer

























    • I have checked these things, but the solution is somewhere else

      – zekia
      Feb 4 at 11:35











    • Hm, it really looks like a permission issue... Check also if every permissions are good in /var/ folder. If they are... Maybe i'm wrong finally :)

      – Antoine Martin
      Feb 4 at 11:41











    • please see my question update

      – zekia
      Feb 4 at 11:55













    0












    0








    0







    Maybe you could also ask KiwiCommerce support about this error in their module, maybe they have an update or a fix.



    They share their phone and e-mail on their official website.






    share|improve this answer















    Maybe you could also ask KiwiCommerce support about this error in their module, maybe they have an update or a fix.



    They share their phone and e-mail on their official website.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Feb 4 at 12:23

























    answered Feb 4 at 11:28









    Antoine MartinAntoine Martin

    12618




    12618












    • I have checked these things, but the solution is somewhere else

      – zekia
      Feb 4 at 11:35











    • Hm, it really looks like a permission issue... Check also if every permissions are good in /var/ folder. If they are... Maybe i'm wrong finally :)

      – Antoine Martin
      Feb 4 at 11:41











    • please see my question update

      – zekia
      Feb 4 at 11:55

















    • I have checked these things, but the solution is somewhere else

      – zekia
      Feb 4 at 11:35











    • Hm, it really looks like a permission issue... Check also if every permissions are good in /var/ folder. If they are... Maybe i'm wrong finally :)

      – Antoine Martin
      Feb 4 at 11:41











    • please see my question update

      – zekia
      Feb 4 at 11:55
















    I have checked these things, but the solution is somewhere else

    – zekia
    Feb 4 at 11:35





    I have checked these things, but the solution is somewhere else

    – zekia
    Feb 4 at 11:35













    Hm, it really looks like a permission issue... Check also if every permissions are good in /var/ folder. If they are... Maybe i'm wrong finally :)

    – Antoine Martin
    Feb 4 at 11:41





    Hm, it really looks like a permission issue... Check also if every permissions are good in /var/ folder. If they are... Maybe i'm wrong finally :)

    – Antoine Martin
    Feb 4 at 11:41













    please see my question update

    – zekia
    Feb 4 at 11:55





    please see my question update

    – zekia
    Feb 4 at 11:55













    0














    Remove file in KiwiCommerceCronSchedulerObserverProcessCronQueueObserverDefault.inc file and put below code in ProcessCronQueueObserver.php



    <?php
    namespace KiwiCommerceCronSchedulerObserver;

    use MagentoFrameworkAppState;
    use MagentoFrameworkConsoleCli;
    use MagentoFrameworkEventObserverInterface;
    use MagentoCronModelSchedule;

    class ProcessCronQueueObserver extends MagentoCronObserverProcessCronQueueObserver

    private $logger;
    private $state;
    private $scheduleHelper = null;
    private $jobHelper = null;

    public function __construct(
    MagentoFrameworkObjectManagerInterface $objectManager,
    MagentoCronModelScheduleFactory $scheduleFactory,
    MagentoFrameworkAppCacheInterface $cache,
    MagentoCronModelConfigInterface $config,
    MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
    MagentoFrameworkAppConsoleRequest $request,
    MagentoFrameworkShellInterface $shell,
    MagentoFrameworkStdlibDateTimeDateTime $dateTime,
    MagentoFrameworkProcessPhpExecutableFinderFactory $phpExecutableFinderFactory,
    PsrLogLoggerInterface $logger,
    MagentoFrameworkAppState $state,
    KiwiCommerceCronSchedulerHelperSchedule $scheduleHelper,
    KiwiCommerceCronSchedulerHelperCronjob $jobHelper
    )
    $construct= "__construct"; // in order to bypass the compiler
    parent::$construct($objectManager, $scheduleFactory, $cache, $config,
    $scopeConfig, $request, $shell, $dateTime, $phpExecutableFinderFactory,
    $logger, $state);
    $this->logger = $logger;
    $this->state = $state;
    $this->scheduleHelper = $scheduleHelper;
    $this->jobHelper = $jobHelper;


    public function execute(MagentoFrameworkEventObserver $observer)

    #Handle Fatal Error
    $runningSchedule = null;
    register_shutdown_function(function () use (&$runningSchedule)
    $errorMessage = error_get_last();
    if ($errorMessage)
    if ($runningSchedule != null)
    $s = $runningSchedule;
    $s->setStatus(MagentoCronModelSchedule::STATUS_ERROR);
    $s->setErrorMessage($errorMessage['message']);
    $s->setErrorFile($errorMessage['file']);
    $s->setErrorLine($errorMessage['line']);
    $s->save();


    );

    $pendingJobs = $this->_getPendingSchedules();
    $currentTime = $this->dateTime->gmtTimestamp();
    $jobGroupsRoot = $this->_config->getJobs();

    $phpPath = $this->phpExecutableFinder->find() ?: 'php';

    foreach ($jobGroupsRoot as $groupId => $jobsRoot)
    $this->_cleanup($groupId);
    $this->_generate($groupId);
    if ($this->_request->getParam('group') !== null
    && $this->_request->getParam('group') !== ''' . ($groupId) . '''
    && $this->_request->getParam('group') !== $groupId
    )
    continue;

    if (($this->_request->getParam(self::STANDALONE_PROCESS_STARTED) !== '1') && (
    $this->_scopeConfig->getValue(
    'system/cron/' . $groupId . '/use_separate_process',
    MagentoStoreModelScopeInterface::SCOPE_STORE
    ) == 1
    )
    )
    $this->_shell->execute(
    $phpPath . ' %s cron:run --group=' . $groupId . ' --' . Cli::INPUT_KEY_BOOTSTRAP . '='
    . self::STANDALONE_PROCESS_STARTED . '=1',
    [
    BP . '/bin/magento'
    ]
    );
    continue;


    /** @var MagentoCronModelSchedule $schedule */
    foreach ($pendingJobs as $schedule)
    $runningSchedule = $schedule;
    $jobConfig = isset($jobsRoot[$schedule->getJobCode()]) ? $jobsRoot[$schedule->getJobCode()] : null;
    if (!$jobConfig)
    continue;


    $scheduledTime = strtotime($schedule->getScheduledAt());
    if ($scheduledTime > $currentTime)
    continue;


    try
    if ($schedule->tryLockJob())
    $this->scheduleHelper->setPid($schedule);
    $cpu_before = getrusage();
    $this->_runJob($scheduledTime, $currentTime, $jobConfig, $schedule, $groupId);
    $cpu_after = getrusage();
    $this->scheduleHelper->setCpuUsage($cpu_after, $cpu_before, $schedule);
    $this->scheduleHelper->setMemoryUsage($schedule);

    catch (Exception $e)
    $schedule->setMessages($e->getMessage());
    $schedule->setErrorMessage($e->getMessage());
    $schedule->setErrorLine($e->getLine());

    if ($schedule->getStatus() === Schedule::STATUS_ERROR)
    $this->logger->critical($e);

    if ($schedule->getStatus() === Schedule::STATUS_MISSED
    && $this->state->getMode() === State::MODE_DEVELOPER
    )
    $this->logger->info(
    sprintf(
    "%s Schedule Id: %s Job Code: %s",
    $schedule->getMessages(),
    $schedule->getScheduleId(),
    $schedule->getJobCode()
    )
    );


    $schedule->save();




    /**
    * @param string $jobCode
    * @param string $cronExpression
    * @param int $timeInterval
    * @param array $exists
    * @return void
    */
    protected function saveSchedule($jobCode, $cronExpression, $timeInterval, $exists)

    $result = $this->jobHelper->isJobActive($jobCode);

    if ($result)
    parent::saveSchedule($jobCode, $cronExpression, $timeInterval, $exists);







    share|improve this answer



























      0














      Remove file in KiwiCommerceCronSchedulerObserverProcessCronQueueObserverDefault.inc file and put below code in ProcessCronQueueObserver.php



      <?php
      namespace KiwiCommerceCronSchedulerObserver;

      use MagentoFrameworkAppState;
      use MagentoFrameworkConsoleCli;
      use MagentoFrameworkEventObserverInterface;
      use MagentoCronModelSchedule;

      class ProcessCronQueueObserver extends MagentoCronObserverProcessCronQueueObserver

      private $logger;
      private $state;
      private $scheduleHelper = null;
      private $jobHelper = null;

      public function __construct(
      MagentoFrameworkObjectManagerInterface $objectManager,
      MagentoCronModelScheduleFactory $scheduleFactory,
      MagentoFrameworkAppCacheInterface $cache,
      MagentoCronModelConfigInterface $config,
      MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
      MagentoFrameworkAppConsoleRequest $request,
      MagentoFrameworkShellInterface $shell,
      MagentoFrameworkStdlibDateTimeDateTime $dateTime,
      MagentoFrameworkProcessPhpExecutableFinderFactory $phpExecutableFinderFactory,
      PsrLogLoggerInterface $logger,
      MagentoFrameworkAppState $state,
      KiwiCommerceCronSchedulerHelperSchedule $scheduleHelper,
      KiwiCommerceCronSchedulerHelperCronjob $jobHelper
      )
      $construct= "__construct"; // in order to bypass the compiler
      parent::$construct($objectManager, $scheduleFactory, $cache, $config,
      $scopeConfig, $request, $shell, $dateTime, $phpExecutableFinderFactory,
      $logger, $state);
      $this->logger = $logger;
      $this->state = $state;
      $this->scheduleHelper = $scheduleHelper;
      $this->jobHelper = $jobHelper;


      public function execute(MagentoFrameworkEventObserver $observer)

      #Handle Fatal Error
      $runningSchedule = null;
      register_shutdown_function(function () use (&$runningSchedule)
      $errorMessage = error_get_last();
      if ($errorMessage)
      if ($runningSchedule != null)
      $s = $runningSchedule;
      $s->setStatus(MagentoCronModelSchedule::STATUS_ERROR);
      $s->setErrorMessage($errorMessage['message']);
      $s->setErrorFile($errorMessage['file']);
      $s->setErrorLine($errorMessage['line']);
      $s->save();


      );

      $pendingJobs = $this->_getPendingSchedules();
      $currentTime = $this->dateTime->gmtTimestamp();
      $jobGroupsRoot = $this->_config->getJobs();

      $phpPath = $this->phpExecutableFinder->find() ?: 'php';

      foreach ($jobGroupsRoot as $groupId => $jobsRoot)
      $this->_cleanup($groupId);
      $this->_generate($groupId);
      if ($this->_request->getParam('group') !== null
      && $this->_request->getParam('group') !== ''' . ($groupId) . '''
      && $this->_request->getParam('group') !== $groupId
      )
      continue;

      if (($this->_request->getParam(self::STANDALONE_PROCESS_STARTED) !== '1') && (
      $this->_scopeConfig->getValue(
      'system/cron/' . $groupId . '/use_separate_process',
      MagentoStoreModelScopeInterface::SCOPE_STORE
      ) == 1
      )
      )
      $this->_shell->execute(
      $phpPath . ' %s cron:run --group=' . $groupId . ' --' . Cli::INPUT_KEY_BOOTSTRAP . '='
      . self::STANDALONE_PROCESS_STARTED . '=1',
      [
      BP . '/bin/magento'
      ]
      );
      continue;


      /** @var MagentoCronModelSchedule $schedule */
      foreach ($pendingJobs as $schedule)
      $runningSchedule = $schedule;
      $jobConfig = isset($jobsRoot[$schedule->getJobCode()]) ? $jobsRoot[$schedule->getJobCode()] : null;
      if (!$jobConfig)
      continue;


      $scheduledTime = strtotime($schedule->getScheduledAt());
      if ($scheduledTime > $currentTime)
      continue;


      try
      if ($schedule->tryLockJob())
      $this->scheduleHelper->setPid($schedule);
      $cpu_before = getrusage();
      $this->_runJob($scheduledTime, $currentTime, $jobConfig, $schedule, $groupId);
      $cpu_after = getrusage();
      $this->scheduleHelper->setCpuUsage($cpu_after, $cpu_before, $schedule);
      $this->scheduleHelper->setMemoryUsage($schedule);

      catch (Exception $e)
      $schedule->setMessages($e->getMessage());
      $schedule->setErrorMessage($e->getMessage());
      $schedule->setErrorLine($e->getLine());

      if ($schedule->getStatus() === Schedule::STATUS_ERROR)
      $this->logger->critical($e);

      if ($schedule->getStatus() === Schedule::STATUS_MISSED
      && $this->state->getMode() === State::MODE_DEVELOPER
      )
      $this->logger->info(
      sprintf(
      "%s Schedule Id: %s Job Code: %s",
      $schedule->getMessages(),
      $schedule->getScheduleId(),
      $schedule->getJobCode()
      )
      );


      $schedule->save();




      /**
      * @param string $jobCode
      * @param string $cronExpression
      * @param int $timeInterval
      * @param array $exists
      * @return void
      */
      protected function saveSchedule($jobCode, $cronExpression, $timeInterval, $exists)

      $result = $this->jobHelper->isJobActive($jobCode);

      if ($result)
      parent::saveSchedule($jobCode, $cronExpression, $timeInterval, $exists);







      share|improve this answer

























        0












        0








        0







        Remove file in KiwiCommerceCronSchedulerObserverProcessCronQueueObserverDefault.inc file and put below code in ProcessCronQueueObserver.php



        <?php
        namespace KiwiCommerceCronSchedulerObserver;

        use MagentoFrameworkAppState;
        use MagentoFrameworkConsoleCli;
        use MagentoFrameworkEventObserverInterface;
        use MagentoCronModelSchedule;

        class ProcessCronQueueObserver extends MagentoCronObserverProcessCronQueueObserver

        private $logger;
        private $state;
        private $scheduleHelper = null;
        private $jobHelper = null;

        public function __construct(
        MagentoFrameworkObjectManagerInterface $objectManager,
        MagentoCronModelScheduleFactory $scheduleFactory,
        MagentoFrameworkAppCacheInterface $cache,
        MagentoCronModelConfigInterface $config,
        MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
        MagentoFrameworkAppConsoleRequest $request,
        MagentoFrameworkShellInterface $shell,
        MagentoFrameworkStdlibDateTimeDateTime $dateTime,
        MagentoFrameworkProcessPhpExecutableFinderFactory $phpExecutableFinderFactory,
        PsrLogLoggerInterface $logger,
        MagentoFrameworkAppState $state,
        KiwiCommerceCronSchedulerHelperSchedule $scheduleHelper,
        KiwiCommerceCronSchedulerHelperCronjob $jobHelper
        )
        $construct= "__construct"; // in order to bypass the compiler
        parent::$construct($objectManager, $scheduleFactory, $cache, $config,
        $scopeConfig, $request, $shell, $dateTime, $phpExecutableFinderFactory,
        $logger, $state);
        $this->logger = $logger;
        $this->state = $state;
        $this->scheduleHelper = $scheduleHelper;
        $this->jobHelper = $jobHelper;


        public function execute(MagentoFrameworkEventObserver $observer)

        #Handle Fatal Error
        $runningSchedule = null;
        register_shutdown_function(function () use (&$runningSchedule)
        $errorMessage = error_get_last();
        if ($errorMessage)
        if ($runningSchedule != null)
        $s = $runningSchedule;
        $s->setStatus(MagentoCronModelSchedule::STATUS_ERROR);
        $s->setErrorMessage($errorMessage['message']);
        $s->setErrorFile($errorMessage['file']);
        $s->setErrorLine($errorMessage['line']);
        $s->save();


        );

        $pendingJobs = $this->_getPendingSchedules();
        $currentTime = $this->dateTime->gmtTimestamp();
        $jobGroupsRoot = $this->_config->getJobs();

        $phpPath = $this->phpExecutableFinder->find() ?: 'php';

        foreach ($jobGroupsRoot as $groupId => $jobsRoot)
        $this->_cleanup($groupId);
        $this->_generate($groupId);
        if ($this->_request->getParam('group') !== null
        && $this->_request->getParam('group') !== ''' . ($groupId) . '''
        && $this->_request->getParam('group') !== $groupId
        )
        continue;

        if (($this->_request->getParam(self::STANDALONE_PROCESS_STARTED) !== '1') && (
        $this->_scopeConfig->getValue(
        'system/cron/' . $groupId . '/use_separate_process',
        MagentoStoreModelScopeInterface::SCOPE_STORE
        ) == 1
        )
        )
        $this->_shell->execute(
        $phpPath . ' %s cron:run --group=' . $groupId . ' --' . Cli::INPUT_KEY_BOOTSTRAP . '='
        . self::STANDALONE_PROCESS_STARTED . '=1',
        [
        BP . '/bin/magento'
        ]
        );
        continue;


        /** @var MagentoCronModelSchedule $schedule */
        foreach ($pendingJobs as $schedule)
        $runningSchedule = $schedule;
        $jobConfig = isset($jobsRoot[$schedule->getJobCode()]) ? $jobsRoot[$schedule->getJobCode()] : null;
        if (!$jobConfig)
        continue;


        $scheduledTime = strtotime($schedule->getScheduledAt());
        if ($scheduledTime > $currentTime)
        continue;


        try
        if ($schedule->tryLockJob())
        $this->scheduleHelper->setPid($schedule);
        $cpu_before = getrusage();
        $this->_runJob($scheduledTime, $currentTime, $jobConfig, $schedule, $groupId);
        $cpu_after = getrusage();
        $this->scheduleHelper->setCpuUsage($cpu_after, $cpu_before, $schedule);
        $this->scheduleHelper->setMemoryUsage($schedule);

        catch (Exception $e)
        $schedule->setMessages($e->getMessage());
        $schedule->setErrorMessage($e->getMessage());
        $schedule->setErrorLine($e->getLine());

        if ($schedule->getStatus() === Schedule::STATUS_ERROR)
        $this->logger->critical($e);

        if ($schedule->getStatus() === Schedule::STATUS_MISSED
        && $this->state->getMode() === State::MODE_DEVELOPER
        )
        $this->logger->info(
        sprintf(
        "%s Schedule Id: %s Job Code: %s",
        $schedule->getMessages(),
        $schedule->getScheduleId(),
        $schedule->getJobCode()
        )
        );


        $schedule->save();




        /**
        * @param string $jobCode
        * @param string $cronExpression
        * @param int $timeInterval
        * @param array $exists
        * @return void
        */
        protected function saveSchedule($jobCode, $cronExpression, $timeInterval, $exists)

        $result = $this->jobHelper->isJobActive($jobCode);

        if ($result)
        parent::saveSchedule($jobCode, $cronExpression, $timeInterval, $exists);







        share|improve this answer













        Remove file in KiwiCommerceCronSchedulerObserverProcessCronQueueObserverDefault.inc file and put below code in ProcessCronQueueObserver.php



        <?php
        namespace KiwiCommerceCronSchedulerObserver;

        use MagentoFrameworkAppState;
        use MagentoFrameworkConsoleCli;
        use MagentoFrameworkEventObserverInterface;
        use MagentoCronModelSchedule;

        class ProcessCronQueueObserver extends MagentoCronObserverProcessCronQueueObserver

        private $logger;
        private $state;
        private $scheduleHelper = null;
        private $jobHelper = null;

        public function __construct(
        MagentoFrameworkObjectManagerInterface $objectManager,
        MagentoCronModelScheduleFactory $scheduleFactory,
        MagentoFrameworkAppCacheInterface $cache,
        MagentoCronModelConfigInterface $config,
        MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
        MagentoFrameworkAppConsoleRequest $request,
        MagentoFrameworkShellInterface $shell,
        MagentoFrameworkStdlibDateTimeDateTime $dateTime,
        MagentoFrameworkProcessPhpExecutableFinderFactory $phpExecutableFinderFactory,
        PsrLogLoggerInterface $logger,
        MagentoFrameworkAppState $state,
        KiwiCommerceCronSchedulerHelperSchedule $scheduleHelper,
        KiwiCommerceCronSchedulerHelperCronjob $jobHelper
        )
        $construct= "__construct"; // in order to bypass the compiler
        parent::$construct($objectManager, $scheduleFactory, $cache, $config,
        $scopeConfig, $request, $shell, $dateTime, $phpExecutableFinderFactory,
        $logger, $state);
        $this->logger = $logger;
        $this->state = $state;
        $this->scheduleHelper = $scheduleHelper;
        $this->jobHelper = $jobHelper;


        public function execute(MagentoFrameworkEventObserver $observer)

        #Handle Fatal Error
        $runningSchedule = null;
        register_shutdown_function(function () use (&$runningSchedule)
        $errorMessage = error_get_last();
        if ($errorMessage)
        if ($runningSchedule != null)
        $s = $runningSchedule;
        $s->setStatus(MagentoCronModelSchedule::STATUS_ERROR);
        $s->setErrorMessage($errorMessage['message']);
        $s->setErrorFile($errorMessage['file']);
        $s->setErrorLine($errorMessage['line']);
        $s->save();


        );

        $pendingJobs = $this->_getPendingSchedules();
        $currentTime = $this->dateTime->gmtTimestamp();
        $jobGroupsRoot = $this->_config->getJobs();

        $phpPath = $this->phpExecutableFinder->find() ?: 'php';

        foreach ($jobGroupsRoot as $groupId => $jobsRoot)
        $this->_cleanup($groupId);
        $this->_generate($groupId);
        if ($this->_request->getParam('group') !== null
        && $this->_request->getParam('group') !== ''' . ($groupId) . '''
        && $this->_request->getParam('group') !== $groupId
        )
        continue;

        if (($this->_request->getParam(self::STANDALONE_PROCESS_STARTED) !== '1') && (
        $this->_scopeConfig->getValue(
        'system/cron/' . $groupId . '/use_separate_process',
        MagentoStoreModelScopeInterface::SCOPE_STORE
        ) == 1
        )
        )
        $this->_shell->execute(
        $phpPath . ' %s cron:run --group=' . $groupId . ' --' . Cli::INPUT_KEY_BOOTSTRAP . '='
        . self::STANDALONE_PROCESS_STARTED . '=1',
        [
        BP . '/bin/magento'
        ]
        );
        continue;


        /** @var MagentoCronModelSchedule $schedule */
        foreach ($pendingJobs as $schedule)
        $runningSchedule = $schedule;
        $jobConfig = isset($jobsRoot[$schedule->getJobCode()]) ? $jobsRoot[$schedule->getJobCode()] : null;
        if (!$jobConfig)
        continue;


        $scheduledTime = strtotime($schedule->getScheduledAt());
        if ($scheduledTime > $currentTime)
        continue;


        try
        if ($schedule->tryLockJob())
        $this->scheduleHelper->setPid($schedule);
        $cpu_before = getrusage();
        $this->_runJob($scheduledTime, $currentTime, $jobConfig, $schedule, $groupId);
        $cpu_after = getrusage();
        $this->scheduleHelper->setCpuUsage($cpu_after, $cpu_before, $schedule);
        $this->scheduleHelper->setMemoryUsage($schedule);

        catch (Exception $e)
        $schedule->setMessages($e->getMessage());
        $schedule->setErrorMessage($e->getMessage());
        $schedule->setErrorLine($e->getLine());

        if ($schedule->getStatus() === Schedule::STATUS_ERROR)
        $this->logger->critical($e);

        if ($schedule->getStatus() === Schedule::STATUS_MISSED
        && $this->state->getMode() === State::MODE_DEVELOPER
        )
        $this->logger->info(
        sprintf(
        "%s Schedule Id: %s Job Code: %s",
        $schedule->getMessages(),
        $schedule->getScheduleId(),
        $schedule->getJobCode()
        )
        );


        $schedule->save();




        /**
        * @param string $jobCode
        * @param string $cronExpression
        * @param int $timeInterval
        * @param array $exists
        * @return void
        */
        protected function saveSchedule($jobCode, $cronExpression, $timeInterval, $exists)

        $result = $this->jobHelper->isJobActive($jobCode);

        if ($result)
        parent::saveSchedule($jobCode, $cronExpression, $timeInterval, $exists);








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 25 at 12:06









        Savan PatelSavan Patel

        10612




        10612



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f260380%2fcron-error-cannot-instantiate-interface-magenot-2%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

            Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

            Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림