0

When I run CLI commands in magento 2.2 php bin/magento setup:upgrade I'm getting following error.

[Zend_Db_Adapter_Exception]                  
  SQLSTATE[HY000] [2002] Connection timed out  

  [PDOException]                               
  SQLSTATE[HY000] [2002] Connection timed out  

setup:upgrade [--keep-generated] [--magento-init-params="..."]

Also I get the same thing when I try to run: php bin/magento setup:static-content:deploy

Requested languages: en_US
Requested areas: frontend, adminhtml
Requested themes: Magento/blank, Magento/luma, BA/mypres, Magento/backend



  [Zend_Db_Adapter_Exception]                  
  SQLSTATE[HY000] [2002] Connection timed out  

  [PDOException]                               
  SQLSTATE[HY000] [2002] Connection timed out  



setup:static-content:deploy [-d|--dry-run] [--no-javascript] [--no-css] [--no-less] [--no-images] [--no-fonts] [--no-html] [--no-misc] [--no-html-minify] [-t|--theme[="..."]] [--exclude-theme[="..."]] [-l|--language[="..."]] [--exclude-language[="..."]] [-a|--area[="..."]] [--exclude-area[="..."]] [-j|--jobs[="..."]] [--symlink-locale] [languages1] ... [languagesN]

Hardly anything works with CLI..

I tried to run the upgrade with -vvv. This was the output.

php bin/magento setup:upgrade -vvv

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

Exception trace:
 () at /home/timothy/Public/www/vendor/symfony/console/Symfony/Component/Console/Application.php:501
 Symfony\Component\Console\Application->findNamespace() at /home/timothy/Public/www/vendor/symfony/console/Symfony/Component/Console/Application.php:535
 Symfony\Component\Console\Application->find() at /home/timothy/Public/www/vendor/symfony/console/Symfony/Component/Console/Application.php:192
 Symfony\Component\Console\Application->doRun() at /home/timothy/Public/www/vendor/magento/framework/Console/Cli.php:96
 Magento\Framework\Console\Cli->doRun() at /home/timothy/Public/www/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at /home/timothy/Public/www/bin/magento:23
  • 1
    Can you check if the database is up & running and credentials are correct? are you using AWS? make sure its server is up and running if use – Hitesh Nov 28 '18 at 5:22
  • localhost with docker containers – getData Nov 28 '18 at 15:31
  • I logged into the mariadb container and ran the status command and here's the output: Uptime: 75384 Threads: 20 Questions: 330211 Slow queries: 0 Opens: 6339126 Flush tables: 1 Open tables: 400 Queries per second avg: 4.380 – getData Nov 28 '18 at 15:35
1

Please make sure your sql server is up and running fine. Magento has specific system requirement. It works fine when you have all the resources required to run a Magento2 setup properly. Please visit below links for required resources:

https://devdocs.magento.com/guides/v2.2/install-gde/system-requirements-tech.html

Please compare with resources you have and take necessary steps to get required setup in case.

  • I logged into the mariadb container and ran the status command and here's the output: Uptime: 75384 Threads: 20 Questions: 330211 Slow queries: 0 Opens: 6339126 Flush tables: 1 Open tables: 400 Queries per second avg: 4.380 – getData Nov 28 '18 at 15:35

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.