From 7b0a9db80635e8dfb17b290b56b44b99034c0442 Mon Sep 17 00:00:00 2001 From: 7ttp <117663341+7ttp@users.noreply.github.com> Date: Wed, 3 Dec 2025 15:19:19 +0530 Subject: [PATCH] fix: ensure conf.d directory exists for postgres 17 compatibility The new postgres image (17.6.1.058) includes an include_dir directive in postgresql.conf that requires /etc/postgresql-custom/conf.d to exist. When upgrading from older CLI versions, existing config volumes do not contain this directory. Docker does not copy image contents when mounting a volume that already has data, causing postgres to fail with: could not open configuration directory /etc/postgresql-custom/conf.d This fix adds mkdir -p to create the directory before postgres starts, ensuring backwards compatibility with existing volumes. Closes supabase/supabase#41012 --- internal/db/start/start.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/db/start/start.go b/internal/db/start/start.go index 78fc1cf45d..fd875717fa 100644 --- a/internal/db/start/start.go +++ b/internal/db/start/start.go @@ -89,6 +89,7 @@ func NewContainerConfig(args ...string) container.Config { Retries: 3, }, Entrypoint: []string{"sh", "-c", ` +mkdir -p /etc/postgresql-custom/conf.d && \ cat <<'EOF' > /etc/postgresql.schema.sql && \ cat <<'EOF' > /etc/postgresql-custom/pgsodium_root.key && \ cat <<'EOF' >> /etc/postgresql/postgresql.conf && \ @@ -143,6 +144,7 @@ func StartDatabase(ctx context.Context, fromBackup string, fsys afero.Fs, w io.W } if len(fromBackup) > 0 { config.Entrypoint = []string{"sh", "-c", ` +mkdir -p /etc/postgresql-custom/conf.d && \ cat <<'EOF' > /etc/postgresql.schema.sql && \ cat <<'EOF' > /docker-entrypoint-initdb.d/migrate.sh && \ cat <<'EOF' > /etc/postgresql-custom/pgsodium_root.key && \