Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Postgres db hardcoded to version 14 in docker compose instructions however current version is 17 ( in latest tag ) #601

Closed
inuonly opened this issue Sep 27, 2024 · 3 comments
Labels
question Further information is requested

Comments

@inuonly
Copy link

inuonly commented Sep 27, 2024

Describe the bug
The official instrcutions provided at at https://docs.invidious.io/installation/#docker-compose-method-production binds postgres to version 14
image

however the latest tag in postgres instance is now 17 version.

At the time of initialization of container with latest tag it works fine but every time new version is released in postgres it breaks the containers and it throws error as follows.

2024-09-27 05:59:06.107 UTC [1] FATAL:  database files are incompatible with server

2024-09-27 05:59:06.107 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 16, which is not compatible with this version 17.0 (Debian 17.0-1.pgdg120+1).

Just numbers change but error is always the same.

Can we solve this in a way that we do not need to recreate database or import again our subscriptions.

Purpose being : We use one postgres db as well as one mariadb etc for all containers instead of running all these separate instances and use watchtower service ( comon way to update container automation) . So using latest tag (tagless defaults to latest and thus keeping database instance updated). When you run around 60 odd containers you cannot manually fire comands to update them manually every time new image comes so watchtower is pretty much standard approach to solve this issue.

Steps to Reproduce

  1. use official docker compose file to use latest tag or no tag to default to updated version of postgress. Currently docs refer 14 while current latest update from postgress official image is 17.
  2. Check errors in portainer / watchtower / docker logs to see the same error.

Logs

2024-09-27 05:59:06.107 UTC [1] FATAL:  database files are incompatible with server

2024-09-27 05:59:06.107 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 16, which is not compatible with this version 17.0 (Debian 17.0-1.pgdg120+1).

Screenshots
image
This one show that the image is outdated.

image
If we pull the default image it gets postgres version 17.

We followed this issue #2933 but it was closed and the instruction in the replies
iv-org/invidious#2933 (comment)
was not functional as the link https://docs.invidious.io/Installation.md given in response does not open.

Additional context
Watchtower -
image

Error screen -
image

Issue 2933 followed replies
image

@inuonly inuonly added the bug Something isn't working label Sep 27, 2024
@samson8t
Copy link

samson8t commented Sep 27, 2024

I've got the same problem.
Planka-DB no longer starts.

2024/09/27 17:37:00 stderr 2024-09-27 15:37:00.846 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 16, which is not compatible with this version 17.0 (Debian 17.0-1.pgdg120+1).
2024/09/27 17:37:00 stderr 2024-09-27 15:37:00.846 UTC [1] FATAL: database files are incompatible with server

I absolutely need to get it running again.
Are there any solutions or workarounds?

@Fijxu
Copy link
Contributor

Fijxu commented Sep 27, 2024

Yes, you need to migrate the DB on every major version. You don't really need to use the latest tag so you can just stick with version 16 unless you really need to use a feature introduced in a new PostgreSQL version.

https://wiki.archlinux.org/title/PostgreSQL#Upgrading_PostgreSQL
https://www.postgresql.org/docs/current/upgrading.html

If you know what are you doing and how to do it, it should be fairly easy

@unixfox unixfox transferred this issue from iv-org/invidious Sep 28, 2024
@unixfox unixfox changed the title [Bug] Postgres db hardcoded to version 14 in docker compose instructions however current version is 17 ( in latest tag ) [Question] Postgres db hardcoded to version 14 in docker compose instructions however current version is 17 ( in latest tag ) Sep 28, 2024
@unixfox unixfox added question Further information is requested and removed bug Something isn't working labels Sep 28, 2024
@unixfox
Copy link
Member

unixfox commented Sep 28, 2024

There is hardly any point in using a more recent version than 14, we are not that version dependent. Invidious works even with postgresql 10

Don't set the docker tag to latest on postgresql, that's a very bad idea which can lead to unexpected consequences. Your best bet is to set it to a major version tag without the minor number in it. Like postgres:14. If you do that you will receive the security updates when needed.

See https://www.postgresql.org/support/versioning/ for the activate versions being supported.

@unixfox unixfox closed this as completed Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants