0

I'm trying to recover my admin password in Drupal with Drush. I've installed Drush successfully, but every time I run drush uli as well as similar commands I get this error:

Drupal\Core\Database\ConnectionNotDefinedException: The specified database connection is not defined: default in                                         [error]
/Users/myusername/.kalabox/apps/canchascrd8/code/core/lib/Drupal/Core/Database/Database.php:361
Stack trace:
#0 /Users/myusername/.kalabox/apps/canchascrd8/code/core/lib/Drupal/Core/Database/Database.php(166):
Drupal\Core\Database\Database::openConnection('default', 'default')
#1 [internal function]: Drupal\Core\Database\Database::getConnection('default')
#2 /Users/myusername/.kalabox/apps/canchascrd8/code/core/lib/Drupal/Component/DependencyInjection/Container.php(254): call_user_func_array(Array,
Array)
#3 /Users/myusername/.kalabox/apps/canchascrd8/code/core/lib/Drupal/Component/DependencyInjection/Container.php(177):
Drupal\Component\DependencyInjection\Container->createService(Array, 'database')
#4 /Users/myusername/.kalabox/apps/canchascrd8/code/core/lib/Drupal/Component/DependencyInjection/Container.php(494):
Drupal\Component\DependencyInjection\Container->get('database', 1)
#5 /Users/myusername/.kalabox/apps/canchascrd8/code/core/lib/Drupal/Component/DependencyInjection/Container.php(236):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#6 /Users/myusername/.kalabox/apps/canchascrd8/code/core/lib/Drupal/Component/DependencyInjection/Container.php(177):
Drupal\Component\DependencyInjection\Container->createService(Array, 'cache.backend.d...')
#7 /Users/myusername/.kalabox/apps/canchascrd8/code/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php(85):
Drupal\Component\DependencyInjection\Container->get('cache.backend.d...')
#8 /Users/myusername/.kalabox/apps/canchascrd8/code/core/lib/Drupal/Core/Cache/CacheFactory.php(79):
Drupal\Core\Cache\ChainedFastBackendFactory->get('bootstrap')
#9 [internal function]: Drupal\Core\Cache\CacheFactory->get('bootstrap')
#10 /Users/myusername/.kalabox/apps/canchascrd8/code/core/lib/Drupal/Component/DependencyInjection/Container.php(254): call_user_func_array(Array,
Array)
#11 /Users/myusername/.kalabox/apps/canchascrd8/code/core/lib/Drupal/Component/DependencyInjection/Container.php(177):
Drupal\Component\DependencyInjection\Container->createService(Array, 'cache.bootstrap')
#12 /Users/myusername/.kalabox/apps/canchascrd8/code/core/lib/Drupal/Component/DependencyInjection/Container.php(494):
Drupal\Component\DependencyInjection\Container->get('cache.bootstrap', 1)
#13 /Users/myusername/.kalabox/apps/canchascrd8/code/core/lib/Drupal/Component/DependencyInjection/Container.php(236):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#14 /Users/myusername/.kalabox/apps/canchascrd8/code/core/lib/Drupal/Component/DependencyInjection/Container.php(177):
Drupal\Component\DependencyInjection\Container->createService(Array, 'module_handler')
#15 /Users/myusername/.kalabox/apps/canchascrd8/code/core/lib/Drupal/Core/DrupalKernel.php(520):
Drupal\Component\DependencyInjection\Container->get('module_handler')
#16 /Users/myusername/.kalabox/apps/canchascrd8/code/core/lib/Drupal/Core/DrupalKernel.php(678):
Drupal\Core\DrupalKernel->preHandle(Object(Symfony\Component\HttpFoundation\Request))
#17 /usr/local/Cellar/drush/8.1.3/libexec/lib/Drush/Boot/DrupalBoot8.php(150):
Drupal\Core\DrupalKernel->prepareLegacyRequest(Object(Symfony\Component\HttpFoundation\Request))
#18 /usr/local/Cellar/drush/8.1.3/libexec/includes/bootstrap.inc(354): Drush\Boot\DrupalBoot8->bootstrap_drupal_full()
#19 /usr/local/Cellar/drush/8.1.3/libexec/commands/user/user.drush.inc(389): drush_bootstrap(5)
#20 /usr/local/Cellar/drush/8.1.3/libexec/includes/command.inc(373): drush_user_login()
#21 /usr/local/Cellar/drush/8.1.3/libexec/includes/command.inc(224): _drush_invoke_hooks(Array, Array)
#22 /usr/local/Cellar/drush/8.1.3/libexec/includes/command.inc(192): drush_command()
#23 /usr/local/Cellar/drush/8.1.3/libexec/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#24 /usr/local/Cellar/drush/8.1.3/libexec/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#25 /usr/local/Cellar/drush/8.1.3/libexec/drush.php(12): drush_main()

I'm using Kalabox, and brand new to Drupal. Does anyone have any ideas?

Jonathan
  • 648
  • 4
  • 13
  • 34

1 Answers1

2

If you are using Kalabox you need to use kbox drush uli (not drush uli) from somewhere inside of your apps folder.

You also are going to want to ensure

  1. Your app is actually on
  2. You have actually set up the Drupal site (aka created the database)
  3. You have not edited pantheon.settings.php to remove the logic that grabs your database connection info from the PRESSFLOW_SETTINGS envvar.

Might be worth either destroying and recreating the site in Kalabox or spinning up another site in Pantheon and pulling that down to troubleshoot.

Mike Pirog
  • 31
  • 1
  • Thanks for the answer Mike. Kalabox ended up giving me so much trouble that I just ditched it and went with MAMP, and now everything is working. – Jonathan Sep 16 '16 at 00:07