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.74k stars 1.02k forks source link

Cannot setup, The conditional check 'devture_postgres_managed_databases|length > 0' failed. #3400

Closed kuba-orlik closed 2 months ago

kuba-orlik commented 2 months ago

Describe the bug I ran git pull and just setup-all --ask-vault-pass, now my matirx instance is down and doesn't start.

To Reproduce My vars.yml file looks like this (I've redacted the vault-encrypted passwords):

---
matrix_domain: matriks.chat
matrix_homeserver_implementation: synapse
matrix_homeserver_generic_secret_key: !vault |
  $ANSIBLE_VAULT;1.1;AES256
devture_traefik_config_certificatesResolvers_acme_email: "kontakt@internet-czas-dzialac.pl"

devture_postgres_connection_password: "matrix"
matrix_static_files_container_labels_base_domain_enabled: true # so the main domain is proxied and uses .well-known kept within the docker. If you disable that, then you ned to reconfigure the well-known settings: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-playbook-base-domain-serving.md
matrix_synapse_admin_enabled: true
matrix_dimension_enabled: true
matrix_dimension_admins:
  - "@kuba:{{ matrix_domain }}"
matrix_dimension_access_token: !vault |
  $ANSIBLE_VAULT;1.1;AES256

prometheus_enabled: true

prometheus_node_exporter_enabled: true

prometheus_postgres_exporter_enabled: true

grafana_enabled: true

grafana_anonymous_access: false

grafana_default_admin_user: "admin"

grafana_default_admin_password: !vault |
  $ANSIBLE_VAULT;1.1;AES256
matrix_synapse_workers_enabled: true
matrix_client_element_themes_enabled: true
matrix_client_hydrogen_enabled: true
matrix_server_fqn_hydrogen: "lite.{{ matrix_domain }}"
matrix_client_cinny_enabled: true
matrix_server_fqn_cinny: "lite2.{{ matrix_domain }}"
matrix_ma1sd_enabled: true

devture_postgres_process_extra_arguments: ["-c 'max_connections=200'"]

matrix_mautrix_telegram_enabled: true
matrix_mautrix_telegram_api_id: 1340141
matrix_mautrix_telegram_api_hash: !vault |
  $ANSIBLE_VAULT;1.1;AES256

# to enable double-puppeting
matrix_synapse_ext_password_provider_shared_secret_auth_enabled: true
matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret: !vault |
  $ANSIBLE_VAULT;1.1;AES256

# to enable relay bot
matrix_mautrix_telegram_bot_token: !vault |
  $ANSIBLE_VAULT;1.1;AES256

matrix_mautrix_telegram_configuration_extension_yaml: |
  bridge:
    permissions:
      '*': relaybot
      '@kuba:matriks.chat': admin

devture_systemd_service_manager_up_verification_delay_seconds: 30

matrix_playbook_reverse_proxy_type: "playbook-managed-traefik"

# Signal bridge
matrix_mautrix_signal_enabled: true
matrix_mautrix_signal_relaybot_enabled: true
matrix_mautrix_signal_configuration_extension_yaml: |
  bridge:
    permissions:
      '@kuba:matriks.chat': admin

# Whatsapp bridge
matrix_mautrix_whatsapp_enabled: true
matrix_mautrix_whatsapp_bridge_relay_enabled: true

# Discord bridge
matrix_appservice_discord_enabled: true
matrix_appservice_discord_client_id: "redacted"
matrix_appservice_discord_bot_token: "redacted"
matrix_appservice_discord_bridge_enableSelfServiceBridging: true

backup_borg_enabled: true
backup_borg_location_repositories:
  - ssh://redacted
backup_borg_storage_encryption_passphrase: !vault |
  $ANSIBLE_VAULT;1.1;AES256

backup_borg_ssh_key_private: !vault |
  $ANSIBLE_VAULT;1.1;AES256

# to make Borg container see the rpi3
backup_borg_container_extra_arguments: ["--volume", "/etc/hosts:/etc/hosts"]

matrix_sliding_sync_enabled: true

ntfy_enabled: true

ntfy_web_root: app # defaults to "disable"

matrix_static_files_file_index_html_enabled: false

matrix_mautrix_instagram_enabled: true

matrix_admin: "@kuba:{{ matrix_domain }}"

matrix_beeper_linkedin_enabled: true
matrix_beeper_linkedin_configuration_extension_yaml: |
  bridge:
    permissions:
      '@kuba:{{ matrix_domain }}': admin

matrix_mautrix_wsproxy_enabled: true

matrix_mautrix_androidsms_appservice_token: !vault |
  $ANSIBLE_VAULT;1.1;AES256

matrix_mautrix_androidsms_homeserver_token: !vault |
  $ANSIBLE_VAULT;1.1;AES256

matrix_mautrix_wsproxy_syncproxy_shared_secret: !vault |
  $ANSIBLE_VAULT;1.1;AES256

matrix_mautrix_imessage_appservice_token: !vault |
  $ANSIBLE_VAULT;1.1;AES256

matrix_mautrix_imessage_homeserver_token: !vault |
  $ANSIBLE_VAULT;1.1;AES256

Expected behavior It should start the service

Matrix Server:

Ansible: If your problem appears to be with Ansible, tell us:

Additional context

Logs:

TASK [galaxy/postgres : Ensure managed Postgres databases prepared] **************************************************************************************************************************
fatal: [matrix.matriks.chat]: FAILED! => 
  msg: |-
    The conditional check 'devture_postgres_managed_databases|length > 0' failed. The error was: An unhandled exception occurred while templating '{{ devture_postgres_managed_databases_auto + devture_postgres_managed_databases_additional }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while templating '{{
      ([{
        'name': matrix_synapse_database_database,
        'username': matrix_synapse_database_user,
        'password': matrix_synapse_database_password,
      }] if (matrix_synapse_enabled and matrix_synapse_database_host == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_dendrite_federation_api_database,
        'username': matrix_dendrite_database_user,
        'password': matrix_dendrite_database_password,
      },{
        'name': matrix_dendrite_key_server_database,
        'username': matrix_dendrite_database_user,
        'password': matrix_dendrite_database_password,
      },{
        'name': matrix_dendrite_media_api_database,
        'username': matrix_dendrite_database_user,
        'password': matrix_dendrite_database_password,
      },{
        'name': matrix_dendrite_room_database,
        'username': matrix_dendrite_database_user,
        'password': matrix_dendrite_database_password,
      },{
        'name': matrix_dendrite_sync_api_database,
        'username': matrix_dendrite_database_user,
        'password': matrix_dendrite_database_password,
      },{
        'name': matrix_dendrite_user_api_database,
        'username': matrix_dendrite_database_user,
        'password': matrix_dendrite_database_password,
      },{
        'name': matrix_dendrite_relay_api_database,
        'username': matrix_dendrite_database_user,
        'password': matrix_dendrite_database_password,
      },{
        'name': matrix_dendrite_push_server_database,
        'username': matrix_dendrite_database_user,
        'password': matrix_dendrite_database_password,
      },{
        'name': matrix_dendrite_mscs_database,
        'username': matrix_dendrite_database_user,
        'password': matrix_dendrite_database_password,
      }] if (matrix_dendrite_enabled and matrix_dendrite_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_sliding_sync_database_name,
        'username': matrix_sliding_sync_database_username,
        'password': matrix_sliding_sync_database_password,
      }] if (matrix_sliding_sync_enabled) else [])
      +
      ([{
        'name': matrix_ma1sd_database_name,
        'username': matrix_ma1sd_database_username,
        'password': matrix_ma1sd_database_password,
      }] if (matrix_ma1sd_enabled and matrix_ma1sd_database_engine == 'postgres' and matrix_ma1sd_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_bot_matrix_reminder_bot_database_name,
        'username': matrix_bot_matrix_reminder_bot_database_username,
        'password': matrix_bot_matrix_reminder_bot_database_password,
      }] if (matrix_bot_matrix_reminder_bot_enabled and matrix_bot_matrix_reminder_bot_database_engine == 'postgres' and matrix_bot_matrix_reminder_bot_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_bot_honoroit_database_name,
        'username': matrix_bot_honoroit_database_username,
        'password': matrix_bot_honoroit_database_password,
      }] if (matrix_bot_honoroit_enabled and matrix_bot_honoroit_database_engine == 'postgres' and matrix_bot_honoroit_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_bot_postmoogle_database_name,
        'username': matrix_bot_postmoogle_database_username,
        'password': matrix_bot_postmoogle_database_password,
      }] if (matrix_bot_postmoogle_enabled and matrix_bot_postmoogle_database_engine == 'postgres' and matrix_bot_postmoogle_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_bot_maubot_database_name,
        'username': matrix_bot_maubot_database_username,
        'password': matrix_bot_maubot_database_password,
      }] if (matrix_bot_maubot_enabled  and matrix_bot_maubot_database_engine == 'postgres' and matrix_bot_maubot_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_bot_buscarron_database_name,
        'username': matrix_bot_buscarron_database_username,
        'password': matrix_bot_buscarron_database_password,
      }] if (matrix_bot_buscarron_enabled and matrix_bot_buscarron_database_engine == 'postgres' and matrix_bot_buscarron_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_registration_database_name,
        'username': matrix_registration_database_username,
        'password': matrix_registration_database_password,
      }] if (matrix_registration_enabled and matrix_registration_database_engine == 'postgres' and matrix_registration_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_appservice_discord_database_name,
        'username': matrix_appservice_discord_database_username,
        'password': matrix_appservice_discord_database_password,
      }] if (matrix_appservice_discord_enabled and matrix_appservice_discord_database_engine == 'postgres' and matrix_appservice_discord_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_appservice_draupnir_for_all_database_name,
        'username': matrix_appservice_draupnir_for_all_database_username,
        'password': matrix_appservice_draupnir_for_all_database_password,
      }] if (matrix_appservice_draupnir_for_all_enabled and matrix_appservice_draupnir_for_all_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_appservice_slack_database_name,
        'username': matrix_appservice_slack_database_username,
        'password': matrix_appservice_slack_database_password,
      }] if (matrix_appservice_slack_enabled and matrix_appservice_slack_database_engine == 'postgres' and matrix_appservice_slack_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_appservice_irc_database_name,
        'username': matrix_appservice_irc_database_username,
        'password': matrix_appservice_irc_database_password,
      }] if (matrix_appservice_irc_enabled and matrix_appservice_irc_database_engine == 'postgres' and matrix_appservice_irc_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_appservice_kakaotalk_database_name,
        'username': matrix_appservice_kakaotalk_database_username,
        'password': matrix_appservice_kakaotalk_database_password,
      }] if (matrix_appservice_kakaotalk_enabled and matrix_appservice_kakaotalk_database_engine == 'postgres' and matrix_appservice_kakaotalk_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_beeper_linkedin_database_name,
        'username': matrix_beeper_linkedin_database_username,
        'password': matrix_beeper_linkedin_database_password,
      }] if (matrix_beeper_linkedin_enabled and matrix_beeper_linkedin_database_engine == 'postgres' and matrix_beeper_linkedin_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_go_skype_bridge_database_name,
        'username': matrix_go_skype_bridge_database_username,
        'password': matrix_go_skype_bridge_database_password,
      }] if (matrix_go_skype_bridge_enabled and matrix_go_skype_bridge_database_engine == 'postgres' and matrix_go_skype_bridge_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_wechat_database_name,
        'username': matrix_wechat_database_username,
        'password': matrix_wechat_database_password,
      }] if (matrix_wechat_enabled and matrix_wechat_database_engine == 'postgres' and matrix_wechat_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_mautrix_facebook_database_name,
        'username': matrix_mautrix_facebook_database_username,
        'password': matrix_mautrix_facebook_database_password,
      }] if (matrix_mautrix_facebook_enabled and matrix_mautrix_facebook_database_engine == 'postgres' and matrix_mautrix_facebook_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_mautrix_hangouts_database_name,
        'username': matrix_mautrix_hangouts_database_username,
        'password': matrix_mautrix_hangouts_database_password,
      }] if (matrix_mautrix_hangouts_enabled and matrix_mautrix_hangouts_database_engine == 'postgres' and matrix_mautrix_hangouts_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_mautrix_googlechat_database_name,
        'username': matrix_mautrix_googlechat_database_username,
        'password': matrix_mautrix_googlechat_database_password,
      }] if (matrix_mautrix_googlechat_enabled and matrix_mautrix_googlechat_database_engine == 'postgres' and matrix_mautrix_googlechat_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_mautrix_instagram_database_name,
        'username': matrix_mautrix_instagram_database_username,
        'password': matrix_mautrix_instagram_database_password,
      }] if (matrix_mautrix_instagram_enabled and matrix_mautrix_instagram_database_engine == 'postgres' and matrix_mautrix_instagram_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_mautrix_signal_database_name,
        'username': matrix_mautrix_signal_database_username,
        'password': matrix_mautrix_signal_database_password,
      }] if (matrix_mautrix_signal_enabled and matrix_mautrix_signal_database_engine == 'postgres' and matrix_mautrix_signal_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_mautrix_meta_messenger_database_name,
        'username': matrix_mautrix_meta_messenger_database_username,
        'password': matrix_mautrix_meta_messenger_database_password,
      }] if (matrix_mautrix_meta_messenger_enabled and matrix_mautrix_meta_messenger_database_engine == 'postgres' and matrix_mautrix_meta_messenger_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_mautrix_meta_instagram_database_name,
        'username': matrix_mautrix_meta_instagram_database_username,
        'password': matrix_mautrix_meta_instagram_database_password,
      }] if (matrix_mautrix_meta_instagram_enabled and matrix_mautrix_meta_instagram_database_engine == 'postgres' and matrix_mautrix_meta_instagram_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_mautrix_wsproxy_syncproxy_database_name,
        'username': matrix_mautrix_wsproxy_syncproxy_database_username,
        'password': matrix_mautrix_wsproxy_syncproxy_database_password,
      }] if (matrix_mautrix_wsproxy_enabled and matrix_mautrix_wsproxy_syncproxy_database_engine == 'postgres' and matrix_mautrix_wsproxy_syncproxy_database_hostname == 'matrix-postgres') else [])
      +
      ([{
        'name': matrix_mautrix_telegram_database_name,
        'username': matrix_mautrix_telegram_database_username,
        'password': matrix_mautrix_telegram_database_password,
      }] if (matrix_mautrix_telegram_enabled and matrix_mautrix_telegram_database_engine == 'postgres' and matrix_mautrix_telegram_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_mautrix_twitter_database_name,
        'username': matrix_mautrix_twitter_database_username,
        'password': matrix_mautrix_twitter_database_password,
      }] if (matrix_mautrix_twitter_enabled and matrix_mautrix_twitter_database_engine == 'postgres' and matrix_mautrix_twitter_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_mautrix_gmessages_database_name,
        'username': matrix_mautrix_gmessages_database_username,
        'password': matrix_mautrix_gmessages_database_password,
      }] if (matrix_mautrix_gmessages_enabled and matrix_mautrix_gmessages_database_engine == 'postgres' and matrix_mautrix_gmessages_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_mautrix_whatsapp_database_name,
        'username': matrix_mautrix_whatsapp_database_username,
        'password': matrix_mautrix_whatsapp_database_password,
      }] if (matrix_mautrix_whatsapp_enabled and matrix_mautrix_whatsapp_database_engine == 'postgres' and matrix_mautrix_whatsapp_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_mautrix_discord_database_name,
        'username': matrix_mautrix_discord_database_username,
        'password': matrix_mautrix_discord_database_password,
      }] if (matrix_mautrix_discord_enabled and matrix_mautrix_discord_database_engine == 'postgres' and matrix_mautrix_discord_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_mautrix_slack_database_name,
        'username': matrix_mautrix_slack_database_username,
        'password': matrix_mautrix_slack_database_password,
      }] if (matrix_mautrix_slack_enabled and matrix_mautrix_slack_database_engine == 'postgres' and matrix_mautrix_slack_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_mx_puppet_slack_database_name,
        'username': matrix_mx_puppet_slack_database_username,
        'password': matrix_mx_puppet_slack_database_password,
      }] if (matrix_mx_puppet_slack_enabled and matrix_mx_puppet_slack_database_engine == 'postgres' and matrix_mx_puppet_slack_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_mx_puppet_twitter_database_name,
        'username': matrix_mx_puppet_twitter_database_username,
        'password': matrix_mx_puppet_twitter_database_password,
      }] if (matrix_mx_puppet_twitter_enabled and matrix_mx_puppet_twitter_database_engine == 'postgres' and matrix_mx_puppet_twitter_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_mx_puppet_instagram_database_name,
        'username': matrix_mx_puppet_instagram_database_username,
        'password': matrix_mx_puppet_instagram_database_password,
      }] if (matrix_mx_puppet_instagram_enabled and matrix_mx_puppet_instagram_database_engine == 'postgres' and matrix_mx_puppet_instagram_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_mx_puppet_discord_database_name,
        'username': matrix_mx_puppet_discord_database_username,
        'password': matrix_mx_puppet_discord_database_password,
      }] if (matrix_mx_puppet_discord_enabled  and matrix_mx_puppet_discord_database_engine == 'postgres' and matrix_mx_puppet_discord_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_mx_puppet_steam_database_name,
        'username': matrix_mx_puppet_steam_database_username,
        'password': matrix_mx_puppet_steam_database_password,
      }] if (matrix_mx_puppet_steam_enabled and matrix_mx_puppet_steam_database_engine == 'postgres' and matrix_mx_puppet_steam_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_mx_puppet_groupme_database_name,
        'username': matrix_mx_puppet_groupme_database_username,
        'password': matrix_mx_puppet_groupme_database_password,
      }] if (matrix_mx_puppet_groupme_enabled and matrix_mx_puppet_groupme_database_engine == 'postgres' and matrix_mx_puppet_groupme_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_dimension_database_name,
        'username': matrix_dimension_database_username,
        'password': matrix_dimension_database_password,
      }] if (matrix_dimension_enabled and matrix_dimension_database_engine == 'postgres' and matrix_dimension_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': etherpad_database_name,
        'username': etherpad_database_username,
        'password': etherpad_database_password,
      }] if (etherpad_enabled and etherpad_database_engine == 'postgres' and etherpad_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': prometheus_postgres_exporter_database_name,
        'username': prometheus_postgres_exporter_database_username,
        'password': prometheus_postgres_exporter_database_password,
      }] if (prometheus_postgres_exporter_enabled and prometheus_postgres_exporter_database_hostname == devture_postgres_connection_hostname) else [])
      +
      ([{
        'name': matrix_media_repo_database_name,
        'username': matrix_media_repo_database_username,
        'password': matrix_media_repo_database_password,
      }] if (matrix_media_repo_enabled and matrix_media_repo_database_hostname == devture_postgres_connection_hostname) else [])

     }}
    '. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while templating '{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'synapse.db', rounds=655555) | to_uuid }}'. Error was a <class 'ansible.errors.AnsibleFilterError'>, original message: Unable to encrypt nor hash, passlib must be installed. No module named 'passlib'. Unable to encrypt nor hash, passlib must be installed. No module named 'passlib'

    The error appears to be in '/home/kuba/projects/midline/matrix-docker-ansible-deploy/roles/galaxy/postgres/tasks/install.yml': line 88, column 3, but may
    be elsewhere in the file depending on the exact syntax problem.

    The offending line appears to be:

    - name: Ensure managed Postgres databases prepared
      ^ here

PLAY RECAP ***********************************************************************************************************************************************************************************
matrix.matriks.chat        : ok=89   changed=0    unreachable=0    failed=1    skipped=79   rescued=0    ignored=0   

error: Recipe `run` failed on line 38 with exit code 2
error: Recipe `run-tags` failed on line 42 with exit code 2
kuba-orlik commented 2 months ago

Installing passlib helped