markaspot / mark-a-spot

Public Civic Issue Tracking and Crowdsourcing / Mapping Platform based on Drupal. Open311 Server and Client Software
http://mark-a-spot.com
55 stars 30 forks source link

Installation breaks when choosing a different language than english. #59

Open markaspot opened 6 years ago

markaspot commented 6 years ago

Installing via drush and choosing english as language in the web installer works fine. Choosing another language lets the web installer fail with a "Drupal is already installed" error.

markaspot commented 6 years ago

Tracing this behaviour 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))

`

markaspot commented 6 years ago

This error can be reproduced only by choosing a different language

  1. Empty the database
  2. Run the installer again with the same language:

Result: Installationprocess starts as usual.

  1. Empty the database.
  2. Choose another "non-english" language. Result: Error can be reproduced.
markaspot commented 6 years ago

This has to be tested with a normal installer. Distros like Mark-a-Spot or Open Social skip the standard profile selector.

markaspot commented 6 years ago

By using the distribution key in the distro.info.yml file, the installer starts directly installing and downloading the translation. It seems that the immediate request for the translation files is causing the error. 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();
    }
  }
Crell commented 6 years ago

Interesting. Good sleuthing! This sounds like it's worth opening a core bug about; even if the fix isn't in core (although I suspect it is), it's good to get the issue raised there and a broader audience may have more ideas on how to fix it.

markaspot commented 6 years ago

Thanks for your support, Larry. Your reference to the Open Social distro got me on the right track. We should reference this bug in their queue, too. Core Issue opened: https://www.drupal.org/project/drupal/issues/2942369