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.01k forks source link

Cannot enable Synapse workers: sequence item 3: expected str instance, int found #3114

Closed ppkhoa closed 7 months ago

ppkhoa commented 7 months ago

Describe the bug Set matrix_synapse_workers_enabled: true in vars.yml and playbook failed at this step:

TASK [custom/matrix-synapse-reverse-proxy-companion : Ensure matrix-synapse-reverse-proxy-companion is configured] ***********************************************
ok: [matrix.<mydomain>] => (item={'src': '/root/matrix-docker-ansible-deploy/roles/custom/matrix-synapse-reverse-proxy-companion/templates/nginx/nginx.conf.j2', 'dest': '/matrix/synapse/reverse-proxy-companion/nginx.conf'})
ok: [matrix.<mydomain>] => (item={'src': '/root/matrix-docker-ansible-deploy/roles/custom/matrix-synapse-reverse-proxy-companion/templates/nginx/conf.d/nginx-http.conf.j2', 'dest': '/matrix/synapse/reverse-proxy-companion/conf.d/nginx-http.conf'})
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ): sequence item 3: expected str instance, int found. sequence item 3: expected str instance, int found
failed: [matrix.<mydomain>] (item={'src': '/root/matrix-docker-ansible-deploy/roles/custom/matrix-synapse-reverse-proxy-companion/templates/nginx/conf.d/matrix-synapse-reverse-proxy-companion.conf.j2', 'dest': '/matrix/synapse/reverse-proxy-companion/conf.d/matrix-synapse-reverse-proxy-companion.conf'}) => changed=false
  ansible_loop_var: item
  item:
    dest: /matrix/synapse/reverse-proxy-companion/conf.d/matrix-synapse-reverse-proxy-companion.conf
    src: /root/matrix-docker-ansible-deploy/roles/custom/matrix-synapse-reverse-proxy-companion/templates/nginx/conf.d/matrix-synapse-reverse-proxy-companion.conf.j2
  msg: |-
    AnsibleError: Unexpected templating type error occurred on (
    {% set generic_workers = matrix_synapse_reverse_proxy_companion_synapse_workers_list | selectattr('type', 'equalto', 'generic_worker') | list %}
    {% set stream_writer_typing_stream_workers = matrix_synapse_reverse_proxy_companion_synapse_workers_list | selectattr('type', 'equalto', 'stream_writer') | selectattr('stream_writer_stream', 'equalto', 'typing') | list %}
    {% set stream_writer_to_device_stream_workers = matrix_synapse_reverse_proxy_companion_synapse_workers_list | selectattr('type', 'equalto', 'stream_writer') | selectattr('stream_writer_stream', 'equalto', 'to_device') | list %}
    {% set stream_writer_account_data_stream_workers = matrix_synapse_reverse_proxy_companion_synapse_workers_list | selectattr('type', 'equalto', 'stream_writer') | selectattr('stream_writer_stream', 'equalto', 'account_data') | list %}
    {% set stream_writer_receipts_stream_workers = matrix_synapse_reverse_proxy_companion_synapse_workers_list | selectattr('type', 'equalto', 'stream_writer') | selectattr('stream_writer_stream', 'equalto', 'receipts') | list %}
    {% set stream_writer_presence_stream_workers = matrix_synapse_reverse_proxy_companion_synapse_workers_list | selectattr('type', 'equalto', 'stream_writer') | selectattr('stream_writer_stream', 'equalto', 'presence') | list %}
    {% set media_repository_workers = matrix_synapse_reverse_proxy_companion_synapse_workers_list | selectattr('type', 'equalto', 'media_repository') | list %}
    {% set user_dir_workers = matrix_synapse_reverse_proxy_companion_synapse_workers_list | selectattr('type', 'equalto', 'user_dir') | list %}

    {% macro render_worker_upstream(name, workers) %}
    {% if workers | length > 0 %}
            upstream {{ name }} {
                    keepalive {{ workers | length * 2 }};
                    {% for worker in workers %}
                            server "{{ worker.name }}:{{ worker.port }}";
                    {% endfor %}
            }
    {% endif %}
    {% endmacro %}

    {% macro render_locations_to_upstream(locations, upstream_name) %}
            {% for location in locations %}
            location ~ {{ location }} {
                    proxy_pass http://{{ upstream_name }}$request_uri;
                    proxy_set_header Host $host;
                    proxy_http_version 1.1;
                    proxy_set_header Connection "";
            }
            {% endfor %}
    {% endmacro %}

    {% if matrix_synapse_reverse_proxy_companion_synapse_workers_enabled %}
            {% if matrix_synapse_reverse_proxy_companion_synapse_cache_enabled %}
            proxy_cache_path  {{ matrix_synapse_reverse_proxy_companion_synapse_cache_path }} levels=1:2 keys_zone={{ matrix_synapse_reverse_proxy_companion_synapse_cache_keys_zone_name }}:{{ matrix_synapse_reverse_proxy_companion_synapse_cache_keys_zone_size }} inactive={{ matrix_synapse_reverse_proxy_companion_synapse_cache_inactive_time }} max_size={{ matrix_synapse_reverse_proxy_companion_synapse_cache_max_size_mb }}m;
            {% endif %}
            # Round Robin "upstream" pools for workers

            {% if generic_workers |length > 0 %}
            upstream generic_workers_upstream {
                    # ensures that requests from the same client will always be passed
                    # to the same server (except when this server is unavailable)
                    hash $http_x_forwarded_for;
                    keepalive {{ generic_workers | length * 2 }};

                    {% for worker in generic_workers %}
                            server "{{ worker.name }}:{{ worker.port }}";
                    {% endfor %}
            }
            {% endif %}

            {{ render_worker_upstream('stream_writer_typing_stream_workers_upstream', stream_writer_typing_stream_workers) }}
            {{ render_worker_upstream('stream_writer_to_device_stream_workers_upstream', stream_writer_to_device_stream_workers) }}
            {{ render_worker_upstream('stream_writer_account_data_stream_workers_upstream', stream_writer_account_data_stream_workers) }}
            {{ render_worker_upstream('stream_writer_receipts_stream_workers_upstream', stream_writer_receipts_stream_workers) }}
            {{ render_worker_upstream('stream_writer_presence_stream_workers_upstream', stream_writer_presence_stream_workers) }}

            {{ render_worker_upstream('media_repository_workers_upstream', media_repository_workers) }}

            {{ render_worker_upstream('user_dir_workers_upstream', user_dir_workers) }}
    {% endif %}

    server {
            listen 8008;
            server_name {{ matrix_synapse_reverse_proxy_companion_hostname }};

            server_tokens off;
            root /dev/null;

            gzip on;
            gzip_types text/plain application/json;

            {% if matrix_synapse_reverse_proxy_companion_synapse_workers_enabled %}
                    {# Workers redirects BEGIN #}

                    {% if generic_workers | length > 0 %}
                            # https://matrix-org.github.io/synapse/latest/workers.html#synapseappgeneric_worker
                            {{ render_locations_to_upstream(matrix_synapse_reverse_proxy_companion_synapse_generic_worker_client_server_locations, 'generic_workers_upstream') }}
                    {% endif %}

                    {% if stream_writer_typing_stream_workers | length > 0 %}
                            # https://matrix-org.github.io/synapse/latest/workers.html#the-typing-stream
                            {{ render_locations_to_upstream(matrix_synapse_reverse_proxy_companion_synapse_stream_writer_typing_stream_worker_client_server_locations, 'stream_writer_typing_stream_workers_upstream') }}
                    {% endif %}

                    {% if stream_writer_to_device_stream_workers | length > 0 %}
                            # https://matrix-org.github.io/synapse/latest/workers.html#the-to_device-stream
                            {{ render_locations_to_upstream(matrix_synapse_reverse_proxy_companion_synapse_stream_writer_to_device_stream_worker_client_server_locations, 'stream_writer_to_device_stream_workers_upstream') }}
                    {% endif %}

                    {% if stream_writer_account_data_stream_workers | length > 0 %}
                            # https://matrix-org.github.io/synapse/latest/workers.html#the-account_data-stream
                            {{ render_locations_to_upstream(matrix_synapse_reverse_proxy_companion_synapse_stream_writer_account_data_stream_worker_client_server_locations, 'stream_writer_account_data_stream_workers_upstream') }}
                    {% endif %}

                    {% if stream_writer_receipts_stream_workers | length > 0 %}
                            # https://matrix-org.github.io/synapse/latest/workers.html#the-receipts-stream
                            {{ render_locations_to_upstream(matrix_synapse_reverse_proxy_companion_synapse_stream_writer_receipts_stream_worker_client_server_locations, 'stream_writer_receipts_stream_workers_upstream') }}
                    {% endif %}

                    {% if stream_writer_presence_stream_workers | length > 0 %}
                            # https://matrix-org.github.io/synapse/latest/workers.html#the-presence-stream
                            {{ render_locations_to_upstream(matrix_synapse_reverse_proxy_companion_synapse_stream_writer_presence_stream_worker_client_server_locations, 'stream_writer_presence_stream_workers_upstream') }}
                    {% endif %}

                    {% if media_repository_workers | length > 0 %}
                            # https://matrix-org.github.io/synapse/latest/workers.html#synapseappmedia_repository
                            {% for location in matrix_synapse_reverse_proxy_companion_synapse_media_repository_locations %}
                            location ~ {{ location }} {
                                    proxy_pass http://media_repository_workers_upstream$request_uri;
                                    proxy_set_header Host $host;

                                    client_body_buffer_size 25M;
                                    client_max_body_size {{ matrix_synapse_reverse_proxy_companion_client_api_client_max_body_size_mb }}M;
                                    proxy_max_temp_file_size 0;

                                    {% if matrix_synapse_reverse_proxy_companion_synapse_cache_enabled %}
                                            proxy_buffering        on;
                                            proxy_cache            {{ matrix_synapse_reverse_proxy_companion_synapse_cache_keys_zone_name }};
                                            proxy_cache_valid      any {{ matrix_synapse_reverse_proxy_companion_synapse_cache_proxy_cache_valid_time }};
                                            proxy_force_ranges on;
                                            add_header X-Cache-Status $upstream_cache_status;
                                    {% endif %}
                            }
                            {% endfor %}
                    {% endif %}

                    {% if user_dir_workers | length > 0 %}
                            # https://matrix-org.github.io/synapse/latest/workers.html#updating-the-user-directory
                            {{ render_locations_to_upstream(matrix_synapse_reverse_proxy_companion_synapse_user_dir_locations, 'user_dir_workers_upstream') }}
                    {% endif %}
                    {# Workers redirects END #}
            {% endif %}

            {% for configuration_block in matrix_synapse_reverse_proxy_companion_synapse_client_api_additional_server_configuration_blocks %}
                    {{- configuration_block }}
            {% endfor %}

            {# Everything else just goes to the API server ##}
            location / {
                    {# Use the embedded DNS resolver in Docker containers to discover the service #}
                    resolver {{ matrix_synapse_reverse_proxy_companion_http_level_resolver }} valid=5s;
                    set $backend "{{ matrix_synapse_reverse_proxy_companion_client_api_addr }}";
                    proxy_pass http://$backend;

                    proxy_set_header Host $host;

                    client_body_buffer_size 25M;
                    client_max_body_size {{ matrix_synapse_reverse_proxy_companion_client_api_client_max_body_size_mb }}M;
                    proxy_max_temp_file_size 0;
            }
    }

    {% if matrix_synapse_reverse_proxy_companion_federation_api_enabled %}
    server {
            listen 8048;
            server_name {{ matrix_synapse_reverse_proxy_companion_hostname }};

            server_tokens off;

            root /dev/null;

            gzip on;
            gzip_types text/plain application/json;

            {% if matrix_synapse_reverse_proxy_companion_synapse_workers_enabled %}
                    {% if generic_workers | length > 0 %}
                            # https://matrix-org.github.io/synapse/latest/workers.html#synapseappgeneric_worker
                            {{ render_locations_to_upstream(matrix_synapse_reverse_proxy_companion_synapse_generic_worker_federation_locations, 'generic_workers_upstream') }}
                    {% endif %}
                    {% if media_repository_workers | length > 0 %}
                            # https://matrix-org.github.io/synapse/latest/workers.html#synapseappmedia_repository
                            {% for location in matrix_synapse_reverse_proxy_companion_synapse_media_repository_locations %}
                            location ~ {{ location }} {
                                    proxy_pass http://media_repository_workers_upstream$request_uri;
                                    proxy_set_header Host $host;

                                    client_body_buffer_size 25M;
                                    client_max_body_size {{ matrix_synapse_reverse_proxy_companion_federation_api_client_max_body_size_mb }}M;
                                    proxy_max_temp_file_size 0;

                                    {% if matrix_synapse_reverse_proxy_companion_synapse_cache_enabled %}
                                            proxy_buffering        on;
                                            proxy_cache            {{ matrix_synapse_reverse_proxy_companion_synapse_cache_keys_zone_name }};
                                            proxy_cache_valid      any  {{ matrix_synapse_reverse_proxy_companion_synapse_cache_proxy_cache_valid_time }};
                                            proxy_force_ranges on;
                                            add_header X-Cache-Status $upstream_cache_status;
                                    {% endif %}
                            }
                            {% endfor %}
                    {% endif %}
            {% endif %}

            {% for configuration_block in matrix_synapse_reverse_proxy_companion_synapse_federation_api_additional_server_configuration_blocks %}
                    {{- configuration_block }}
            {% endfor %}

            location / {
                    {# Use the embedded DNS resolver in Docker containers to discover the service #}
                    resolver {{ matrix_synapse_reverse_proxy_companion_http_level_resolver }} valid=5s;
                    set $backend "{{ matrix_synapse_reverse_proxy_companion_federation_api_addr }}";
                    proxy_pass http://$backend;

                    proxy_set_header Host $host;

                    client_body_buffer_size 25M;
                    client_max_body_size {{ matrix_synapse_reverse_proxy_companion_federation_api_client_max_body_size_mb }}M;
                    proxy_max_temp_file_size 0;
            }
    }
    {% endif %}
    ): sequence item 3: expected str instance, int found. sequence item 3: expected str instance, int found
ok: [matrix.<mydomain>] => (item={'src': '/root/matrix-docker-ansible-deploy/roles/custom/matrix-synapse-reverse-proxy-companion/templates/labels.j2', 'dest': '/matrix/synapse/reverse-proxy-companion/labels'})

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: <mydomain>

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

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

# 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_playbook_ssl_enabled: true
matrix_playbook_reverse_proxy_type: 'other-traefik-container'
matrix_playbook_reverse_proxyable_services_additional_network: 'traefik'
matrix_playbook_reverse_proxy_hostname: 'traefik'
matrix_playbook_reverse_proxy_container_network: 'traefik'
#matrix_static_files_container_additional_networks: ["traefik"]
matrix_playbook_reverse_proxyable_services_additional_network: ["traefik"]
matrix_playbook_reverse_proxyable_services_additional_network
devture_traefik_certs_dumper_enabled: true
devture_traefik_certs_dumper_ssl_dir_path: "/opt/containers/traefik/data/"
devture_traefik_config_certificatesResolvers_acme_enabled: false
matrix_playbook_public_matrix_federation_api_traefik_entrypoint_port: 8449
matrix_playbook_public_matrix_federation_api_traefik_entrypoint_host_bind_port: 127.0.0.1:8449
matrix_playbook_public_matrix_federation_api_traefik_entrypoint_config_custom:
  forwardedHeaders:
    insecure: true
matrix_synapse_container_additional_networks: ["traefik", "matrix-postgres", "matrix-exim-relay"]
matrix_coturn_systemd_required_services_list: ['docker.service']
matrix_coturn_container_additional_volumes: |
  {{
    (
      [
       {
         'src': (matrix_ssl_config_dir_path + '/live/' + matrix_domain + '/fullchain.pem'),
         'dst': '/fullchain.pem',
         'options': 'ro',
       },
       {
         'src': (matrix_ssl_config_dir_path + '/live/' + matrix_domain + '/privkey.pem'),
         'dst': '/privkey.pem',
         'options': 'ro',
       },
      ] if matrix_playbook_reverse_proxy_type in ['playbook-managed-nginx', 'other-nginx-non-container'] and matrix_coturn_tls_enabled else []
    )
    +
    (
      [
       {
         'src': (devture_traefik_certs_dumper_dumped_certificates_dir_path +  '/' + matrix_domain + '/certificate.crt'),
         'dst': '/certificate.crt',
         'options': 'ro',
       },
       {
         'src': (devture_traefik_certs_dumper_dumped_certificates_dir_path +  '/' + matrix_domain + '/privatekey.key'),
         'dst': '/privatekey.key',
         'options': 'ro',
       },
      ] if matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] and devture_traefik_certs_dumper_enabled and matrix_coturn_tls_enabled else []
    )
  }}
# 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_synapse_auto_compressor_enabled: true
matrix_synapse_auto_compressor_container_image_self_build: true
devture_postgres_connection_password: 'sdfsdfsdfsdf'
matrix_architecture: 'arm64'
matrix_static_files_container_labels_base_domain_enabled: true
matrix_static_files_file_index_html_template: |-
  <!doctype html>
  <meta charset="utf-8" />
  <html>
    <head>
        <title>Systems Status</title>
        <style type="text/css">
            body, html
            {
                margin: 0; padding: 0; height: 100%; overflow: hidden;
            }
            #content
            {
                position:absolute; left: 0; right: 0; bottom: 0; top: 0px;
            }
        </style>
    </head>
    <body>
      <div id="content">
            <iframe width="100%" height="100%" frameborder="0" src="https://khoa.betteruptime.com/"></iframe>
      </div>
      <div style="display:none;">proven233175</div>
    </body>
  </html>
matrix_dimension_hsts_preload_enabled: true
matrix_synapse_admin_hsts_preload_enabled: true
matrix_client_element_hsts_preload_enabled: true
matrix_sliding_sync_enabled: true
matrix_coturn_turn_external_ip_address: <myip>
matrix_synapse_admin_enabled: true
matrix_synapse_enable_registration: true
matrix_synapse_enable_registration_captcha: true
matrix_synapse_recaptcha_public_key: 'dsfsdfdsf'
matrix_synapse_recaptcha_private_key: 'sdfsdfsdf'
matrix_synapse_allow_public_rooms_over_federation: true
matrix_synapse_forget_rooms_on_leave: true
matrix_mautrix_gmessages_enabled: false
exim_relay_sender_address: "me@<mydomain>"
exim_relay_relay_use: true
exim_relay_relay_host_name: "smtp.sendgrid.net"
exim_relay_relay_host_port: 587
exim_relay_relay_auth: true
exim_relay_relay_auth_username: "apikey"
exim_relay_relay_auth_password: "secret"
matrix_synapse_ext_password_provider_shared_secret_auth_com_devture_shared_secret_auth_support_enabled: true
matrix_synapse_ext_password_provider_shared_secret_auth_enabled: true
matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret: 'secret'
matrix_mautrix_wsproxy_enabled: true
matrix_mautrix_imessage_appservice_token: 'secret'
matrix_mautrix_imessage_homeserver_token: 'secret'
matrix_mautrix_androidsms_appservice_token: 'secret'
matrix_mautrix_androidsms_homeserver_token: 'secret'
matrix_mautrix_wsproxy_syncproxy_shared_secret: 'secret'
matrix_mautrix_wsproxy_bind_port: true
matrix_mautrix_imessage_appservice_bot_username: imessage-bot
matrix_mautrix_wsproxy_syncproxy_database_username: 'matrix'
matrix_mautrix_wsproxy_syncproxy_database_password: 'somepassword'
matrix_mautrix_wsproxy_syncproxy_database_hostname: 'matrix-postgres'
matrix_mautrix_wsproxy_syncproxy_database_port: 5432
matrix_mautrix_wsproxy_syncproxy_database_name: 'matrix_mautrix_wsproxy_syncproxy'

matrix_synapse_federation_enabled: true
matrix_synapse_federation_domain_whitelist:
- matrix.org
- vector.im
matrix_mautrix_whatsapp_enabled: true
matrix_synapse_configuration_extension_yaml: |
  experimental_features:
    msc2716_enabled: true
matrix_mautrix_whatsapp_configuration_extension_yaml:
  bridge:
    encryption:
      allow: true
      default: true
    history_sync:
      backfill: true
    permissions:
      '@khoa:<mydomain>': admin
matrix_mautrix_telegram_enabled: true
matrix_mautrix_telegram_configuration_extension_yaml:
  bridge:
    encryption:
      allow: true
      default: true
    history_sync:
      backfill: true
    permissions:
      '@khoa:<mydomain>': admin
matrix_mautrix_telegram_api_id: nope
matrix_mautrix_telegram_api_hash: secret
matrix_mautrix_facebook_enabled: true
matrix_mautrix_facebook_configuration_extension_yaml: |
  bridge:
    encryption:
      allow: true
      default: true
    history_sync:
      backfill: true
    permissions:
      '@khoa:<mydomain>': admin
matrix_mautrix_discord_enabled: true
matrix_ma1sd_enabled: true
matrix_ma1sd_container_image_self_build: true
matrix_ma1sd_matrixorg_forwarding_enabled: true
matrix_ma1sd_configuration_extension_yaml: |
forward:
  servers:
    - 'matrix-org'
  threepid:
    medium:
      msisdn:
        connectors:
          twilio:
            account_sid: 'password'
            auth_token: 'password'
            number: '+1<number>'
matrix_dimension_enabled: true
matrix_dimension_admins: ['@khoa:<mydomain>', '@dimension:<mydomain>']
matrix_dimension_access_token: "password"
matrix_bot_matrix_reminder_bot_enabled: true

# Adjust this to whatever password you chose when registering the bot user
matrix_bot_matrix_reminder_bot_matrix_user_password: <password>
matrix_bot_matrix_reminder_bot_matrix_user_id_localpart: bot.reminder
# Adjust this to your timezone
matrix_bot_matrix_reminder_bot_reminders_timezone: Asia/Bangkok
matrix_mautrix_signal_enabled: true
matrix_mautrix_signal_configuration_extension_yaml: |
  bridge:
    permissions:
      '@khoa:<mydomain>': admin
matrix_bot_chatgpt_enabled: false

matrix_bot_chatgpt_openai_api_key: 'password'
matrix_bot_chatgpt_matrix_access_token: 'password'
matrix_client_cinny_enabled: false

Expected behavior No error

Matrix Server:

Ansible: ansible [core 2.15.8] config file = /etc/ansible/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.10/dist-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/usr/bin/python3) jinja version = 3.0.3 libyaml = True

Using ansible 2.10.x, I did not encounter any error and workers can be enabled fine. Issue appeared after upgrading to ansible 2.15.x, same behavior with 2.16.x

Additional context None

spantaleev commented 7 months ago

Interesting. I'm on Ansible 2.16.2 (with Jinja 3.1.3 though) and I can't reproduce it.

This has come up before and is most likely related to https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/3076 I can't find where it was reported before, so it may have been in the Matrix room.

There are 2 keepalive sections in the roles/custom/matrix-synapse-reverse-proxy-companion/templates/nginx/conf.d/matrix-synapse-reverse-proxy-companion.conf.j2 file.

You may try the following changes:

-keepalive {{ workers | length * 2 }};
+keepalive {{ ((workers | length) * 2) | string }};
-keepalive {{ generic_workers | length * 2 }};
+keepalive {{ ((generic_workers | length) * 2) | string }};

If this fails, you can try removing the keepalive lines one by one to figure out which one is causing the problem.

ppkhoa commented 7 months ago

Forcing string type worked, Synapse workers started OK.

Do I have to edit roles/custom/matrix-synapse-reverse-proxy-companion/templates/nginx/conf.d/matrix-synapse-reverse-proxy-companion.conf.j2 again in the future or you'll update this file in upcoming commit?

spantaleev commented 7 months ago

Thanks for confirming! I've fixed it for everyone now