1

Steps to reproduce

  1. Install Magento 2.0.2. (apache 2.4.18, php 7.0.4, mariadb 10.0.24)
  2. Import products from Magento 1.7.x store.
  3. In Magento backend, set indexes to update on schedule.
  4. Run php bin/magento indexer:reindex.

Expected result

  1. All indexes reindexed.

Actual result

[~/www/dev]# bin/magento indexer:reindex -vv



  [InvalidArgumentException]
  There are no commands defined in the "indexer" namespace.



Exception trace:
 () at /home/dev/public_html/dev/vendor/symfony/console/Symfony/Component/Console/Application.php:501
 Symfony\Component\Console\Application->findNamespace() at /home/dev/public_html/dev/vendor/symfony/console/Symfony/Component/Console/Application.php:535
 Symfony\Component\Console\Application->find() at /home/dev/public_html/dev/vendor/symfony/console/Symfony/Component/Console/Application.php:192
 Symfony\Component\Console\Application->doRun() at /home/dev/public_html/dev/vendor/magento/framework/Console/Cli.php:49
 Magento\Framework\Console\Cli->doRun() at /home/dev/public_html/dev/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at /home/dev/public_html/dev/bin/magento:25

Workaround

  1. if i run /opt/bin/php56/bin/php bin/magento indexer:reindex indexing succeeds.
4
  • What does which php print? Mar 18 '16 at 15:48
  • /usr/local/bin/php Mar 18 '16 at 16:05
  • Maybe there's something wrong with that php. Find out what your webserver is using, and use that in the command line. Mar 18 '16 at 16:06
  • both are using php 7.0.4. Mar 18 '16 at 16:19
1

In the end I found that my cli was using a different path to php than apache. I am using cpanel, so the cli was pointing to /opt/cpanel/ea-php70/. After running yum install ea-php70-php-{magento dependency} (i.e. yum install ea-php70-php-bcmath, etc.) for all of the magento dependencies, I am able to use the cli without any errors. Hope this helps someone else.

0

I'm adding my answer because I had same issue after uploading new module and running php bin/magento upgrade

after this I had simmillar error couldn't clean cache and run reindex.

I input again php bin/magento upgrade (only command that works)

and I found that I had bad configuration in xml file

Element 'global': No matching global declaration available for the validation root.  
  Line: 2 

after I fix that issue I run again php bin/magento upgrade and all command works now.

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.