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.92k stars 1.05k forks source link

An unhandled exception occurred while templating #880

Open o- opened 3 years ago

o- commented 3 years ago

I tried to run this in a fairly standard configuration on fedora 32, ansible 2.9.17 and I get the following error:

TASK [matrix-synapse : Ensure Synapse homeserver config installed] ********************************************************************************************
fatal: [xxxx]: FAILED! => {"msg": "An unhandled exception occurred while templating '{{ matrix_synapse_configuration_yaml|from_yaml|combine(matrix_synapse_configuration_extension, recursive=True) }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while templating '{{ matrix_synapse_configuration_extension_yaml|from_yaml if matrix_synapse_configuration_extension_yaml|from_yaml is mapping else {} }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: Unexpected templating type error occurred on ({{ matrix_synapse_configuration_extension_yaml|from_yaml if matrix_synapse_configuration_extension_yaml|from_yaml is mapping else {} }}): a string or stream input is required"}

Unfortunately I don't really know how to debug this

aaronraimist commented 3 years ago

Run your vars.yml file through a yaml linter like http://www.yamllint.com/, make sure to redact the secret keys before you paste it in. It looks like you’ve made some invalid YAML. If that doesn’t work then paste your config here so we can see it.

o- commented 3 years ago

Thanks a lot for your time. So the yaml seems valid. Here you go:

ansible_python_interpreter: auto
matrix_domain: a-bc.def
matrix_coturn_turn_static_auth_secret: QZFudPwjoD1coHfZxGsLEx95ZMdSR81UGN3Kwn98p9nTbXjG1Iz9cZDHqyzd3iwY
matrix_synapse_macaroon_secret_key: NhOioxMyyamNMe7d4Fmjr9j8UdDXHnTmupaOInXwRbpQrrZcBisIsfg7QVIHI162
matrix_postgres_connection_password: ZZy9QIM7WPg2du5r
matrix_jitsi_enabled: true
matrix_jitsi_jicofo_component_secret: 2cdc9da13287f30cec2b2ff07807e74c
matrix_jitsi_jicofo_auth_password: ea1aa961d8b3ff3d58ae0564b69415e9
matrix_jitsi_jvb_auth_password: 301c260af94b63b674538d6cda3457bf
matrix_jitsi_jibri_recorder_password: 8f36b87f047ebfa475b1fd7841af8ea1
matrix_jitsi_jibri_xmpp_password: f4d91bbb214d70e402b4ca76d02b9526
matrix_jitsi_enable_auth: true
matrix_jitsi_enable_guests: true
matrix_ssl_retrieval_method: none
matrix_nginx_proxy_https_enabled: false
matrix_nginx_proxy_container_http_host_bind_port: ''
matrix_nginx_proxy_container_federation_host_bind_port: ''
matrix_coturn_enabled: false
matrix_docker_network: traefik
matrix_nginx_proxy_container_extra_arguments:
- --label "traefik.enable=true"
- --label "traefik.http.routers.matrix-nginx-proxy.rule=Host(`{{ matrix_server_fqn_matrix }}`,`{{ matrix_server_fqn_element }}`,`{{ matrix_server_fqn_dimension }}`,`{{ matrix_server_fqn_jitsi }}`)"
- --label "traefik.http.routers.matrix-nginx-proxy.entrypoints=web-secure"
- --label "traefik.http.routers.matrix-nginx-proxy.tls.certResolver=default"
- --label "traefik.http.services.matrix-nginx-proxy.loadbalancer.server.port=8080"
matrix_synapse_container_extra_arguments:
- --label "traefik.enable=true"
- --label "traefik.http.routers.matrix-synapse.rule=Host(`{{ matrix_server_fqn_matrix }}`)"
- --label "traefik.http.routers.matrix-synapse.entrypoints=synapse"
- --label "traefik.http.routers.matrix-synapse.tls.certResolver=default"
- --label "traefik.http.services.matrix-synapse.loadbalancer.server.port=8048"
o- commented 3 years ago

Actually, just to narrow down the problem, I removed all the jitsi stuff and I re-ran from scratch and I get a slightly different error earlier. Though I believe in the previous run, with the error reported above, I just commented out this task to get further....

TASK [matrix-synapse : (Deprecation) Catch and report renamed settings in matrix_synapse_configuration_extension_yaml] ************************************************************************************************************************
fatal: [matrix.r-vm.net]: FAILED! => {"msg": "The conditional check 'item.old in matrix_synapse_configuration_extension' failed. The error was: An unhandled exception occurred while templating '{{ matrix_synapse_configuration_extension_yaml|from_yaml if matrix_synapse_configuration_extension_yaml|from_yaml is mapping else {} }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: Unexpected templating type error occurred on ({{ matrix_synapse_configuration_extension_yaml|from_yaml if matrix_synapse_configuration_extension_yaml|from_yaml is mapping else {} }}): a string or stream input is required\n\nThe error appears to be in '/home/user/Documents/matrix-docker-ansible-deploy/roles/matrix-synapse/tasks/validate_config.yml': line 41, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: (Deprecation) Catch and report renamed settings in matrix_synapse_configuration_extension_yaml\n  ^ here\n"}
aaronraimist commented 3 years ago

@o- Don't post those secret keys and passwords. You are going to need to change those now.

Run git status and show the output.

o- commented 3 years ago

@o- Don't post those secret keys and passwords. You are going to need to change those now.

Sure, no worries, I know. I am just experimenting at this point.

Run git status and show the output.

I am on master, commit 66064f0890852aed069a003be6be53a98f93118f no local changes

aaronraimist commented 3 years ago

@o- Hmm. Then I'm guessing it is an Ansible bug. Try updating to a newer version.