SQLite install tasks requires the file_system service

Created on 24 July 2024, about 2 months ago
Updated 5 September 2024, 2 days ago

Problem/Motivation

When installing with a Drupal site which has it's database connection predefined for SQLite (and maybe without), the Drupal site crashes due to the file_system service not being available

<br />
<b>Fatal error</b>:  Uncaught Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service &quot;file_system&quot;. in /persist/drupal/vendor/symfony/dependency-injection/ContainerBuilder.php:992
Stack trace:
#0 /persist/drupal/vendor/symfony/dependency-injection/ContainerBuilder.php(568): Symfony\Component\DependencyInjection\ContainerBuilder-&gt;getDefinition('file_system')
#1 /persist/drupal/vendor/symfony/dependency-injection/ContainerBuilder.php(531): Symfony\Component\DependencyInjection\ContainerBuilder-&gt;doGet('file_system', 1)
#2 /persist/drupal/web/core/lib/Drupal.php(197): Symfony\Component\DependencyInjection\ContainerBuilder-&gt;get('file_system')
#3 /persist/drupal/web/core/modules/sqlite/src/Driver/Database/sqlite/Install/Tasks.php(79): Drupal::service('file_system')
#4 /persist/drupal/web/core/lib/Drupal/Core/Database/Install/Tasks.php(150): Drupal\sqlite\Driver\Database\sqlite\Install\Tasks-&gt;connect()
#5 /persist/drupal/web/core/includes/install.core.inc(1228): Drupal\Core\Database\Install\Tasks-&gt;runTasks()
#6 /persist/drupal/web/core/includes/install.core.inc(1177): install_database_errors(Array, './sites/default...')
#7 /persist/drupal/web/core/includes/install.core.inc(391): install_verify_database_settings('sites/default')
#8 /persist/drupal/web/core/includes/install.core.inc(119): install_begin_request(Object(Composer\Autoload\ClassLoader), Array)
#9 /persist/drupal/web/core/install.php(48): install_drupal(Object(Composer\Autoload\ClassLoader))
#10 {main}
  thrown in <b>/persist/drupal/vendor/symfony/dependency-injection/ContainerBuilder.php</b> on line <b>992</b><br />

The minimal container created in install_begin_request doesn't setup the service before invoking install_verify_database_settings

Steps to reproduce

Try to install Drupal with an existing sites/default/settings.php that contains

$databases['default']['default'] = array (
  'database' => 'sites/default/files/.sqlite',
  'prefix' => '',
  'driver' => 'sqlite',
  'namespace' => 'Drupal\\sqlite\\Driver\\Database\\sqlite',
  'autoload' => 'core/modules/sqlite/src/Driver/Database/sqlite/',
);

Proposed resolution

Register file_system

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
InstallΒ  β†’

Last updated 2 days ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States mglaman WI, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024