Problem/Motivation
Drupal 8 offers a distribution
-key in the distro.info.yml file to use and let users skip the profile selection screen. The value of this key replaces the "Drupal"-string and the user is saving time by jumping to the module installation progress screen in case there is a db-connection available.
Choosing another language lets the web installer fail with "Drupal is already installed" translated in the chosen language.
Tracing this behavior leads to the following error:
RuntimeException: Failed to start the session because headers have already been sent by "/app/vendor/symfony/http-foundation/Response.php" at line 412. in /app/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php on line 139 #0 /app/web/core/lib/Drupal/Core/Session/SessionManager.php(163): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() #1 /app/web/core/lib/Drupal/Core/Session/SessionManager.php(118): Drupal\Core\Session\SessionManager->startNow() #2 /app/vendor/symfony/http-foundation/Session/Session.php(71): Drupal\Core\Session\SessionManager->start() #3 /app/web/core/includes/install.core.inc(1482): Symfony\Component\HttpFoundation\Session\Session->start() #4 /app/web/core/includes/install.core.inc(671): install_bootstrap_full(Array) #5 /app/web/core/includes/install.core.inc(549): install_run_task(Array, Array) #6 /app/web/core/includes/install.core.inc(117): install_run_tasks(Array) #7 /app/web/core/install.php(44): install_drupal(Object(Composer\Autoload\ClassLoader))
This error can be reproduced only by choosing a different language
- Empty the database
- Run the installer again with the same language:
Result: Installation process starts as usual.
- Empty the database.
- Choose another "non-english" language.
Result: Error can be reproduced.
It seems that the immediate request for downloading the translation files is causing the error.
The code to skip the profile selection can be found in web/core/includes/install.core.inc:1243
// Check for a distribution profile.
foreach ($install_state['profiles'] as $profile) {
$profile_info = install_profile_info($profile->getName());
if (!empty($profile_info['distribution'])) {
return $profile->getName();
}
}
Proposed resolution
Installing via drush and choosing english as language in the web installer works fine.
As a temporary fix for distribution maintainers, who let their distribution deploy to cloud based services where you already have pre-configured datatabase connection: Remove the distribution key from your profiles info.yml.