-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
local invoke command causes botocore.exceptions.NoRegionError: #885
Comments
local invoke
causes botocore.exceptions.NoRegionError:
This is causes by a boto3 client being instantiated in SAM when it isn't needed too. It was fixed here: aws/serverless-application-model#697. We are waiting for SAM (aws-sam-translator) to cut a new release with the fix. Until then, you can set the default region through |
SAM release a patched (1.9.1) that included the fix for this. We bumped the version in #990 so this will be released with the next SAM CLI version. Moving into Release 0.12.0 Milestone. |
This was released with v0.12.0 Closing |
upgrade sam-cli but still see the issue
I am using python 3.6. with venv |
I get this issue as well, with christinejiang at Christine-MBP in ~/Integral/sam-app on master*
$ sam --version
SAM CLI, version 0.13.0
christinejiang at Christine-MBP in ~/Integral/sam-app on master*
$ sam local start-api
2019-03-12 18:51:43 Found credentials in shared credentials file: ~/.aws/credentials
Traceback (most recent call last):
File "/usr/local/bin/sam", line 11, in <module>
load_entry_point('aws-sam-cli==0.13.0', 'console_scripts', 'sam')()
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/samcli/commands/local/start_api/cli.py", line 57, in cli
parameter_overrides) # pragma: no cover
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/samcli/commands/local/start_api/cli.py", line 91, in do_cli
static_dir=static_dir)
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/samcli/commands/local/lib/local_api_service.py", line 44, in __init__
self.lambda_runner = lambda_invoke_context.local_lambda_runner
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/samcli/commands/local/cli_common/invoke_context.py", line 191, in local_lambda_runner
layer_downloader = LayerDownloader(self._layer_cache_basedir, self.get_cwd())
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/samcli/local/layers/layer_downloader.py", line 39, in __init__
self.lambda_client = lambda_client or boto3.client('lambda')
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/boto3/__init__.py", line 91, in client
return _get_default_session().client(*args, **kwargs)
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/boto3/session.py", line 263, in client
aws_session_token=aws_session_token, config=config)
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/botocore/session.py", line 838, in create_client
client_config=config, api_version=api_version)
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/botocore/client.py", line 86, in create_client
verify, credentials, scoped_config, client_config, endpoint_bridge)
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/botocore/client.py", line 328, in _get_client_args
verify, credentials, scoped_config, client_config, endpoint_bridge)
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/botocore/args.py", line 47, in get_client_args
endpoint_url, is_secure, scoped_config)
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/botocore/args.py", line 117, in compute_client_args
service_name, region_name, endpoint_url, is_secure)
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/botocore/client.py", line 402, in resolve
service_name, region_name)
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/botocore/regions.py", line 122, in construct_endpoint
partition, service_name, region_name)
File "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/botocore/regions.py", line 135, in _endpoint_for_partition
raise NoRegionError()
botocore.exceptions.NoRegionError: You must specify a region. |
i have aws-sam-cli v 0.13.0 and this error is happening. i found i could work around it by providing the region on the command line.
|
@ghouston Looks like there was another path that this happened on. Just submitted a PR to address it |
I am using version 0.15.0 of AWS SAM CLI and this error is still appearing. |
I had the same problem. Type this into your terminal: |
Still happening in 0.16.0 when running |
The PR is still open: #1059 which is why it is 'still happening'. There are some failure happening in Travis that I can't reproduce locally at the moment. That is the current hold up. |
#1059 was just merged and will go out with our next release. This should fix the |
Description
The
sam local invoke
command produces abotocore.exceptions.NoRegionError
exception, which prevents its use.#583 Fixed this for the sample code it seems
Steps to reproduce
On Mac OS:
echo '{"message": "Hey, are you there?" }' | sam local invoke "Signup"
. The function name doesn't matter; it can be anything.Observed result
Expected result
I expected to see my function run locally
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: SAM CLI, version 0.10.0The text was updated successfully, but these errors were encountered: