3

以下の aws-sam-cli 公式チュートリアルを実行するとエラーが発生しました。
https://github.com/awslabs/aws-sam-cli#invoke-functions-locally

チュートリアルでは、以下のコマンドは関数を呼び出していると書かれています。

$ sam local invoke "Ratings" -e event.json

しかし、以下のチュートリアルを行ったところ、template.yaml に「HelloWorldFunction」というリソースがありました。

$ sam init

だから、私は以下のコマンドを挿入しました。

$ sam local invoke HelloWorldFunction -e event.json

そして、エラーが発生しました。

2018-06-26 18:44:21 Invoking app.lambda_handler (nodejs8.10)
2018-06-26 18:44:21 Found credentials in shared credentials file: ~/.aws/credentials
Traceback (most recent call last):
  File "/Users/XXXX/.local/lib/python3.6/site-packages/samcli/local/docker/manager.py", line 108, in has_image
    self.docker_client.images.get(image_name)
AttributeError: 'function' object has no attribute 'get'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/XXXX/.local/bin/sam", line 11, in <module>
    load_entry_point('aws-sam-cli==0.4.0', 'console_scripts', 'sam')()
  File "/Users/XXXX/.pyenv/versions/3.6.0/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/XXXX/.pyenv/versions/3.6.0/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/XXXX/.pyenv/versions/3.6.0/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/XXXX/.pyenv/versions/3.6.0/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/XXXX/.pyenv/versions/3.6.0/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/XXXX/.pyenv/versions/3.6.0/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/XXXX/.pyenv/versions/3.6.0/lib/python3.6/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "/Users/XXXX/.pyenv/versions/3.6.0/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/XXXX/.local/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 "/Users/XXXX/.local/lib/python3.6/site-packages/samcli/commands/local/invoke/cli.py", line 76, in do_cli
    stderr=context.stderr)
  File "/Users/XXXX/.local/lib/python3.6/site-packages/samcli/commands/local/lib/local_lambda.py", line 80, in invoke
    stdout=stdout, stderr=stderr)
  File "/Users/XXXX/.local/lib/python3.6/site-packages/samcli/local/lambdafn/runtime.py", line 83, in invoke
    self._container_manager.run(container)
  File "/Users/XXXX/.local/lib/python3.6/site-packages/samcli/local/docker/manager.py", line 52, in run
    if not self.has_image(image_name) or not self.skip_pull_image:
  File "/Users/XXXX/.local/lib/python3.6/site-packages/samcli/local/docker/manager.py", line 110, in has_image
    except docker.errors.ImageNotFound:
AttributeError: module 'docker.errors' has no attribute 'ImageNotFound'

macOS High Sierra 10.13.3 を使用しています。

4

0 に答える 0