Skip to main content
Rollback to Revision 2
Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

How tocan I fix the "The specified database connection is not defined: default" error?

How tocan I fix the The specified database connection is not defined: default error?

How to fix the "The specified database connection is not defined: default" error?

How to fix the The specified database connection is not defined: default error?

How can I fix the "The specified database connection is not defined: default" error?

How can I fix the The specified database connection is not defined: default error?

deleted 3 characters in body; edited title
Source Link
Pierre.Vriens
  • 36k
  • 40
  • 50
  • 182

How can Ito fix the "The specified database connection is not defined: default" error?

How can Ito fix the The specified database connection is not defined: default error?

How can I fix the "The specified database connection is not defined: default" error?

How can I fix the The specified database connection is not defined: default error?

How to fix the "The specified database connection is not defined: default" error?

How to fix the The specified database connection is not defined: default error?

added an explicit question
Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

drush 10 error 'The How can I fix the "The specified database connection is not defined: default'default" error?

I installed PHP 7.4.21. Then I installed, then Drupal 9.2.1, and Drush 10.5.0 with Composer on Ubuntu 18.04 as well. 10drush is an alias to the 10.5.0 version.

1st check: 10drush -> enter =>Running Drush without arguments, I gotget the drush overviewlist of all the available commands. means drush works.

Then I ran drush cr and got
Running drush cr gives me the following error:.

  'The specified database connection is not defined: default'

The specified database connection is not defined: default

After that I trieddrush cr --root=/home/ip/d916/web gives the same command in addition witherror.

10drush cr --root=/home/ip/d916/web

Same error. The output of '10drush cr -vvv':

Exception trace: at /home/ip/d916/web/core/lib/Drupal/Core/Database/Database.php:371 Drupal\Core\Database\Database::openConnection() at /home/ip/d916/web/core/lib/Drupal/Core/Database/Database.php:169 Drupal\Core\Database\Database::getConnection() at n/a:n/a call_user_func_array() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:258 Drupal\Component\DependencyInjection\Container->createService() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:176 Drupal\Component\DependencyInjection\Container->get() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:437 Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:240 Drupal\Component\DependencyInjection\Container->createService() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:176 Drupal\Component\DependencyInjection\Container->get() at /home/ip/d916/web/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php:89 Drupal\Core\Cache\ChainedFastBackendFactory->get() at /home/ip/d916/web/core/lib/Drupal/Core/Cache/CacheFactory.php:83 Drupal\Core\Cache\CacheFactory->get() at n/a:n/a call_user_func_array() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:258 Drupal\Component\DependencyInjection\Container->createService() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:176 Drupal\Component\DependencyInjection\Container->get() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:437 Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:240 Drupal\Component\DependencyInjection\Container->createService() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:176 Drupal\Component\DependencyInjection\Container->get() at /home/ip/d916/web/core/lib/Drupal/Core/DrupalKernel.php:586 Drupal\Core\DrupalKernel->preHandle() at /home/ip/d916/web/core/includes/utility.inc:35 drupal_rebuild() at /home/ip/d916/vendor/drush/drush/src/Commands/core/CacheCommands.php:234 Drush\Commands\core\CacheCommands->rebuild() at n/a:n/a call_user_func_array() at /home/ip/d916/vendor/consolidation/annotated-command/src/CommandProcessor.php:257 Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback() at /home/ip/d916/vendor/consolidation/annotated-command/src/CommandProcessor.php:212 Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() at /home/ip/d916/vendor/consolidation/annotated-command/src/CommandProcessor.php:176 Consolidation\AnnotatedCommand\CommandProcessor->process() at /home/ip/d916/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:311 Consolidation\AnnotatedCommand\AnnotatedCommand->execute() at /home/ip/d916/vendor/symfony/console/Command/Command.php:255 Symfony\Component\Console\Command\Command->run() at /home/ip/d916/vendor/symfony/console/Application.php:1027 Symfony\Component\Console\Application->doRunCommand() at /home/ip/d916/vendor/symfony/console/Application.php:273 Symfony\Component\Console\Application->doRun() at /home/ip/d916/vendor/symfony/console/Application.php:149 Symfony\Component\Console\Application->run() at /home/ip/d916/vendor/drush/drush/src/Runtime/Runtime.php:118 Drush\Runtime\Runtime->doRun() at /home/ip/d916/vendor/drush/drush/src/Runtime/Runtime.php:48 Drush\Runtime\Runtime->run() at /home/ip/d916/vendor/drush/drush/drushdrush cr -vvv is the following.php:72 require() at /home/ip/d916/vendor/drush/drush/drush:4

Exception trace

