WeblateOrg / docker-compose

Docker compose for Weblate
https://docs.weblate.org/en/latest/admin/deployments.html#docker
GNU General Public License v3.0
77 stars 64 forks source link

PostgreSQL update causing issues #216

Closed ppfeufer closed 11 months ago

ppfeufer commented 11 months ago

Describe the issue

Docker install of Weblate.

After a git pull of this repo on the machine my instance is hosted it pukked in this update (https://github.com/WeblateOrg/docker-compose/commit/0041e3af53c085432c97aeb2c4efd97cfc83c755), which updates PostgreSQL from version 15 to 16.

Now after restarting docker, I'm facing this error:

database_1  | 2023-10-21 09:07:54.924 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 15, which is not compatible with this version 16.0.

I already tried

Steps to reproduce the behavior

Expected behavior

Weblate is to be starting and PostgreSQL is being migrated to the new version without throwing a tantrum.

Screenshots

No response

Exception traceback

» docker-compose logs -f
Attaching to weblate, weblate_database, weblate_cache
weblate     | Starting...
cache_1     | 1:C 21 Oct 2023 09:58:42.793 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
cache_1     | 1:C 21 Oct 2023 09:58:42.798 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
cache_1     | 1:C 21 Oct 2023 09:58:42.798 * Redis version=7.2.2, bits=64, commit=00000000, modified=0, pid=1, just started
cache_1     | 1:C 21 Oct 2023 09:58:42.798 * Configuration loaded
cache_1     | 1:M 21 Oct 2023 09:58:42.800 * monotonic clock: POSIX clock_gettime
cache_1     | 1:M 21 Oct 2023 09:58:42.803 * Running mode=standalone, port=6379.
cache_1     | 1:M 21 Oct 2023 09:58:42.804 * Server initialized
cache_1     | 1:M 21 Oct 2023 09:58:42.804 * Loading RDB produced by version 7.2.2
cache_1     | 1:M 21 Oct 2023 09:58:42.804 * RDB age 15 seconds
cache_1     | 1:M 21 Oct 2023 09:58:42.804 * RDB memory usage when created 1.80 Mb
cache_1     | 1:M 21 Oct 2023 09:58:42.807 * Done loading RDB, keys loaded: 348, keys expired: 0.
cache_1     | 1:M 21 Oct 2023 09:58:42.808 * DB loaded from disk: 0.004 seconds
cache_1     | 1:M 21 Oct 2023 09:58:42.808 * Ready to accept connections tcp
database_1  |
database_1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
database_1  |
database_1  | 2023-10-21 09:58:42.927 UTC [1] FATAL:  database files are incompatible with server
database_1  | 2023-10-21 09:58:42.927 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 15, which is not compatible with this version 16.0.
database_1  |
database_1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
database_1  |
database_1  | 2023-10-21 09:58:44.184 UTC [1] FATAL:  database files are incompatible with server
database_1  | 2023-10-21 09:58:44.184 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 15, which is not compatible with this version 16.0.
database_1  |
database_1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
database_1  |
database_1  | 2023-10-21 09:58:45.393 UTC [1] FATAL:  database files are incompatible with server
database_1  | 2023-10-21 09:58:45.393 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 15, which is not compatible with this version 16.0.
database_1  |
database_1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
database_1  |
database_1  | 2023-10-21 09:58:46.971 UTC [1] FATAL:  database files are incompatible with server
database_1  | 2023-10-21 09:58:46.971 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 15, which is not compatible with this version 16.0.
weblate_database exited with code 1
database_1  |
database_1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
database_1  |
database_1  | 2023-10-21 09:58:51.478 UTC [1] FATAL:  database files are incompatible with server
database_1  | 2023-10-21 09:58:51.478 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 15, which is not compatible with this version 16.0.
database_1  |
database_1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
database_1  |
database_1  | 2023-10-21 09:58:55.665 UTC [1] FATAL:  database files are incompatible with server
database_1  | 2023-10-21 09:58:55.665 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 15, which is not compatible with this version 16.0.
weblate_database exited with code 1
weblate     | System check identified no issues (1 silenced).
database_1  |
database_1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
database_1  |
database_1  | 2023-10-21 09:59:03.107 UTC [1] FATAL:  database files are incompatible with server
database_1  | 2023-10-21 09:59:03.107 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 15, which is not compatible with this version 16.0.
weblate_database exited with code 1
weblate     | psql: error: could not translate host name "database" to address: Name or service not known
database_1  |
database_1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
database_1  |
database_1  | 2023-10-21 09:59:17.016 UTC [1] FATAL:  database files are incompatible with server
database_1  | 2023-10-21 09:59:17.016 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 15, which is not compatible with this version 16.0.
weblate_database exited with code 1
weblate     | System check identified no issues (1 silenced).
database_1  |
database_1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
database_1  |
database_1  | 2023-10-21 09:59:43.639 UTC [1] FATAL:  database files are incompatible with server
database_1  | 2023-10-21 09:59:43.639 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 15, which is not compatible with this version 16.0.
weblate_database exited with code 1
weblate     | psql: error: could not translate host name "database" to address: Name or service not known
weblate exited with code 2
weblate     | System check identified no issues (1 silenced).
weblate     | psql: error: could not translate host name "database" to address: Name or service not known
weblate exited with code 2
weblate     | System check identified no issues (1 silenced).
database_1  |
database_1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
database_1  |
database_1  | 2023-10-21 10:00:35.855 UTC [1] FATAL:  database files are incompatible with server
database_1  | 2023-10-21 10:00:35.855 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 15, which is not compatible with this version 16.0.
weblate_database exited with code 1
weblate     | psql: error: could not translate host name "database" to address: Name or service not known
weblate exited with code 2
weblate     | System check identified no issues (1 silenced).
weblate     | psql: error: could not translate host name "database" to address: Name or service not known
weblate exited with code 2


### Additional context

Overriding the database image in `docker-compose.override.yml` and set it to `image: postgres:15-alpine` fixes it, for the time being …
nijel commented 11 months ago

See https://docs.weblate.org/en/latest/admin/install/docker.html#upgrading-postgresql-container

github-actions[bot] commented 11 months ago

This issue has been marked as a question by a Weblate team member. Why? Because it belongs more to the professional Weblate Care or community Discussions than here. We strive to answer these reasonably fast here, too, but purchasing the support subscription is more responsible and faster for your business. And it makes Weblate stronger as well. Thanks!

In case your question is already answered, making a donation is the right way to say thank you!

ppfeufer commented 11 months ago

Ah, thank you so much! Worked like a charm.

A quick hint in the changelog would be nice for future updates like this. :-)

PS.: In the docu the DB volume is named weblate-docker_postgres-data but it's weblate_postgres-data.

image

image

github-actions[bot] commented 11 months ago

The issue you have reported is now resolved. If you don’t feel it’s right, please follow its labels to get a clue for further steps.

nijel commented 11 months ago

The volume name contains name of the directory where docker-compose files are. You've stored that in weblate, while the whole documentation uses weblate-docker here.

ppfeufer commented 11 months ago

Ah I see, thanks for the clarification.