From 7232d2b6d5f23797db52cbf3f57f7bb822f09fec Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sun, 19 Jan 2025 10:32:07 +0200 Subject: [PATCH] Pin boto3 and botocore to an old version when installing synapse-s3-storage-provider to prevent issues with non-AWS S3 providers Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/3964 Related to https://github.com/aws/aws-cli/issues/9214 --- roles/custom/matrix-synapse/defaults/main.yml | 4 ++++ .../templates/synapse/customizations/Dockerfile.j2 | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/roles/custom/matrix-synapse/defaults/main.yml b/roles/custom/matrix-synapse/defaults/main.yml index cc1a6730d..b45381c56 100644 --- a/roles/custom/matrix-synapse/defaults/main.yml +++ b/roles/custom/matrix-synapse/defaults/main.yml @@ -48,6 +48,10 @@ matrix_synapse_container_image_customizations_enabled: |- # The version that will be installed is specified in `matrix_synapse_ext_synapse_s3_storage_provider_version`. matrix_synapse_container_image_customizations_s3_storage_provider_installation_enabled: "{{ matrix_synapse_ext_synapse_s3_storage_provider_enabled }}" +# Controls whether to install an old version of boto3 and botocore, to work around the following issue: +# https://github.com/aws/aws-cli/issues/9214 +matrix_synapse_container_image_customizations_s3_storage_provider_installation_old_boto_workaround_enabled: true + # Controls whether custom build steps will be added to the Dockerfile for installing auto-accept-invite module. # The version that will be installed is specified in `matrix_synapse_ext_synapse_auto_accept_invite_version`. matrix_synapse_container_image_customizations_auto_accept_invite_installation_enabled: "{{ matrix_synapse_ext_synapse_auto_accept_invite_enabled }}" diff --git a/roles/custom/matrix-synapse/templates/synapse/customizations/Dockerfile.j2 b/roles/custom/matrix-synapse/templates/synapse/customizations/Dockerfile.j2 index 39367fe09..d01268a4a 100644 --- a/roles/custom/matrix-synapse/templates/synapse/customizations/Dockerfile.j2 +++ b/roles/custom/matrix-synapse/templates/synapse/customizations/Dockerfile.j2 @@ -6,8 +6,12 @@ RUN pip install synapse-auto-accept-invite=={{ matrix_synapse_ext_synapse_auto_a {% endif %} {% if matrix_synapse_container_image_customizations_s3_storage_provider_installation_enabled %} +{% if matrix_synapse_container_image_customizations_s3_storage_provider_installation_old_boto_workaround_enabled %} +RUN pip install 'boto3<1.36.0' 'botocore<1.36.0' synapse-s3-storage-provider=={{ matrix_synapse_ext_synapse_s3_storage_provider_version }} +{% else %} RUN pip install synapse-s3-storage-provider=={{ matrix_synapse_ext_synapse_s3_storage_provider_version }} {% endif %} +{% endif %} {% if matrix_synapse_container_image_customizations_templates_enabled %} {#