at /home/ip/d916/web/core/lib/Drupal/Core/Database/Database.php:371
Drupal\Core\Database\Database::openConnection() at /home/ip/d916/web/core/lib/Drupal/Core/Database/Database.php:169
Drupal\Core\Database\Database::getConnection() at n/a:n/a
call_user_func_array() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:258
Drupal\Component\DependencyInjection\Container->createService() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:176
Drupal\Component\DependencyInjection\Container->get() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:437
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:240
Drupal\Component\DependencyInjection\Container->createService() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:176
Drupal\Component\DependencyInjection\Container->get() at /home/ip/d916/web/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php:89
Drupal\Core\Cache\ChainedFastBackendFactory->get() at /home/ip/d916/web/core/lib/Drupal/Core/Cache/CacheFactory.php:83
Drupal\Core\Cache\CacheFactory->get() at n/a:n/a
call_user_func_array() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:258
Drupal\Component\DependencyInjection\Container->createService() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:176
Drupal\Component\DependencyInjection\Container->get() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:437 Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:240
Drupal\Component\DependencyInjection\Container->createService() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:176
Drupal\Component\DependencyInjection\Container->get() at /home/ip/d916/web/core/lib/Drupal/Core/DrupalKernel.php:586
Drupal\Core\DrupalKernel->preHandle() at /home/ip/d916/web/core/includes/utility.inc:35
drupal_rebuild() at /home/ip/d916/vendor/drush/drush/src/Commands/core/CacheCommands.php:234
Drush\Commands\core\CacheCommands->rebuild() at n/a:n/a
call_user_func_array() at /home/ip/d916/vendor/consolidation/annotated-command/src/CommandProcessor.php:257
Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback() at /home/ip/d916/vendor/consolidation/annotated-command/src/CommandProcessor.php:212
Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() at /home/ip/d916/vendor/consolidation/annotated-command/src/CommandProcessor.php:176
Consolidation\AnnotatedCommand\CommandProcessor->process() at /home/ip/d916/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:311
Consolidation\AnnotatedCommand\AnnotatedCommand->execute() at /home/ip/d916/vendor/symfony/console/Command/Command.php:255
Symfony\Component\Console\Command\Command->run() at /home/ip/d916/vendor/symfony/console/Application.php:1027
Symfony\Component\Console\Application->doRunCommand() at /home/ip/d916/vendor/symfony/console/Application.php:273
Symfony\Component\Console\Application->doRun() at /home/ip/d916/vendor/symfony/console/Application.php:149
Symfony\Component\Console\Application->run() at /home/ip/d916/vendor/drush/drush/src/Runtime/Runtime.php:118
Drush\Runtime\Runtime->doRun() at /home/ip/d916/vendor/drush/drush/src/Runtime/Runtime.php:48
Drush\Runtime\Runtime->run() at /home/ip/d916/vendor/drush/drush/drush.php:72
require() at /home/ip/d916/vendor/drush/drush/drush:4

Composer works without any mistake. Drupal work fine too. Unfortunately I can't work without drushDrush 10.

How can I fix the The specified database connection is not defined: default error?

drush 10 error 'The specified database connection is not defined: default'

I installed PHP 7.4.21. Then I installed Drupal 9.2.1, Drush 10.5.0 with Composer on Ubuntu 18.04 as well. 10drush is an alias to the 10.5.0 version.

1st check: 10drush -> enter => I got the drush overview of all available commands. means drush works.

Then I ran drush cr and got the following error:

  'The specified database connection is not defined: default'

After that I tried same command in addition with

10drush cr --root=/home/ip/d916/web

Same error. The output of '10drush cr -vvv':

Exception trace: at /home/ip/d916/web/core/lib/Drupal/Core/Database/Database.php:371 Drupal\Core\Database\Database::openConnection() at /home/ip/d916/web/core/lib/Drupal/Core/Database/Database.php:169 Drupal\Core\Database\Database::getConnection() at n/a:n/a call_user_func_array() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:258 Drupal\Component\DependencyInjection\Container->createService() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:176 Drupal\Component\DependencyInjection\Container->get() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:437 Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:240 Drupal\Component\DependencyInjection\Container->createService() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:176 Drupal\Component\DependencyInjection\Container->get() at /home/ip/d916/web/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php:89 Drupal\Core\Cache\ChainedFastBackendFactory->get() at /home/ip/d916/web/core/lib/Drupal/Core/Cache/CacheFactory.php:83 Drupal\Core\Cache\CacheFactory->get() at n/a:n/a call_user_func_array() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:258 Drupal\Component\DependencyInjection\Container->createService() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:176 Drupal\Component\DependencyInjection\Container->get() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:437 Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:240 Drupal\Component\DependencyInjection\Container->createService() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:176 Drupal\Component\DependencyInjection\Container->get() at /home/ip/d916/web/core/lib/Drupal/Core/DrupalKernel.php:586 Drupal\Core\DrupalKernel->preHandle() at /home/ip/d916/web/core/includes/utility.inc:35 drupal_rebuild() at /home/ip/d916/vendor/drush/drush/src/Commands/core/CacheCommands.php:234 Drush\Commands\core\CacheCommands->rebuild() at n/a:n/a call_user_func_array() at /home/ip/d916/vendor/consolidation/annotated-command/src/CommandProcessor.php:257 Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback() at /home/ip/d916/vendor/consolidation/annotated-command/src/CommandProcessor.php:212 Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() at /home/ip/d916/vendor/consolidation/annotated-command/src/CommandProcessor.php:176 Consolidation\AnnotatedCommand\CommandProcessor->process() at /home/ip/d916/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:311 Consolidation\AnnotatedCommand\AnnotatedCommand->execute() at /home/ip/d916/vendor/symfony/console/Command/Command.php:255 Symfony\Component\Console\Command\Command->run() at /home/ip/d916/vendor/symfony/console/Application.php:1027 Symfony\Component\Console\Application->doRunCommand() at /home/ip/d916/vendor/symfony/console/Application.php:273 Symfony\Component\Console\Application->doRun() at /home/ip/d916/vendor/symfony/console/Application.php:149 Symfony\Component\Console\Application->run() at /home/ip/d916/vendor/drush/drush/src/Runtime/Runtime.php:118 Drush\Runtime\Runtime->doRun() at /home/ip/d916/vendor/drush/drush/src/Runtime/Runtime.php:48 Drush\Runtime\Runtime->run() at /home/ip/d916/vendor/drush/drush/drush.php:72 require() at /home/ip/d916/vendor/drush/drush/drush:4

