Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

disable chunked encoding if using path style access (#67262)

Nicola Momettoff6fffded935
diff --git a/enterprise/backend/src/metabase_enterprise/transforms_python/s3.clj b/enterprise/backend/src/metabase_enterprise/transforms_python/s3.clj
index e244fab72b1..2992c7cfffa 100644
--- a/enterprise/backend/src/metabase_enterprise/transforms_python/s3.clj
+++ b/enterprise/backend/src/metabase_enterprise/transforms_python/s3.clj
@@ -46,9 +46,13 @@
(maybe-with-endpoint* builder endpoint))
(defn- s3-configuration ^S3Configuration []
- (-> (S3Configuration/builder)
- (.pathStyleAccessEnabled (transforms-python.settings/python-storage-s-3-path-style-access))
- (.build)))
+ (let [path-style-access (transforms-python.settings/python-storage-s-3-path-style-access)]
+ (-> (S3Configuration/builder)
+ (.pathStyleAccessEnabled path-style-access)
+ ;; Disable chunked encoding when using path-style access, as most S3-compatible
+ ;; services don't handle it properly
+ (.chunkedEncodingEnabled (not path-style-access))
+ (.build))))
(defn- put-object-request ^PutObjectRequest [^String bucket-name ^String key]
(-> (PutObjectRequest/builder) (.bucket bucket-name) (.key key) .build))