supabase/postgres

Bug: Docker container does not start in version 15.8.1.039

dazz opened this issue · 2 comments

dazz commented

FATAL: The getkey script "/usr/share/postgresql/extension/pgsodium_getkey" does not exist.

services:
  supabase-db:
    image: supabase/postgres:15.8.1.039
    #image: supabase/postgres:17.0.1.035-orioledb
    container_name: supabase-db
    ports:
      - "5432:5432"
    command: postgres -c config_file=/etc/postgresql/postgresql.conf
    environment:
      POSTGRES_PASSWORD: "postgres"

Console output:

PostgreSQL Database directory appears to contain a database; Skipping initialization
2025-02-15T13:24:08.564341000Z 
2025-02-15T13:24:08.579532000Z  2025-02-15 13:24:08.579 UTC [1] LOG:  pgaudit extension initialized
2025-02-15T13:24:08.586067000Z  2025-02-15 13:24:08.585 UTC [1] LOG:  pgsodium primary server secret key loaded
2025-02-15T13:24:08.586589000Z  2025-02-15 13:24:08.586 UTC [1] FATAL:  The getkey script "/usr/share/postgresql/extension/pgsodium_getkey" does not exist.
2025-02-15T13:24:08.586620000Z  2025-02-15 13:24:08.586 UTC [1] DETAIL:  The getkey script fetches the primary server secret key.
2025-02-15T13:24:08.586641000Z  2025-02-15 13:24:08.586 UTC [1] HINT:  You might want to create it and/or set "vault.getkey_script" to the correct path.
2025-02-15T13:24:08.586668000Z  2025-02-15 13:24:08.586 UTC [1] LOG:  database system is shut down

can be reproduced with

  • 17.0.1.035-orioledb
  • 15.8.1.039
  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

The docker container does not start. The container does start with version 15.8.1.034

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. put the above yaml into your compose file
  2. run docker compose up -d supabase-db
  3. See error

Expected behavior

when I initially start a container it is healthy

System information

  • OS: Nixos

As a quick fix you can append the run call on line 173 of the Dockerfile-orioledb-17 with the following and rebuild:

RUN sed -i \
    -e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \
    -e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \
    -e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \
    -e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \
    echo "cron.database_name = 'postgres'" >> /etc/postgresql/postgresql.conf && \
    echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
    echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
    echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \
    usermod -aG postgres wal-g && \
    mkdir -p /etc/postgresql-custom && \
    chown postgres:postgres /etc/postgresql-custom

the above should resolve it. If you still have issues feel free to re-open