From e15890c3fee2fda9387041334d1041d236846db5 Mon Sep 17 00:00:00 2001 From: Morgan Jones Date: Sat, 23 Aug 2025 20:05:19 -0700 Subject: [PATCH 1/2] nixos/mattermost: remove fallback charset for MySQL This was causing issues on newer versions of MariaDB (breaking NixOS tests) like: ``` Error 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '%2Cutf8' at line 1 ``` Since this is simply a fallback character set and all supported versions of MariaDB support utf8mb4, delete the fallback. This change should be fully compatible with existing deployments. (cherry picked from commit 6cc8a8cdb582660c8f33f23ad949f4a5da07ee7a) --- nixos/modules/services/web-apps/mattermost.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/web-apps/mattermost.nix b/nixos/modules/services/web-apps/mattermost.nix index 83c9181ff302..f3d3be43eabc 100644 --- a/nixos/modules/services/web-apps/mattermost.nix +++ b/nixos/modules/services/web-apps/mattermost.nix @@ -668,7 +668,7 @@ in } else if cfg.database.driver == "mysql" then { - charset = "utf8mb4,utf8"; + charset = "utf8mb4"; writeTimeout = "60s"; readTimeout = "60s"; } @@ -682,7 +682,7 @@ in } else if config.mattermost.database.driver == "mysql" then { - charset = "utf8mb4,utf8"; + charset = "utf8mb4"; writeTimeout = "60s"; readTimeout = "60s"; } From e4408d52e5581773899dec31e492579c3e68b329 Mon Sep 17 00:00:00 2001 From: Morgan Jones Date: Sat, 23 Aug 2025 22:09:04 -0700 Subject: [PATCH 2/2] mattermost: tests: use UTF-8 for database charset There is a new test that checks this. (cherry picked from commit 749675c629bb17deb26e35fe6c7053fe5ed73a55) --- pkgs/by-name/ma/mattermost/tests.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/ma/mattermost/tests.nix b/pkgs/by-name/ma/mattermost/tests.nix index ed6e9125c435..e481066bb0c8 100644 --- a/pkgs/by-name/ma/mattermost/tests.nix +++ b/pkgs/by-name/ma/mattermost/tests.nix @@ -336,7 +336,7 @@ mattermost.overrideAttrs ( # Start Postgres. export PGDATA="$NIX_BUILD_TOP/.postgres" - initdb -U postgres + initdb -E UTF8 -U postgres mkdir -p "$PGDATA/run" cat <> "$PGDATA/postgresql.conf" unix_socket_directories = '$PGDATA/run'