WeblateOrg / docker-compose

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

Invalid database name #230

Closed jawira closed 8 months ago

jawira commented 8 months ago

Describe the issue

When using custom configuration for Postgres (database, user and password), Weblate container will stop because it will not be able to connect to database.

For example if I use the following values in ./environment, then Weblate container will never start properly:

POSTGRES_DATABASE=weblate
POSTGRES_USER=wluser
POSTGRES_PASSWORD=wlpass

The reason is that in Postgres 16 the default environment variable for declaring a database is POSTGRES_DB and not POSTGRES_DATABASE.

According to Postgres documentation:

POSTGRES_DB This optional environment variable can be used to define a different name for the default database that is created when the image is first started. If it is not specified, then the value of POSTGRES_USER will be used.

The default ./environment values will work because you are using the same value for database, username and password.

I already tried

Steps to reproduce the behavior

  1. Clone the weblate-docker repo.
  2. Edit ./environment and use different values for POSTGRES_DATABASE, POSTGRES_USER and POSTGRES_PASSWORD.
  3. Execute docker compose up.
  4. You will see Weblate will never start because it can't establish a connection with database due to unknown database.

Expected behavior

Weblate container must start properly.

Screenshots

As you can see Postgress creates database wluser instead of weblate because POSTGRES_DB is not used.

image

Exception traceback

No response

Additional context

No response

github-actions[bot] commented 8 months ago

Thank you for your report; the issue you have reported has just been fixed.