Magento2: Cron from browser returns 500 error

Created on 16 Nov 2016  路  9Comments  路  Source: magento/magento2

Preconditions

  1. Magento Installed without any issues Version 2.1.2 by downloading zip file and using web wizard
  2. Access permission removed from /pub/.htaccess for cron.php
  3. enable error reporting in cron.php file.

Steps to reproduce

  1. visit the pub/cron.php in browser

Actual and Expected result

Expected result:

Cron jobs need to run
Actual result:

getting the following error message

PHP Fatal error: Uncaught Error: Class 'Magento\Framework\Console\CLI' not found in /var/www/html/beta.rednool.com/vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php:173\nStack trace:\n#0 /var/www/html/beta.rednool.com/vendor/magento/framework/Event/Invoker/InvokerDefault.php(73): Magento\Cron\Observer\ProcessCronQueueObserver->execute(Object(Magento\Framework\Event\Observer))\n#1 /var/www/html/beta.rednool.com/vendor/magento/framework/Event/Invoker/InvokerDefault.php(61): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Magento\Cron\Observer\ProcessCronQueueObserver), Object(Magento\Framework\Event\Observer))\n#2 /var/www/html/beta.rednool.com/vendor/magento/framework/Event/Manager.php(66): Magento\Framework\Event\Invoker\InvokerDefault->dispatch(Array, Object(Magento\Framework\Event\Observer))\n#3 /var/www/html/beta.rednool.com/var/generation/Magento/Framework/Event/Manager/Proxy.php(95): Magento\Framework\Event\Manager->dispatch('default', Array)\n#4 /var/www/html/beta.rednool.com/vendor/m in /var/www/html/beta.rednool.com/vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php on line 173

needs update bug report

Most helpful comment

@vzabaznov in vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php

use Magento\Framework\Console\CLI;

The use statement uses uppercase for class CLI, the original class name and file name is Cli
The use statement should be updated.

All 9 comments

@vigikaran thank you for your feedback.
Please, format this issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result.
Please, also identify which version of Magento you are running.

I'm using magento version 2.1.2 and

  1. I have set up htaccess password for cron and run the cron url in the browser
    http://beta.rednool.com/pub/cron.php?group=index
  2. i removed the security for cron.php and run it again.
  3. enable error reporting and now you can check the error on the above link

@vigikaran thank you for update.
But still please format this issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result.

Issue updated as you said

@vigikaran thank you for your feedback.
Please, recheck it on the latest 2.1 version of Magento(from browser and from console).
If you will need more information, you can use http://devdocs.magento.com/guides/v2.0/config-guide/secy/secy-cron.html

Hi @vigikaran , closed as we don't receive update more than 2 week, feel free to write here/reopen or to open new issue

@vzabaznov Can we reopen this ticket? I'm currently is able to reproduce this bug. I have the latest version 2.1.2 version. I run cron directly from the browser.

Fatal error: Uncaught Error: Class 'Magento\Framework\Console\CLI' not found in ../site/vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php on line 173

@vzabaznov in vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php

use Magento\Framework\Console\CLI;

The use statement uses uppercase for class CLI, the original class name and file name is Cli
The use statement should be updated.

I can confirm, that the issue still exists and the solution by @LOBsTerr solves it.

Was this page helpful?
0 / 5 - 0 ratings