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.65k stars 1.01k forks source link

Server unreachable when attempting to install Matrix #2827

Open james-wenz opened 10 months ago

james-wenz commented 10 months ago

Hello, and thank you in advance for taking the time to help me with my problem. I am very much a novice in all of this, but have proceeded through most of the setup process via Beeper's self-hosting guide. I have successfully executed the steps on that guide up until step 14.iii, which is the same command listed here for installing Matrix on a new server (see below). Any thoughts? Thanks again!

Playbook Configuration My vars.yml file looks like this:


# The bare domain name which represents your Matrix identity.
matrix_domain: <OMITTED>.com

# The Matrix homeserver software to install.
matrix_homeserver_implementation: synapse

# A secret used as a base, for generating various other secrets.
matrix_homeserver_generic_secret_key: '<OMITTED>'

# Specify reverse proxy
matrix_playbook_reverse_proxy_type: playbook-managed-traefik
devture_traefik_config_certificatesResolvers_acme_email: <OMITTED>@pm.me

matrix_playbook_docker_installation_enabled: false

# Disable installing Element
matrix_client_element_enabled: false

# This is something which is provided to Let's Encrypt when retrieving SSL certificates for domains.
matrix_ssl_lets_encrypt_support_email: <OMITTED>@pm.me

# A Postgres password to use for the superuser Postgres user (called `matrix` by default).
devture_postgres_connection_password: '<OMITTED>'

matrix_synapse_ext_password_provider_shared_secret_auth_enabled: true
# matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret: YOUR_SHARED_SECRET_GOES_HERE
matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret: '<OMITTED>'

# Discord
matrix_mautrix_discord_enabled: false

# Telegram
# You'll need to obtain API keys from https://my.telegram.org/apps and then enter the details below
# matrix_mautrix_telegram_enabled: true
# matrix_mautrix_telegram_api_id: YOUR_TELEGRAM_APP_ID
# matrix_mautrix_telegram_api_hash: YOUR_TELEGRAM_API_HASH

# WhatsApp
matrix_mautrix_whatsapp_enabled: true
matrix_synapse_configuration_extension_yaml: |
  experimental_features:
    msc2716_enabled: true
matrix_mautrix_whatsapp_configuration_extension_yaml:
  bridge:
    history_sync:
      backfill: true

# Facebook Messenger
matrix_mautrix_facebook_enabled: false

# Google Chat
matrix_mautrix_googlechat_enabled: false

# Instagram
matrix_mautrix_instagram_enabled: false

# Twitter
matrix_mautrix_twitter_enabled: false

# Signal
matrix_mautrix_signal_enabled: false

# Linkedin
matrix_beeper_linkedin_enabled: false

# IRC
matrix_heisenbridge_enabled: false

Matrix Server:

Ansible:

Problem description

My problem occurs when attempting to install Matrix on a new server without importing new data. You'll see below the command as I enter it in the terminal shell along with the output I receive. I have tried various permutations of the tags (i.e. omitting 'ensure-all-matrix-users-created' or 'start,' etc.) but receive the same result. Based on the error message below, my best guess is that the issue has to do with permissions in writing to the Matrix server, but I am very far from being an expert on this. I have also tried modifying the inventory/hosts file by replacing ansible_ssh_user=root with ansible_ssh_user=username become=true become_user=root (again with the same result). Thank you for your time and help!


Command /work # ansible-playbook -i inventory/hosts setup.yml --tags=install-all,ensure-matrix-users-created,start -vvv

