@@ -230,19 +230,31 @@ def _get_s3_client(self, endpoint_url: Optional[str] = None) -> boto3.client:
230
230
raise ValueError ("CLOUDFLARE_ACCOUNT_ID environment variable is required for R2 storage" )
231
231
endpoint_url = f"https://{ account_id } .r2.cloudflarestorage.com"
232
232
233
+ # Log the configuration being used
234
+ logger .info ("🟠☁️ Creating S3 client with configuration:" )
235
+ logger .info (f"Endpoint URL: { endpoint_url } " )
236
+ logger .info (f"Access Key ID present: { bool (os .getenv ('R2_ACCESS_KEY_ID' ))} " )
237
+ logger .info (f"Secret Access Key present: { bool (os .getenv ('R2_SECRET_ACCESS_KEY' ))} " )
238
+
233
239
client_kwargs = {
234
240
'service_name' : 's3' ,
235
241
'endpoint_url' : endpoint_url ,
236
242
'aws_access_key_id' : os .getenv ('R2_ACCESS_KEY_ID' ),
237
243
'aws_secret_access_key' : os .getenv ('R2_SECRET_ACCESS_KEY' ),
238
- 'region_name' : os .getenv ('R2_REGION' , 'auto' ), # Default to 'auto' if not specified
239
- # R2 compatibility settings
244
+ 'region_name' : os .getenv ('R2_REGION' , 'auto' ),
240
245
'config' : boto3 .Config (
241
246
request_checksum_calculation = 'WHEN_REQUIRED' ,
242
247
response_checksum_validation = 'WHEN_REQUIRED'
243
248
)
244
249
}
245
250
251
+ # Log the actual values being used (without exposing secrets)
252
+ logger .info ("S3 client kwargs:" )
253
+ safe_kwargs = client_kwargs .copy ()
254
+ if 'aws_secret_access_key' in safe_kwargs :
255
+ safe_kwargs ['aws_secret_access_key' ] = '***'
256
+ logger .info (f"Client kwargs: { safe_kwargs } " )
257
+
246
258
# Remove None values
247
259
client_kwargs = {k : v for k , v in client_kwargs .items () if v is not None }
248
260
0 commit comments