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

Invalid database name #230

Closed
2 tasks done
jawira opened this issue Mar 9, 2024 · 1 comment
Closed
2 tasks done

Invalid database name #230

jawira opened this issue Mar 9, 2024 · 1 comment
Assignees
Labels
bug Something is broken.

Comments

@jawira
Copy link

jawira commented Mar 9, 2024

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

  • I've read and searched the documentation.
  • I've searched for similar filed issues in this repository.

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

@nijel nijel self-assigned this Mar 11, 2024
@nijel nijel added the bug Something is broken. label Mar 11, 2024
nijel added a commit to WeblateOrg/weblate that referenced this issue Mar 11, 2024
I'm not sure if POSTGRES_DATABASE ever worked as described.

See WeblateOrg/docker-compose#230
nijel added a commit to WeblateOrg/docker that referenced this issue Mar 11, 2024
I'm not sure if POSTGRES_DATABASE ever worked as described.

See WeblateOrg/docker-compose#230
@nijel nijel closed this as completed in 05caf5f Mar 11, 2024
Copy link

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

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

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

No branches or pull requests

2 participants