Output ansible-playbook [core 2.13.6] config file = /work/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.10/site-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible-playbook python version = 3.10.9 (main, Dec 12 2022, 17:52:15) [GCC 12.2.1 20220924] jinja version = 3.1.2 libyaml = True Using /work/ansible.cfg as config file host_list declined parsing /work/inventory/hosts as it did not pass its verify_file() method auto declined parsing /work/inventory/hosts as it did not pass its verify_file() method Parsed /work/inventory/hosts inventory source with ini plugin statically imported: /work/roles/custom/matrix-nginx-proxy/tasks/validate_config.yml statically imported: /work/roles/custom/matrix-nginx-proxy/tasks/ssl/main.yml statically imported: /work/roles/custom/matrix-nginx-proxy/tasks/ssl/setup_ssl_lets_encrypt.yml statically imported: /work/roles/custom/matrix-nginx-proxy/tasks/ssl/purge_ssl_lets_encrypt_orphaned_configs.yml statically imported: /work/roles/custom/matrix-nginx-proxy/tasks/ssl/setup_ssl_self_signed.yml statically imported: /work/roles/custom/matrix-nginx-proxy/tasks/ssl/setup_ssl_manually_managed.yml statically imported: /work/roles/custom/matrix-nginx-proxy/tasks/setup_nginx_proxy.yml statically imported: /work/roles/galaxy/com.devture.ansible.role.playbook_state_preserver/tasks/preserve_vars.yml statically imported: /work/roles/galaxy/com.devture.ansible.role.playbook_state_preserver/tasks/preserve_commit_hash.yml redirecting (type: callback) ansible.builtin.yaml to community.general.yaml redirecting (type: callback) ansible.builtin.yaml to community.general.yaml Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: setup.yml *** 1 plays in setup.yml

PLAY [Set up a Matrix server] *****

TASK [Gathering Facts] **** task path: /work/setup.yml:2

ESTABLISH NSENTER CONNECTION FOR USER: root EXEC nsenter --ipc --mount --net --pid --uts --preserve-credentials --target=1 -- /bin/sh -c 'echo ~username && sleep 0' EXEC nsenter --ipc --mount --net --pid --uts --preserve-credentials --target=1 -- /bin/sh -c 'echo "`pwd`" && sleep 0' EXEC nsenter --ipc --mount --net --pid --uts --preserve-credentials --target=1 -- /bin/sh -c '( umask 77 && mkdir -p "` echo ~/.ansible/tmp `"&& mkdir "` echo ~/.ansible/tmp/ansible-tmp-1692123719.6459856-335-28846876217698 `" && echo ansible-tmp-1692123719.6459856-335-28846876217698="` echo ~/.ansible/tmp/ansible-tmp-1692123719.6459856-335-28846876217698 `" ) && sleep 0' fatal: [matrix.OMITTED.com]: UNREACHABLE! => changed=false msg: 'Failed to create temporary directory. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in "/tmp", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p "` echo ~/.ansible/tmp `"&& mkdir "` echo ~/.ansible/tmp/ansible-tmp-1692123719.6459856-335-28846876217698 `" && echo ansible-tmp-1692123719.6459856-335-28846876217698="` echo ~/.ansible/tmp/ansible-tmp-1692123719.6459856-335-28846876217698 `" ), exited with result 1' unreachable: true PLAY RECAP ******************************************************************************************************************************************************************** matrix.OMITTED.com : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0 --------------------- My domain name is hosted on Google Domains and has a DNS record set up to connect to the external IP address of a virtual machine hosted on Google Cloud.
kylefmohr commented 10 months ago

I'm getting the same error during the same part of the setup, did you ever figure out a solution?

james-wenz commented 9 months ago

Sadly, I did not. There were some people working on it on the Discord, but I went out of the country for a vacation and haven't picked it up since. Good luck!

------- Original Message ------- On Monday, September 4th, 2023 at 3:20 AM, Kyle Mohr @.***> wrote:

I'm getting the same error during the same part of the setup, did you ever figure out a solution?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

boomboom21 commented 9 months ago

I'm running into same issue. Any luck? I found this page indicating a possible Ansible version issue.

What discord channel are you monitoring? Thanks

james-wenz commented 9 months ago

Hi There,

I haven’t done really anything else to try to fix the issue, and am not currently monitoring any Discord channels. Sorry I can’t be of help, and good luck!

James

On Sun, Oct 8, 2023 at 5:59 PM, boomboom21 @.***(mailto:On Sun, Oct 8, 2023 at 5:59 PM, boomboom21 < wrote:

I'm running into same issue. Any luck? I found this page indicating a possible Ansible version issue.

What discord channel are you monitoring? Thanks

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

boomboom21 commented 8 months ago

using this to run the playbook worked for me instead of what the Beeper self-hosting page indicates worked for me. I'm running the container on the Matrix server itself. docker run -it --rm \ --privileged \ --pid=host \ -w /work \ -v pwd:/work \ --entrypoint=/bin/sh \ docker.io/devture/ansible:2.13.6-r0-3