matrix-docker-ansible-deploy
matrix-docker-ansible-deploy copied to clipboard
TASK [galaxy/postgres : Execute Postgres managed database initialization SQL file for synapse] : 'psql: error: connection to server at "matrix-postgres" (192.168.64.2), port 5432 failed: FATAL: password authentication failed for user "matrix"'
Describe the bug While installing for the first time, "Postgres managed database initialization SQL file for synapse" apparently fails.
To Reproduce
My vars.yml file looks like this:
---
# The bare domain name which represents your Matrix identity.
# Matrix user ids for your server will be of the form (`@user:<matrix-domain>`).
#
# Note: this playbook does not touch the server referenced here.
# Installation happens on another server ("matrix.<matrix-domain>").
#
# If you've deployed using the wrong domain, you'll have to run the Uninstalling step,
# because you can't change the Domain after deployment.
#
# Example value: example.com
matrix_domain: X.com
# The Matrix homeserver software to install.
# See:
# - `roles/custom/matrix-base/defaults/main.yml` for valid options
# - the `docs/configuring-playbook-IMPLEMENTATION_NAME.md` documentation page, if one is available for your implementation choice
matrix_homeserver_implementation: synapse
# A secret used as a base, for generating various other secrets.
# You can put any string here, but generating a strong one is preferred (e.g. `pwgen -s 64 1`).
matrix_homeserver_generic_secret_key: 'X'
# By default, the playbook manages its own Traefik (https://doc.traefik.io/traefik/) reverse-proxy server.
# It will retrieve SSL certificates for you on-demand and forward requests to all other components.
# For alternatives, see `docs/configuring-playbook-own-webserver.md`.
matrix_playbook_reverse_proxy_type: playbook-managed-traefik
# This is something which is provided to Let's Encrypt when retrieving SSL certificates for domains.
#
# In case SSL renewal fails at some point, you'll also get an email notification there.
#
# If you decide to use another method for managing SSL certificates (different than the default Let's Encrypt),
# you won't be required to define this variable (see `docs/configuring-playbook-ssl-certificates.md`).
#
# Example value: [email protected]
traefik_config_certificatesResolvers_acme_email: '[email protected]'
# A Postgres password to use for the superuser Postgres user (called `matrix` by default).
#
# The playbook creates additional Postgres users and databases (one for each enabled service)
# using this superuser account.
postgres_connection_password: 'X'
matrix_static_files_container_labels_base_domain_enabled: true
# By default, we configure Coturn's external IP address using the value specified for `ansible_host` in your `inventory/hosts` file.
# If this value is an external IP address, you can skip this section.
#
# If `ansible_host` is not the server's external IP address, you have 2 choices:
# 1. Uncomment the line below, to allow IP address auto-detection to happen (more on this below)
# 2. Uncomment and adjust the line below to specify an IP address manually
#
# By default, auto-detection will be attempted using the `https://ifconfig.co/json` API.
# Default values for this are specified in `matrix_coturn_turn_external_ip_address_auto_detection_*` variables in the Coturn role
# (see `roles/custom/matrix-coturn/defaults/main.yml`).
#
# If your server has multiple IP addresses, you may define them in another variable which allows a list of addresses.
# Example: `matrix_coturn_turn_external_ip_addresses: ['1.2.3.4', '4.5.6.7']`
#
# matrix_coturn_turn_external_ip_address: ''
To reproduce : Install Debian 12 on x64 platform with kernel version 6.1.0-25-amd64. Install docker Clone the repo Populate vars.yml and hosts with basic configuration. Start the installation with "ansible-playbook -i inventory/hosts setup.yml --tags=install-all,ensure-matrix-users-created,start"
Expected behavior Matrix being installed without error. No postgres connection/password errors
Matrix Server:
- OS: Debian 12
- Architecture amd64
Additional context Here is the error output
TASK [galaxy/postgres : Execute Postgres managed database initialization SQL file for synapse] *************************
fatal: [X.com]: FAILED! => changed=true
cmd:
- /usr/bin/env
- docker
- run
- --rm
- --user=999:1001
- --cap-drop=ALL
- --env-file=/matrix/postgres/env-postgres-psql
- --network=matrix-postgres
- --mount
- type=bind,src=/tmp/matrix-postgres-init-managed-db-user-and-role.sql,dst=/matrix-postgres-init-managed-db-user-and-role.sql,ro
- --entrypoint=/bin/sh
- docker.io/postgres:16.4-alpine
- -c
- psql -h matrix-postgres --file=/matrix-postgres-init-managed-db-user-and-role.sql
delta: '0:00:00.800244'
end: '2024-09-30 11:29:05.581487'
msg: non-zero return code
rc: 2
start: '2024-09-30 11:29:04.781243'
stderr: 'psql: error: connection to server at "matrix-postgres" (192.168.64.2), port 5432 failed: FATAL: password authentication failed for user "matrix"'
stderr_lines: <omitted>
stdout: ''
stdout_lines: <omitted>