Skip to content

Bug: pg-gvm no longer starting #97

@kernal64

Description

@kernal64

This is an issue and not a support question which should be asked at https://forum.greenbone.net/?

  • This is an issue and not a support question

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When starting the compose-stack, pg-gvm exits with error message:

/usr/local/bin/start-postgresql: 14: cannot create /etc/postgresql/13/main/pg_hba.conf: Directory nonexistent
/usr/local/bin/start-postgresql: 21: cannot create /etc/postgresql/13/main/pg_hba.conf: Directory nonexistent
[...]

I checked with docker-compose run --rm pg-gvm /bin/bash:

postgres@aea52f002e98:/home/postgres$ grep POSTGRES_VERSION /usr/local/bin/start-postgresql

[ -z "$POSTGRES_VERSION" ] && POSTGRES_VERSION=13
POSTGRES_HBA_CONF="/etc/postgresql/$POSTGRES_VERSION/main/pg_hba.conf"
echo "# see https://www.postgresql.org/docs/$POSTGRES_VERSION/auth-trust.html"
pg_ctlcluster -o "-k /tmp" -o "-c listen_addresses=''" $POSTGRES_VERSION main start
pg_ctlcluster --foreground $POSTGRES_VERSION main stop
pg_ctlcluster -o "-c listen_addresses='*'" --foreground $POSTGRES_VERSION main start

So version says "13" but configuration is there for "15":

postgres@49335f854b28:/home/postgres$ ls /etc/postgresql/

15

and db files are still version 13:
postgres@49335f854b28:/home/postgres$ ls -l /var/lib/postgresql

total 8
drwxr-xr-x 3 postgres postgres 4096 Aug 23 2023 13

Expected Behavior

Start pg-gvm and keep running

Steps To Reproduce

No response

Operating System

docker(-compose) on "VMware Photon OS 5.0"

Version

No response

Anything else?

As a workaround I added the the PG version as environment variable in the docker-compose.yml and copied the /var/lib/postgresql/13 folder inside the volume into /var/lib/postgresql/13.

environment:
  - POSTGRES_VERSION=15

but, as expected, this lead to

2025-08-12 14:49:27.140 CEST [23] FATAL: database files are incompatible with server
2025-08-12 14:49:27.140 CEST [23] DETAIL: The data directory was initialized by PostgreSQL version 13, which is not compatible with this version 15.13 (Debian 15.13-0+deb12u1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions