Skip to content
This repository has been archived by the owner on Aug 4, 2024. It is now read-only.

Cannot use us-east-1 location in dstack config #2

Closed
eafpres opened this issue Sep 1, 2022 · 0 comments
Closed

Cannot use us-east-1 location in dstack config #2

eafpres opened this issue Sep 1, 2022 · 0 comments

Comments

@eafpres
Copy link

eafpres commented Sep 1, 2022

Windows 11 (preview), Powershell.

(python38) PS C:\Users\bbate> aws configure list-profiles
eb-cli
default
autonet
(python38) PS C:\Users\bbate> aws configure list --profile default
      Name                    Value             Type    Location
      ----                    -----             ----    --------
   profile                  default           manual    --profile
access_key     ****************LZZW shared-credentials-file
secret_key     ****************vcH8 shared-credentials-file
    region                us-east-1      config-file    ~/.aws/config

(python38) PS C:\Users\bbate> dstack config
Configure AWS backend:

AWS profile name (default):
S3 bucket name (test-dstack): eaf-test-dstack
Region name (us-east-1):
The bucket 'eaf-test-dstack' doesn't exist. Create it? [y/n]: y

Traceback (most recent call last):
  File "c:\users\bbate\python38\lib\site-packages\dstack\aws\config.py", line 9, in configure
    s3_client.head_bucket(Bucket=bucket_name)
  File "c:\users\bbate\python38\lib\site-packages\botocore\client.py", line 388, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "c:\users\bbate\python38\lib\site-packages\botocore\client.py", line 708, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (404) when calling the HeadBucket operation: Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\bbate\appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\bbate\appdata\local\programs\python\python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\bbate\python38\Scripts\dstack.exe\__main__.py", line 7, in <module>
  File "c:\users\bbate\python38\lib\site-packages\dstack\cli\main.py", line 68, in main
    args.func(args)
  File "c:\users\bbate\python38\lib\site-packages\dstack\cli\config.py", line 36, in config_func
    backend.configure(silent=False)
  File "c:\users\bbate\python38\lib\site-packages\dstack\aws\__init__.py", line 44, in configure
    config.configure(self._iam_client(), self._s3_client(), self.backend_config.bucket_name,
  File "c:\users\bbate\python38\lib\site-packages\dstack\aws\config.py", line 12, in configure
    s3_client.create_bucket(Bucket=bucket_name, CreateBucketConfiguration={
  File "c:\users\bbate\python38\lib\site-packages\botocore\client.py", line 388, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "c:\users\bbate\python38\lib\site-packages\botocore\client.py", line 708, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidLocationConstraint) when calling the CreateBucket operation: The specified location-constraint is not valid

This problem is due to the AWS API not accepting us-east-1 as a LocationConstraint, apparently due to it being the default for S3 creation. It is mentioned in this issue for boto3:

boto/boto3#125

It appears to be a known issue, not likely fixed soon, so it should be handled on the dstack side.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants