docker-library / drupal

Docker Official Image packaging for Drupal
282 stars 203 forks source link

Installation error drupal 11 with sqlite #264

Open svicervlad opened 3 months ago

svicervlad commented 3 months ago

When I try to install Drupal 11 with a sqlite database I get an error

The database server version 3.40.1 is less than the minimum required version 3.45.

Image: drupal:11.0.0-php8.3-apache-bookworm

I think SQLite should be supported in Drupal Docker images for several important reasons, making it an ideal choice for specific use cases.

Key Advantages of SQLite in Docker Images of Drupal:

  1. Ease of Setup: SQLite requires no complex configuration. All that’s needed is a database file, making it perfect for quick testing or development.
  2. Minimal Dependencies: Using SQLite reduces the number of additional services that need to be run and managed in the container, simplifying deployment and maintenance.
  3. Drupal Support: Drupal officially supports SQLite as one of the database options. Therefore, you can expect that functionality will work correctly in any environment, including Docker.
  4. Local Development: For developers working on Drupal in Docker containers, using SQLite can be a convenient solution for local development where a more complex database isn’t needed.
  5. Simplicity in Backup and Restoration: Since SQLite’s database is stored as a single file, it’s easy to back up and transfer between environments.

Demonstrations with Drupal:

  1. Quick Deployment of Demo Sites: With SQLite, you can quickly deploy demo versions of Drupal sites without the need to configure a full-fledged database. This is ideal for presentations where you need to showcase functionality or themes quickly.
  2. Single File Database: SQLite allows the entire database to be stored in a single file. This is convenient for creating and distributing Docker demo images that can be easily transferred and run on different machines without additional setup.
  3. Resource Minimization: Since demonstrations usually don’t require high performance or scalability, SQLite becomes an optimal solution that minimizes resource usage.
tianon commented 3 months ago

Ouch, confirmed: https://www.drupal.org/docs/getting-started/system-requirements/database-server-requirements#s-drupal-11--3

(I also tested - totally stock image deployment with no additional configuration and simply choosing SQLite in the setup wizard :disappointed:)

tianon commented 3 months ago

Looking at https://packages.debian.org/bookworm/sqlite3, I'm also not sure there's a good way for us to solve this (there's not a newer version available for bookworm).

tianon commented 3 months ago

Looks like this was part of https://www.drupal.org/project/drupal/issues/3346338 (actually codified in https://github.com/drupal/drupal/commit/10466dba9d7322ed55165dd9224edb2153c9b27a, which references https://www.drupal.org/project/drupal/issues/3420972 instead but that one is about testing, not about bumping the requirement).

tianon commented 3 months ago

The first Debian release that supports 3.45 is Trixie, most likely released 2025, This is after Drupal 11 release. The latest version supported by Debian is 3.40.1-2.

and

Require sqlite 3.45 for Drupal 11. Very few sites run SQLite in production, and any existing ones which aren't yet ready to update to 3.45 are able to stay on Drupal 10 for two years beyond Drupal 11's release date.

:disappointed:

tianon commented 3 months ago

From comments like this:

I think if there are really good reasons, we can roll this back, but I agree sqlite is mainly used for testing locally.

I believe we can safely infer that this is a "wontfix" / intentional breakage for upstream.

https://www.drupal.org/project/drupal/issues/3346338#comment-15370259 suggests that there could be (slash will be?) a contrib module with can be used instead to get sqlite support working on older sqlite versions, but I have not found it yet.

tianon commented 3 months ago

From https://www.drupal.org/project/drupal/issues/3346338#comment-15577306, it looks like that might exist at https://www.drupal.org/project/sqlite326 someday, but does not currently (and no ETA), so I think that's as far as we can reasonably take this unless/until someone writes that module.

For the avoidance of doubt, I am not very comfortable with us building our own copy of SQLite from source to fix this issue (for similar reasons to upstream deciding it was worth doing a breaking change even knowing it would exclude some set of users and that it wasn't important enough to stop them from doing so).

svicervlad commented 3 months ago

https://github.com/ddev/ddev/issues/6110 Fixed in ddev https://github.com/ddev/ddev/pull/6137 by installing sqlite pkg from Debian Trixie.

svicervlad commented 3 months ago

or maybe better to use apt_preferences instead of wget and dpkg https://wiki.debian.org/AptConfiguration?action=show&redirect=AptPreferences#apt_preferences_.28APT_pinning.29

tianon commented 3 months ago

Installing the package from Trixie is something that will currently maybe work, but is likely to break in the future, especially as Trixie is not in any stage of freeze.

mcdruid commented 2 months ago

AFAICS the workaround of installing sqlite 3.45.1 from the trixie repo (see https://github.com/ddev/ddev/pull/6137 and https://github.com/ddev/ddev/issues/6110 ) has indeed stopped working.

The version in the repo seems to have changed to 3.46 which means the 3.45 urls now return a 404 - e.g.:

#24 [web 7/8] RUN SQLITE_VERSION=3.45.1 &&     mkdir -p /tmp/sqlite3 &&     wget -O /tmp/sqlite3/sqlite3.deb https://ftp.debian.org/debian/pool/main/s/sqlite3/sqlite3_${SQLITE_VERSION}-1_amd64.deb &&     wget -O /tmp/sqlite3/libsqlite3.deb https://ftp.debian.org/debian/pool/main/s/sqlite3/libsqlite3-0_${SQLITE_VERSION}-1_amd64.deb &&     dpkg -i /tmp/sqlite3/*.deb &&     rm -rf /tmp/sqlite3
#24 0.195 --2024-09-20 07:32:39--  https://ftp.debian.org/debian/pool/main/s/sqlite3/sqlite3_3.45.1-1_amd64.deb
#24 0.206 Resolving ftp.debian.org (ftp.debian.org)... 146.75.74.132, 2a04:4e42:82::644
#24 0.220 Connecting to ftp.debian.org (ftp.debian.org)|146.75.74.132|:443... connected.
#24 0.248 HTTP request sent, awaiting response... 404 Not Found

Trying to install 3.46 instead results in dependency errors:

#24 0.543 Preparing to unpack /tmp/sqlite3/libsqlite3.deb ...
#24 0.559 Unpacking libsqlite3-0:amd64 (3.46.1-1) over (3.40.1-2) ...
#24 0.667 Preparing to unpack /tmp/sqlite3/sqlite3.deb ...
#24 0.683 Unpacking sqlite3 (3.46.1-1) over (3.40.1-2) ...
#24 0.754 dpkg: dependency problems prevent configuration of libsqlite3-0:amd64:
#24 0.754  libsqlite3-0:amd64 depends on libc6 (>= 2.38); however:
#24 0.754   Version of libc6:amd64 on system is 2.36-9+deb12u7.
#24 0.754 
#24 0.754 dpkg: error processing package libsqlite3-0:amd64 (--install):
#24 0.754  dependency problems - leaving unconfigured
#24 0.754 dpkg: dependency problems prevent configuration of sqlite3:
#24 0.754  sqlite3 depends on libreadline8t64 (>= 6.0); however:
#24 0.754   Package libreadline8t64 is not installed.
#24 0.754  sqlite3 depends on libsqlite3-0 (= 3.46.1-1); however:
#24 0.754   Package libsqlite3-0:amd64 is not configured yet.
#24 0.754 
#24 0.754 dpkg: error processing package sqlite3 (--install):
#24 0.754  dependency problems - leaving unconfigured
#24 0.755 Processing triggers for libc-bin (2.36-9+deb12u7) ...
#24 0.977 Errors were encountered while processing:
#24 0.977  libsqlite3-0:amd64
#24 0.977  sqlite3