CE pg-gvm container - PostgreSQL version mismatch after image update

Hi!

After updating our community edition containers I am unable to start the whole stack, because the pg-gvm Container brings the following error messages:

pg-gvm-1 | ERROR: existing data is for PostgreSQL 13 but installed version is 17
pg-gvm-1 | ERROR: please update your compose file for a postgres database migration or download the newest version from https://greenbone.github.io/docs/latest/_static/docker-compose.yml
pg-gvm-1 exited with code 1 (restarting)

I don’t really know how to solve the problem. Is there a decent Docker image tag list besides ‘latest’ so that I can return to an older PG image somehow?

And how do I upgrade the PG DB via Docker? I only found info regarding pg cluster, but it does not seem to fit for Docker, at least I don’t quite understand how…

Regards,

Holger

Hi, did you read the error message?

Yes, otherwise I would not have asked. Did you read my question?

The problem is simple: I updated the images last week, restarted the stack, everything was fine. I updated the stack today, now I have those messages:

The relevant part of my docker-compose.yml file:

pg-gvm:
image: registry.community.greenbone.net/community/pg-gvm:stable
restart: on-failure
volumes:

  • psql_data_vol:/var/lib/postgresql
  • psql_socket_vol:/var/run/postgresql

You see, I used stock images!

→ So why should I have expected the Postgres version to change?
→ How shall I deal with it?
→ Why doesn’t the PG image handle DB upgrades automatically?

And IF I am ought to handle it myself, then please tell me how I can temporarily switch back to a working PG image to care for an update?

please update your compose file for a postgres database migration or download the newest version from https://greenbone.github.io/docs/latest/_static/docker-compose.yml

The error message says you need to update your compose file or download the latest one.
So what’s missing from the error message? What do you need? How can we improve it?

Because our container images are based on some distribution image. In this case Debian. From time to time Debian creates new releases. These new releases come with a new PostgreSQL major version. Every new PostgreSQL major version requires a complete database migration. At some time old releases don’t get any updates anymore. Thus an update of the base container image and therefore the PostgreSQL version is inevitable.

If you don’t want this you can use the pg-gvm:22.6.10 container image in your compose file. This container image is still based on Debian Bullseye (currently oldoldstable) and comes with PostgreSQL 13. But you still need to update your compose file.

Because of separation of concerns. We introduced a new separated container image handling the PostgreSQL database upgrades. This change is mentioned in our docs too.

From time to time it might be necessary to update your compose file because some settings or services might change. This is also stated at Greenbone Community Containers - Greenbone Community Documentation

It’s mentioned in the error message. You need to update your compose file.

1 Like

AHH! Many thanks! That was what I’ve been looking for. I did not notice the migrator container, only the information about migration on a bare metal installation.

But the second information regarding the older image tag did the trick, so I have time to figure out, when to start the migration and get the rest up and running for now.

Is there a tag list anywhere so that one can figure this out on its own?

A post was split to a new topic: How do I migrate the database?