spantaleev / matrix-docker-ansible-deploy

🐳 Matrix (An open network for secure, decentralized communication) server setup using Ansible and Docker
GNU Affero General Public License v3.0
4.72k stars 1.02k forks source link

Installation fails because of bridge services error during reinstallation #1966

Closed yed01 closed 2 years ago

yed01 commented 2 years ago

Playbook Configuration:

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: server.com

# The Matrix homeserver software to install.
# See `roles/matrix-base/defaults/main.yml` for valid options.
matrix_homeserver_implementation: dendrite

# 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: 'redacted'

# 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: someone@example.com
matrix_ssl_lets_encrypt_support_email: 'redacted'

# 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.
matrix_postgres_connection_password: 'redacted'

matrix_jitsi_enabled: true

# Run `bash inventory/scripts/jitsi-generate-passwords.sh` to generate these passwords,
# or define your own strong passwords manually.
matrix_jitsi_jicofo_auth_password: redacted
matrix_jitsi_jvb_auth_password: redacted
matrix_jitsi_jibri_recorder_password: redacted
matrix_jitsi_jibri_xmpp_password: redacted

matrix_jitsi_web_custom_config_extension: |
  config.enableLayerSuspension = true;

  config.disableAudioLevels = true;

  // Limit the number of video feeds forwarded to each client
  config.channelLastN = 4;

matrix_jitsi_web_config_resolution_width_ideal_and_max: 1024
matrix_jitsi_web_config_resolution_height_ideal_and_max: 576

matrix_prometheus_enabled: true

# You can remove this, if unnecessary.
matrix_prometheus_node_exporter_enabled: true

# You can remove this, if unnecessary.
matrix_prometheus_postgres_exporter_enabled: true

matrix_nginx_proxy_enabled: false

matrix_nginx_proxy_base_domain_serving_enabled: true

matrix_postgres_process_extra_arguments: [
  "-c max_connections=600",
  "-c shared_buffers=6GB",
  "-c effective_cache_size=18GB",
  "-c maintenance_work_mem=1536MB",
  "-c checkpoint_completion_target=0.9",
  "-c wal_buffers=16MB",
  "-c default_statistics_target=100",
  "-c random_page_cost=4",
  "-c effective_io_concurrency=2",
  "-c work_mem=1572kB",
  "-c min_wal_size=1GB",
  "-c max_wal_size=4GB",
  "-c max_worker_processes=4",
  "-c max_parallel_workers_per_gather=2",
  "-c max_parallel_workers=4",
  "-c max_parallel_maintenance_workers=2",
]

#matrix_dimension_access_token: redacted

matrix_appservice_discord_enabled: true
matrix_appservice_discord_client_id: redacted
matrix_appservice_discord_bot_token: redacted

matrix_mautrix_telegram_enabled: true
matrix_mautrix_telegram_api_id: redacted
matrix_mautrix_telegram_api_hash: redacted

matrix_mautrix_whatsapp_enabled: true

matrix_mautrix_twitter_enabled: true

matrix_mautrix_signal_enabled: true

matrix_heisenbridge_enabled: true

# Enabling it is the only required setting
matrix_ntfy_enabled: true

# Some other options
matrix_server_fqn_ntfy: "ntfy.server.com"
matrix_ntfy_configuration_extension_yaml: |
  log_level: DEBUG

Matrix Server:

Problem description:

I wanted to change from synapse to dendrite so I uninstalled using the /usr/local/bin/matrix-remove-all script. The reinstallation fails because all of the bridge-services fail to start correctly.

Here is an example, the other services are the same:

matrix-mautrix-telegram.service - Matrix Mautrix Telegram bridge
     Loaded: loaded (/etc/systemd/system/matrix-mautrix-telegram.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Wed 2022-07-20 21:20:59 UTC; 2s ago
    Process: 2246119 ExecStartPre=/usr/bin/env sh -c /usr/bin/env docker kill matrix-mautrix-telegram 2>/dev/null || true (code=exited, status=0/SUCCESS)
    Process: 2246131 ExecStartPre=/usr/bin/env sh -c /usr/bin/env docker rm matrix-mautrix-telegram 2>/dev/null || true (code=exited, status=0/SUCCESS)
    Process: 2246143 ExecStartPre=/usr/bin/env sleep 5 (code=exited, status=0/SUCCESS)
    Process: 2246284 ExecStart=/usr/bin/env docker run --rm --name matrix-mautrix-telegram --log-driver=none --user=1001:1001 --cap-drop=ALL --network=matrix -p 127.0.0.1:9006:8080 -v /matrix/mautrix-telegram/config:/config:z -v /matrix>
   Main PID: 2246284 (code=exited, status=16)
        CPU: 95ms
failed: [matrix.redacted] (item=matrix-mautrix-telegram.service) => changed=false 
  ansible_loop_var: item
  item: matrix-mautrix-telegram.service
  msg: matrix-mautrix-telegram.service was not detected to be running. It's possible that there's a configuration problem or another service on your server interferes with it (uses the same ports, etc.). Try running `systemctl status matrix-mautrix-telegram.service` and `journalctl -fu matrix-mautrix-telegram.service` on the server to investigate. If you're on a slow or overloaded server, it may be that services take a longer time to start and that this error is a false-positive. You can consider raising the value of the `matrix_common_after_systemd_service_start_wait_for_timeout_seconds` variable. See `roles/matrix-common-after/defaults/main.yml` for more details about that.

I tried a server reboot but the problem persists. When removing the bridges from the vars file the installation completes without error. Is there anything else I have to manually remove on my server before I can start the reinstallation?

aaronraimist commented 2 years ago

Check the logs for those bridges and then search for similar errors in the repositories for those bridges and on the Dendrite repo. Application service support is incomplete in Dendrite as far as I know so it's quite possible those bridges don't currently work with Dendrite.

yed01 commented 2 years ago

I tried a reinstallation with Synapse and this worked. So the problem seems to be Dendrite, staying on Synapse for now.