From 1b70c304d17fdab24f329110b7375effefd0eaff Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Thu, 15 Jul 2021 16:49:48 +0200 Subject: [PATCH] workaround for https://github.com/boto/boto3/issues/125 --- src/toil/jobStores/aws/jobStore.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/toil/jobStores/aws/jobStore.py b/src/toil/jobStores/aws/jobStore.py index d42dc7750c..2347c96ea1 100644 --- a/src/toil/jobStores/aws/jobStore.py +++ b/src/toil/jobStores/aws/jobStore.py @@ -745,10 +745,20 @@ def bucket_creation_pending(error): logger.debug("Bucket '%s' does not exist.", bucket_name) if create: logger.debug("Creating bucket '%s'.", bucket_name) - location = region_to_bucket_location(self.region) - bucket = self.s3_resource.create_bucket( - Bucket=bucket_name, - CreateBucketConfiguration={'LocationConstraint': location}) + location = self.region + if ( + location == "us-east-1" + ): # see https://github.com/boto/boto3/issues/125 + bucket = self.s3_resource.create_bucket( + Bucket=bucket_name + ) + else: + bucket = self.s3_resource.create_bucket( + Bucket=bucket_name, + CreateBucketConfiguration={ + "LocationConstraint": location + }, + ) # Wait until the bucket exists before checking the region and adding tags bucket.wait_until_exists()