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

Upgrading Postgres vom 15.5 to 16.1 fails on arm64 #3106

Open
whowantsmybigdata opened this issue Jan 16, 2024 · 4 comments
Open

Upgrading Postgres vom 15.5 to 16.1 fails on arm64 #3106

whowantsmybigdata opened this issue Jan 16, 2024 · 4 comments

Comments

@whowantsmybigdata
Copy link

Configuration:

  • Only postgres-specific part in the vars.yml is regarding the devture_postgres_connection_password:
  • OS: Raspbian Bookworm
  • Architecture: arm64 (matrix_architecture: arm64 in vars.yml)

Problem:

I want to upgrade from postgres 15.5 to 16.1 with just run-tags upgrade-postgres but get
stderr: 'psql: error: could not translate host name "matrix-postgres" to address: Name does not resolve'
while TASK [galaxy/postgres : Perform Postgres database import

systemctl status matrix-postgres is giving me:

Jan 16 22:16:12 Pi4 matrix-postgres[180342]: chmod: /var/run/postgresql: Operation not permitted
Jan 16 22:16:12 Pi4 matrix-postgres[180342]: PostgreSQL Database directory appears to contain a database; Skipping initialization
Jan 16 22:16:13 Pi4 matrix-postgres[180342]: 2024-01-16 21:16:13.421 UTC [1] FATAL:  database files are incompatible with server
Jan 16 22:16:13 Pi4 matrix-postgres[180342]: 2024-01-16 21:16:13.421 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 15, which is not compatible with this version 16.1.

Tried restarting matrix-postgres.service or rebooting the whole system and trigger the import manually but getting the same error.
Only way getting back to a working setup again is to remove postgres data and move the backup-data back in place followed by a --tags=setup-postgres

Appreciate any hints to solve this!

@spantaleev
Copy link
Owner

Postgres changed container networks (matrix -> matrix-postgres) recently, so that may have something to do with your issue.

Make sure you've upgraded your setup (just setup-all) first, before trying to perform an upgrade (upgrade-postgres).

In any case, I believe the code should handle it fine anyway, so maybe the problem lies elsewhere.

@whowantsmybigdata
Copy link
Author

thanks for the fast reply,
I already did upgrade and setup everthing and just did a docker inspect matrix-postgres which shows the container is already using matrix-postgres as network.

@spantaleev
Copy link
Owner

In that case, during the upgrade, the newly-created Postgres instance is probably too slow to start and at the time we try to import to it, it's not available yet.

You can add an extra variable to the upgrade procedure to add a larger delay. It's 15 seconds by default.

Try adding --extra-vars postgres_start_wait_time=30 at the end of your --tags=setup-postgres command.


It may be something else too, but.. that's my next guess as to what's wrong.

@whowantsmybigdata
Copy link
Author

unfortunately it didn't work as well...
the problem seems, postgres isn't able to start at all before importing even if I do systemctl restart matrix-postgres manually. It's saying it can't start because the database-data was initialized by postgres 15 and so can't be used to start postgres 16.
I thought thats exactly why postgres-database is moved (to backup-location) before upgrading and then it should be imported back. Somehow there seems to be some data left over?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants