Skip to content

Commit 7708f1b

Browse files
SNOW-2324060 don't attempt non working bucket accelerate endpoint for internal stages (#2556)
1 parent b7c49ba commit 7708f1b

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

DESCRIPTION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Source code is also available at: https://github.com/snowflakedb/snowflake-conne
2626
- As part of this fix, `DictCursor` is no longer a subclass of `SnowflakeCursor`; use `SnowflakeCursorBase` as a superclass of both.
2727
- Fix "No AWS region was found" error if AWS region was set in `AWS_DEFAULT_REGION` variable instead of `AWS_REGION` for `WORKLOAD_IDENTITY` authenticator
2828
- Add `ocsp_root_certs_dict_lock_timeout` connection parameter to set the timeout (in seconds) for acquiring the lock on the OCSP root certs dictionary. Default value for this parameter is -1 which indicates no timeout.
29+
- Fixed behaviour of trying S3 Transfer Accelerate endpoint by default for internal stages, and always getting HTTP403 due to permissions missing on purpose. Now /accelerate is not attempted.
2930

3031
- v3.17.4(September 22,2025)
3132
- Added support for intermediate certificates as roots when they are stored in the trust store

src/snowflake/connector/s3_storage_client.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,17 @@ def transfer_accelerate_config(
120120
return False
121121
else:
122122
if use_accelerate_endpoint is None:
123-
use_accelerate_endpoint = self._get_bucket_accelerate_config(
124-
self.s3location.bucket_name
125-
)
123+
if str(self.s3location.bucket_name).lower().startswith("sfc-"):
124+
# SNOW-2324060: no s3:GetAccelerateConfiguration and no intention to add either
125+
# for internal stage, thus previously the client got HTTP403 on /accelerate call
126+
logger.debug(
127+
"Not attempting to get bucket transfer accelerate endpoint for internal stage."
128+
)
129+
use_accelerate_endpoint = False
130+
else:
131+
use_accelerate_endpoint = self._get_bucket_accelerate_config(
132+
self.s3location.bucket_name
133+
)
126134

127135
if use_accelerate_endpoint:
128136
self.endpoint = (
@@ -132,6 +140,7 @@ def transfer_accelerate_config(
132140
self.endpoint = (
133141
f"https://{self.s3location.bucket_name}.s3.amazonaws.com"
134142
)
143+
logger.debug(f"Using {self.endpoint} as storage endpoint.")
135144
return use_accelerate_endpoint
136145

137146
@staticmethod

0 commit comments

Comments
 (0)