wodby / drupal-php

PHP docker container image for Drupal
https://wodby.com/stacks/drupal
MIT License
60 stars 80 forks source link

Using PHP_TAG=7.4-dev-4.27.1 tag causes Drupal not to route to the site anymore. #85

Open kevinquillen opened 2 years ago

kevinquillen commented 2 years ago

I updated from 7.4-4.19 to the latest tag in the 7.4 line, and when I did that I could no longer run drush cr or access the website. It appeared that the appropriate site folder was no longer read and that settings files were not locatable. Dropping back to the old tag resolved the issue for me.

csandanov commented 2 years ago

What's your Drupal version? Most likely the image comes with the updated global drush that no longer supports your Drupal version. You should have your own drush coming with your drupal composer setup (see drupal-composer or drupal/recommened-project).

kevinquillen commented 2 years ago

Drupal 9.2.4. I am and have been including drush/drush in composer, it is at version 10.

Drush aside, the homepage displays:

Notice: Undefined offset: 1 in Drupal\Core\Database\Database::parseConnectionInfo() (line 215 of /var/www/html/web/core/lib/Drupal/Core/Database/Database.php).
Drupal\Core\Database\Database::parseConnectionInfo(Array) (Line: 263)
Drupal\Core\Database\Database::addConnectionInfo('default', 'default', Array) (Line: 165)
Drupal\Core\Site\Settings::initialize('/var/www/html/web', 'sites/nber.docker.localhost', Object) (Line: 1073)
Drupal\Core\DrupalKernel->initializeSettings(Object) (Line: 707)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Notice: Undefined index: driver in Drupal\Core\Database\Database::parseConnectionInfo() (line 234 of /var/www/html/web/core/lib/Drupal/Core/Database/Database.php).
Drupal\Core\Database\Database::parseConnectionInfo(Array) (Line: 263)
Drupal\Core\Database\Database::addConnectionInfo('default', 'default', Array) (Line: 165)
Drupal\Core\Site\Settings::initialize('/var/www/html/web', 'sites/nber.docker.localhost', Object) (Line: 1073)
Drupal\Core\DrupalKernel->initializeSettings(Object) (Line: 707)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Notice: Undefined index: driver in Drupal\Core\Database\Database::openConnection() (line 374 of /var/www/html/web/core/lib/Drupal/Core/Database/Database.php).
Drupal\Core\Database\Database::openConnection('default', 'default') (Line: 169)
Drupal\Core\Database\Database::getConnection('default')
call_user_func_array('Drupal\Core\Database\Database::getConnection', Array) (Line: 79)
Drupal\Component\DependencyInjection\PhpArrayContainer->createService(Array, 'database') (Line: 176)
Drupal\Component\DependencyInjection\Container->get('database', 1) (Line: 212)
Drupal\Component\DependencyInjection\PhpArrayContainer->resolveServicesAndParameters(Array) (Line: 62)
Drupal\Component\DependencyInjection\PhpArrayContainer->createService(Array, 'cache.container') (Line: 176)
Drupal\Component\DependencyInjection\Container->get('cache.container') (Line: 550)
Drupal\Core\DrupalKernel->getCachedContainerDefinition() (Line: 903)
Drupal\Core\DrupalKernel->initializeContainer() (Line: 473)
Drupal\Core\DrupalKernel->boot() (Line: 716)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
The website encountered an unexpected error. Please try again later.
Drupal\Core\Database\DriverNotSpecifiedException: Driver not specified for this database connection: default in Drupal\Core\Database\Database::openConnection() (line 375 of /var/www/html/web/core/lib/Drupal/Core/Database/Database.php).
Drupal\Core\Database\Database::openConnection() (Line: 169)
Drupal\Core\Database\Database::getConnection()
call_user_func_array() (Line: 79)
Drupal\Component\DependencyInjection\PhpArrayContainer->createService() (Line: 176)
Drupal\Component\DependencyInjection\Container->get() (Line: 212)
Drupal\Component\DependencyInjection\PhpArrayContainer->resolveServicesAndParameters() (Line: 62)
Drupal\Component\DependencyInjection\PhpArrayContainer->createService() (Line: 176)
Drupal\Component\DependencyInjection\Container->get() (Line: 550)
Drupal\Core\DrupalKernel->getCachedContainerDefinition() (Line: 903)
Drupal\Core\DrupalKernel->initializeContainer() (Line: 473)
Drupal\Core\DrupalKernel->boot() (Line: 716)
Drupal\Core\DrupalKernel->handle() (Line: 19)

The $_ENV is empty if I dump it in settings.php.

kevinquillen commented 2 years ago

Update, the tag I am using is actually PHP_TAG=7.4-dev-4.27.1

kevinquillen commented 2 years ago

Perhaps I missed this change - but $_ENV no longer has those values but $_SERVER does. Changing to $_SERVER works, but the docs appear to state to hard code the credentials into settings.php instead?

kevinquillen commented 2 years ago

This also failed for me elsewhere: $_ENV['HOME']

csandanov commented 2 years ago

the behaviour regarding the global env vars most likely changed because of https://github.com/wodby/php/issues/145

as for drush most likely the issue in your settings.php file