Composer works without any mistake. Drupal work fine too. Unfortunately can't work without drush 10.

How can I fix the "The specified database connection is not defined: default" error?

I installed PHP 7.4.21, then Drupal 9.2.1, and Drush 10.5.0 with Composer as well.

Running Drush without arguments, I get the list of all the available commands.
Running drush cr gives me the following error.

The specified database connection is not defined: default

drush cr --root=/home/ip/d916/web gives the same error.

The output of drush cr -vvv is the following.

Exception trace

at /home/ip/d916/web/core/lib/Drupal/Core/Database/Database.php:371
Drupal\Core\Database\Database::openConnection() at /home/ip/d916/web/core/lib/Drupal/Core/Database/Database.php:169
Drupal\Core\Database\Database::getConnection() at n/a:n/a
call_user_func_array() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:258
Drupal\Component\DependencyInjection\Container->createService() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:176
Drupal\Component\DependencyInjection\Container->get() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:437
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:240
Drupal\Component\DependencyInjection\Container->createService() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:176
Drupal\Component\DependencyInjection\Container->get() at /home/ip/d916/web/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php:89
Drupal\Core\Cache\ChainedFastBackendFactory->get() at /home/ip/d916/web/core/lib/Drupal/Core/Cache/CacheFactory.php:83
Drupal\Core\Cache\CacheFactory->get() at n/a:n/a
call_user_func_array() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:258
Drupal\Component\DependencyInjection\Container->createService() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:176
Drupal\Component\DependencyInjection\Container->get() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:437 Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:240
Drupal\Component\DependencyInjection\Container->createService() at /home/ip/d916/web/core/lib/Drupal/Component/DependencyInjection/Container.php:176
Drupal\Component\DependencyInjection\Container->get() at /home/ip/d916/web/core/lib/Drupal/Core/DrupalKernel.php:586
Drupal\Core\DrupalKernel->preHandle() at /home/ip/d916/web/core/includes/utility.inc:35
drupal_rebuild() at /home/ip/d916/vendor/drush/drush/src/Commands/core/CacheCommands.php:234
Drush\Commands\core\CacheCommands->rebuild() at n/a:n/a
call_user_func_array() at /home/ip/d916/vendor/consolidation/annotated-command/src/CommandProcessor.php:257
Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback() at /home/ip/d916/vendor/consolidation/annotated-command/src/CommandProcessor.php:212
Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() at /home/ip/d916/vendor/consolidation/annotated-command/src/CommandProcessor.php:176
Consolidation\AnnotatedCommand\CommandProcessor->process() at /home/ip/d916/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:311
Consolidation\AnnotatedCommand\AnnotatedCommand->execute() at /home/ip/d916/vendor/symfony/console/Command/Command.php:255
Symfony\Component\Console\Command\Command->run() at /home/ip/d916/vendor/symfony/console/Application.php:1027
Symfony\Component\Console\Application->doRunCommand() at /home/ip/d916/vendor/symfony/console/Application.php:273
Symfony\Component\Console\Application->doRun() at /home/ip/d916/vendor/symfony/console/Application.php:149
Symfony\Component\Console\Application->run() at /home/ip/d916/vendor/drush/drush/src/Runtime/Runtime.php:118
Drush\Runtime\Runtime->doRun() at /home/ip/d916/vendor/drush/drush/src/Runtime/Runtime.php:48
Drush\Runtime\Runtime->run() at /home/ip/d916/vendor/drush/drush/drush.php:72
require() at /home/ip/d916/vendor/drush/drush/drush:4

Composer works without any mistake. Drupal work fine too. Unfortunately I can't work without Drush 10.

How can I fix the The specified database connection is not defined: default error?

Source Link
bolshii
  • 67
  • 1
  • 1
  • 8
Loading