-
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
Getting TypeError: load_config() got an unexpected keyword argument 'config_dict' when trying to run sam local start-api #536
Comments
Same here. All commands ran: ~/Work/sandbox: sam init
[+] Initializing project structure...
[SUCCESS] - Read sam-app/README.md for further instructions on how to proceed
[*] Project initialization is now complete
~/Work/sandbox: cd sam-app/
~/Work/sandbox/sam-app: sam local start-api
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/bin/sam", line 11, in <module>
sys.exit(cli())
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/samcli/commands/local/start_api/cli.py", line 56, in cli
docker_network, log_file, skip_pull_image, profile) # pragma: no cover
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/samcli/commands/local/start_api/cli.py", line 80, in do_cli
aws_profile=profile) as invoke_context:
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/samcli/commands/local/cli_common/invoke_context.py", line 93, in __enter__
self._check_docker_connectivity()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/samcli/commands/local/cli_common/invoke_context.py", line 284, in _check_docker_connectivity
docker_client = docker_client or docker.from_env()
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/docker/client.py", line 81, in from_env
**kwargs_from_env(**kwargs))
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/docker/client.py", line 38, in __init__
self.api = APIClient(*args, **kwargs)
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/docker/api/client.py", line 110, in __init__
config_dict=self._general_configs
TypeError: load_config() got an unexpected keyword argument 'config_dict'
~/Work/sandbox/sam-app: cat template.yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
sam-app
Sample SAM Template for sam-app
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Timeout: 3
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
CodeUri: hello_world/
Handler: app.lambda_handler
Runtime: nodejs8.10
Environment: # More info about Env Vars: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#environment-object
Variables:
PARAM1: VALUE
Events:
HelloWorld:
Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Properties:
Path: /hello
Method: get
Outputs:
HelloWorldApi:
Description: "API Gateway endpoint URL for Prod stage for Hello World function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/hello/"
HelloWorldFunction:
Description: "Hello World Lambda Function ARN"
Value: !GetAtt HelloWorldFunction.Arn
HelloWorldFunctionIamRole:
Description: "Implicit IAM Role created for Hello World function"
Value: !GetAtt HelloWorldFunctionRole.Arn
~/Work/sandbox/sam-app: echo '{}' | sam local invoke HelloWorldFunction
2018-07-05 15:26:03 Reading invoke payload from stdin (you can also pass it from file with --event)
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/bin/sam", line 11, in <module>
sys.exit(cli())
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/samcli/commands/local/invoke/cli.py", line 44, in cli
docker_network, log_file, skip_pull_image, profile) # pragma: no cover
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/samcli/commands/local/invoke/cli.py", line 70, in do_cli
aws_profile=profile) as context:
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/samcli/commands/local/cli_common/invoke_context.py", line 93, in __enter__
self._check_docker_connectivity()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/samcli/commands/local/cli_common/invoke_context.py", line 284, in _check_docker_connectivity
docker_client = docker_client or docker.from_env()
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/docker/client.py", line 81, in from_env
**kwargs_from_env(**kwargs))
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/docker/client.py", line 38, in __init__
self.api = APIClient(*args, **kwargs)
File "/Users/john.bland/Library/Python/3.6/lib/python/site-packages/docker/api/client.py", line 110, in __init__
config_dict=self._general_configs
TypeError: load_config() got an unexpected keyword argument 'config_dict' |
@johncblandii and @eranation This is happening for inside the docker client when trying to load your docker config. Here is an issue on docker-py about this error. Do either of you have docker and docker-py installed (a |
I was having the same issue, I checked that I had installed Thanks @jfuss |
Closing. This should no longer happen due to our installers we now have, as well. |
still happens El Capitan, latest docker, latest sam cli sam init File "/usr/local/homebrew/lib/python2.7/site-packages/flask/app.py", line 976, in add_url_rule |
Still happening (14th Jul 2019) |
I dont have docker-py installed |
@jpascoe I had the same issue but after installing awscli and aws-sam-cli using python3, it worked for me: pip3 install awscli aws-sam-cli |
If this is still happening, it is because you are still using pip and are installing into a place that has a flask version that does not work with SAM CLI. Instead, uninstall the cli with pip and install using our installers (homebrew for mac and linux, msi for windows). Instructions/steps to install are here. |
Description:
This is probably a docker version issue, but when trying out the example, I'm getting this error: TypeError: load_config() got an unexpected keyword argument 'config_dict'
Steps to reproduce the issue:
Observed result:
Error is printed (See below)
Expected result:
No errors
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
Mac. Sierra, 10.12.6
Python 2.7.10
pip 10.0.1 from /Library/Python/2.7/site-packages/pip (python 2.7)
Docker version 17.12.0-ce, build c97c6d6
Output of
sam --version
:SAM CLI, version 0.4.0
Optional Debug logs:
Add --debug flag to command you are running
This probably explains the root cause, I assume the docker config structure changed or something?
The text was updated successfully, but these errors were encountered: