git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/nextcloud: temp fix for MariaDB >=10.6

The MariaDB version 10.6 doesn't seem supported with current Nextcloud versions and the test fails with the following error[1]: nextcloud # [ 14.950034] nextcloud-setup-start[1001]: Error while trying to initialise the database: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE. According to a support-thread in upstream's Discourse[2] this is because of a missing support so far. Considering that we haven't received any bugreports so far - even though the issue already exists on master - and the workaround[3] appears to work fine, an evaluation warning for administrators should be sufficient. [1] https://hydra.nixos.org/build/155015223 [2] https://help.nextcloud.com/t/update-to-next-cloud-21-0-2-has-get-an-error/117028/15 [3] setting `innodb_read_only_compressed=0`

commit675e262f5a03eb9aa6b0500434ee30a9d6b882a0 authorMaximilian Bosch <maximilian@mbosch.me> dateFri 1 Oct 2021, 15:25 (5 years ago) parent4957370
2 files changed+34−1
nixos/modules/services/web-apps/nextcloud.nix+27−1 nixos/tests/nextcloud/with-mysql-and-memcached.nix+7
nixos/modules/services/web-apps/nextcloud.nix+27−1
@@ -399,13 +399,39 @@ in {
399399 The package can be upgraded by explicitly declaring the service-option
400400 `services.nextcloud.package`.
401401 '';
402+
403+ # FIXME(@Ma27) remove as soon as nextcloud properly supports
404+ # mariadb >=10.6.
405+ isUnsupportedMariadb =
406+ # All currently supported Nextcloud versions are affected.
407+ (versionOlder cfg.package.version "23")
408+ # This module uses mysql
409+ && (cfg.config.dbtype == "mysql")
410+ # MySQL is managed via NixOS
411+ && config.services.mysql.enable
412+ # We're using MariaDB
413+ && (getName config.services.mysql.package) == "mariadb-server"
414+ # MariaDB is at least 10.6 and thus not supported
415+ && (versionAtLeast (getVersion config.services.mysql.package) "10.6");
416+
402417 in (optional (cfg.poolConfig != null) ''
403418 Using config.services.nextcloud.poolConfig is deprecated and will become unsupported in a future release.
404419 Please migrate your configuration to config.services.nextcloud.poolSettings.
405420 '')
406421 ++ (optional (versionOlder cfg.package.version "20") (upgradeWarning 19 "21.05"))
407422 ++ (optional (versionOlder cfg.package.version "21") (upgradeWarning 20 "21.05"))
408− ++ (optional (versionOlder cfg.package.version "22") (upgradeWarning 21 "21.11"));
423+ ++ (optional (versionOlder cfg.package.version "22") (upgradeWarning 21 "21.11"))
424+ ++ (optional isUnsupportedMariadb ''
425+ You seem to be using MariaDB at an unsupported version (i.e. at least 10.6)!
426+ Please note that this isn't supported officially by Nextcloud. You can either
427+
428+ * Switch to `pkgs.mysql`
429+ * Downgrade MariaDB to at least 10.5
430+ * Work around Nextcloud's problems by specifying `innodb_read_only_compressed=0`
431+
432+ For further context, please read
433+ https://help.nextcloud.com/t/update-to-next-cloud-21-0-2-has-get-an-error/117028/15
434+ '');
409435
410436 services.nextcloud.package = with pkgs;
411437 mkDefault (
nixos/tests/nextcloud/with-mysql-and-memcached.nix+7
@@ -39,6 +39,13 @@ in {
3939 enable = true;
4040 bind = "127.0.0.1";
4141 package = pkgs.mariadb;
42+
43+ # FIXME(@Ma27) Nextcloud isn't compatible with mariadb 10.6,
44+ # this is a workaround.
45+ # See https://help.nextcloud.com/t/update-to-next-cloud-21-0-2-has-get-an-error/117028/22
46+ extraOptions = ''
47+ innodb_read_only_compressed=0
48+ '';
4249 initialScript = pkgs.writeText "mysql-init" ''
4350 CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'hunter2';
4451 CREATE DATABASE IF NOT EXISTS nextcloud;