0

I've got a Magento2 instance running from 1 year.

Since last week I'm receiving once/twice a day an email whith the following cron error

In File.php line 405:

  FilesystemIterator::__construct(/var/.update 
  _in_progress.flag): failed to open dir: No such file or directory           


setup:cron:run [--magento-init-params MAGENTO-INIT-PARAMS]  

Any ideas?

1

The error seems pretty explicit you are trying to open a file which doesn't exist.

I recommend you to setup some log to the location it is failing to log the filemane.Then understand why it's failing, it depends on your code we can't really tell from nothing, may be add some code details ?

In the mean time you can add logs like that

$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/crondebug.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info($filename_you_try_to_open_in_cron);

You should even put your code into a try catch and log the thrown Exception message

  • It was a server availability problem: during the cron there was a server overload with services restart. – domfitty Oct 6 '20 at 8:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.