SHARE
TWEET

Untitled

v_Enhance Sep 15th, 2019 126 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. evan@ArchScythe ~/Downloads
  2. $ mkdir sam-helloworld
  3. evan@ArchScythe ~/Downloads
  4. $ cd sam-helloworld/
  5. evan@ArchScythe ~/Do/sam-helloworld
  6. $ virtualenv venv
  7. Using base prefix '/usr'
  8. New python executable in /home/evan/Downloads/sam-helloworld/venv/bin/python
  9. Installing setuptools, pip, wheel...
  10. done.
  11. evan@ArchScythe ~/Do/sam-helloworld
  12. $ source venv/bin/activate.fish
  13. (venv) evan@ArchScythe ~/Do/sam-helloworld
  14. $ pip install aws-sam-cli
  15. Collecting aws-sam-cli
  16.   Using cached https://files.pythonhosted.org/packages/17/c5/8965471506ebf7093119e2d1319a60a85d421586ef65bdbdc1a743436d3b/aws_sam_cli-0.21.0-py3-none-any.whl
  17. Collecting cookiecutter~=1.6.0 (from aws-sam-cli)
  18.   Using cached https://files.pythonhosted.org/packages/16/99/1ca3a75978270288354f419e9166666801cf7e7d8df984de44a7d5d8b8d0/cookiecutter-1.6.0-py2.py3-none-any.whl
  19. Collecting serverlessrepo==0.1.9 (from aws-sam-cli)
  20.   Using cached https://files.pythonhosted.org/packages/69/a8/3500d8ecd5e14a94b771e5f78a35313f94232cbde41b37888ce88fd9e07c/serverlessrepo-0.1.9-py2.py3-none-any.whl
  21. Collecting aws-lambda-builders==0.4.0 (from aws-sam-cli)
  22.   Using cached https://files.pythonhosted.org/packages/84/c4/408668c8289ba74f03ed6e8015499248e3990629cb85d97e0f72e4bee421/aws_lambda_builders-0.4.0-py3-none-any.whl
  23. Collecting chevron~=0.12 (from aws-sam-cli)
  24.   Using cached https://files.pythonhosted.org/packages/a3/1e/6ef58385f54c5bbf70b3b451930015aa2d30b3cd5ae324bba4da77c5b889/chevron-0.13.1-py3-none-any.whl
  25. Collecting requests==2.22.0 (from aws-sam-cli)
  26.   Using cached https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl
  27. Collecting Flask~=1.0.2 (from aws-sam-cli)
  28.   Using cached https://files.pythonhosted.org/packages/d8/94/7350820ae209ccdba073f83220cea1c376f2621254d1e0e82609c9a65e58/Flask-1.0.4-py2.py3-none-any.whl
  29. Collecting python-dateutil~=2.6 (from aws-sam-cli)
  30.   Using cached https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl
  31. Collecting aws-sam-translator==1.11.0 (from aws-sam-cli)
  32. Collecting boto3>=1.9.56,~=1.9 (from aws-sam-cli)
  33.   Using cached https://files.pythonhosted.org/packages/16/e4/91e772079f1a5f48262da2d47136eb96a14348f320a96382ecff3aaaf7c9/boto3-1.9.228-py2.py3-none-any.whl
  34. Collecting docker~=4.0 (from aws-sam-cli)
  35.   Using cached https://files.pythonhosted.org/packages/95/47/5560c9cf0c92b50da24216f0e7733250fbed5a497f69e3c70e1be62143fe/docker-4.0.2-py2.py3-none-any.whl
  36. Collecting click~=7.0 (from aws-sam-cli)
  37.   Using cached https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl
  38. Collecting PyYAML~=5.1 (from aws-sam-cli)
  39. Collecting six~=1.11.0 (from aws-sam-cli)
  40.   Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
  41. Collecting dateparser~=0.7 (from aws-sam-cli)
  42.   Using cached https://files.pythonhosted.org/packages/a0/30/5cb8bb214c0b111fb59137c2e19c636a136209dbe45e1c3e9d63f7a76c1a/dateparser-0.7.1-py2.py3-none-any.whl
  43. Collecting binaryornot>=0.2.0 (from cookiecutter~=1.6.0->aws-sam-cli)
  44.   Using cached https://files.pythonhosted.org/packages/24/7e/f7b6f453e6481d1e233540262ccbfcf89adcd43606f44a028d7f5fae5eb2/binaryornot-0.4.4-py2.py3-none-any.whl
  45. Collecting future>=0.15.2 (from cookiecutter~=1.6.0->aws-sam-cli)
  46. Collecting jinja2>=2.7 (from cookiecutter~=1.6.0->aws-sam-cli)
  47.   Using cached https://files.pythonhosted.org/packages/1d/e7/fd8b501e7a6dfe492a433deb7b9d833d39ca74916fa8bc63dd1a4947a671/Jinja2-2.10.1-py2.py3-none-any.whl
  48. Collecting whichcraft>=0.4.0 (from cookiecutter~=1.6.0->aws-sam-cli)
  49.   Using cached https://files.pythonhosted.org/packages/b5/a2/81887a0dae2e4d2adc70d9a3557fdda969f863ced51cd3c47b587d25bce5/whichcraft-0.6.1-py2.py3-none-any.whl
  50. Collecting jinja2-time>=0.1.0 (from cookiecutter~=1.6.0->aws-sam-cli)
  51.   Using cached https://files.pythonhosted.org/packages/6a/a1/d44fa38306ffa34a7e1af09632b158e13ec89670ce491f8a15af3ebcb4e4/jinja2_time-0.2.0-py2.py3-none-any.whl
  52. Collecting poyo>=0.1.0 (from cookiecutter~=1.6.0->aws-sam-cli)
  53.   Using cached https://files.pythonhosted.org/packages/42/50/0b0820601bde2eda403f47b9a4a1f270098ed0dd4c00c443d883164bdccc/poyo-0.5.0-py2.py3-none-any.whl
  54. Requirement already satisfied: wheel in ./venv/lib/python3.7/site-packages (from aws-lambda-builders==0.4.0->aws-sam-cli) (0.33.6)
  55. Requirement already satisfied: setuptools in ./venv/lib/python3.7/site-packages (from aws-lambda-builders==0.4.0->aws-sam-cli) (41.2.0)
  56. Collecting certifi>=2017.4.17 (from requests==2.22.0->aws-sam-cli)
  57.   Using cached https://files.pythonhosted.org/packages/18/b0/8146a4f8dd402f60744fa380bc73ca47303cccf8b9190fd16a827281eac2/certifi-2019.9.11-py2.py3-none-any.whl
  58. Collecting idna<2.9,>=2.5 (from requests==2.22.0->aws-sam-cli)
  59.   Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
  60. Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests==2.22.0->aws-sam-cli)
  61.   Using cached https://files.pythonhosted.org/packages/e6/60/247f23a7121ae632d62811ba7f273d0e58972d75e58a94d329d51550a47d/urllib3-1.25.3-py2.py3-none-any.whl
  62. Collecting chardet<3.1.0,>=3.0.2 (from requests==2.22.0->aws-sam-cli)
  63.   Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
  64. Collecting itsdangerous>=0.24 (from Flask~=1.0.2->aws-sam-cli)
  65.   Using cached https://files.pythonhosted.org/packages/76/ae/44b03b253d6fade317f32c24d100b3b35c2239807046a4c953c7b89fa49e/itsdangerous-1.1.0-py2.py3-none-any.whl
  66. Collecting Werkzeug>=0.14 (from Flask~=1.0.2->aws-sam-cli)
  67.   Using cached https://files.pythonhosted.org/packages/b7/61/c0a1adf9ad80db012ed7191af98fa05faa95fa09eceb71bb6fa8b66e6a43/Werkzeug-0.15.6-py2.py3-none-any.whl
  68. Collecting jsonschema~=2.6 (from aws-sam-translator==1.11.0->aws-sam-cli)
  69.   Using cached https://files.pythonhosted.org/packages/77/de/47e35a97b2b05c2fadbec67d44cfcdcd09b8086951b331d82de90d2912da/jsonschema-2.6.0-py2.py3-none-any.whl
  70. Collecting botocore<1.13.0,>=1.12.228 (from boto3>=1.9.56,~=1.9->aws-sam-cli)
  71.   Using cached https://files.pythonhosted.org/packages/f7/5c/b66a2241e5030c491f982c6b9646c008559aa7cd7f4448f643e8ed9f15e5/botocore-1.12.228-py2.py3-none-any.whl
  72. Collecting jmespath<1.0.0,>=0.7.1 (from boto3>=1.9.56,~=1.9->aws-sam-cli)
  73.   Using cached https://files.pythonhosted.org/packages/83/94/7179c3832a6d45b266ddb2aac329e101367fbdb11f425f13771d27f225bb/jmespath-0.9.4-py2.py3-none-any.whl
  74. Collecting s3transfer<0.3.0,>=0.2.0 (from boto3>=1.9.56,~=1.9->aws-sam-cli)
  75.   Using cached https://files.pythonhosted.org/packages/16/8a/1fc3dba0c4923c2a76e1ff0d52b305c44606da63f718d14d3231e21c51b0/s3transfer-0.2.1-py2.py3-none-any.whl
  76. Collecting websocket-client>=0.32.0 (from docker~=4.0->aws-sam-cli)
  77.   Using cached https://files.pythonhosted.org/packages/29/19/44753eab1fdb50770ac69605527e8859468f3c0fd7dc5a76dd9c4dbd7906/websocket_client-0.56.0-py2.py3-none-any.whl
  78. Collecting regex (from dateparser~=0.7->aws-sam-cli)
  79. Collecting pytz (from dateparser~=0.7->aws-sam-cli)
  80.   Using cached https://files.pythonhosted.org/packages/87/76/46d697698a143e05f77bec5a526bf4e56a0be61d63425b68f4ba553b51f2/pytz-2019.2-py2.py3-none-any.whl
  81. Collecting tzlocal (from dateparser~=0.7->aws-sam-cli)
  82.   Using cached https://files.pythonhosted.org/packages/ef/99/53bd1ac9349262f59c1c421d8fcc2559ae8a5eeffed9202684756b648d33/tzlocal-2.0.0-py2.py3-none-any.whl
  83. Collecting MarkupSafe>=0.23 (from jinja2>=2.7->cookiecutter~=1.6.0->aws-sam-cli)
  84.   Using cached https://files.pythonhosted.org/packages/98/7b/ff284bd8c80654e471b769062a9b43cc5d03e7a615048d96f4619df8d420/MarkupSafe-1.1.1-cp37-cp37m-manylinux1_x86_64.whl
  85. Collecting arrow (from jinja2-time>=0.1.0->cookiecutter~=1.6.0->aws-sam-cli)
  86.   Using cached https://files.pythonhosted.org/packages/cc/f5/f618f8423fe674a60461e58683edfeead93f4bbf95b9fca0e9699e765b35/arrow-0.15.2-py2.py3-none-any.whl
  87. Collecting docutils<0.16,>=0.10 (from botocore<1.13.0,>=1.12.228->boto3>=1.9.56,~=1.9->aws-sam-cli)
  88.   Using cached https://files.pythonhosted.org/packages/22/cd/a6aa959dca619918ccb55023b4cb151949c64d4d5d55b3f4ffd7eee0c6e8/docutils-0.15.2-py3-none-any.whl
  89. Installing collected packages: chardet, binaryornot, click, future, MarkupSafe, jinja2, certifi, idna, urllib3, requests, whichcraft, six, python-dateutil, arrow, jinja2-time, poyo, cookiecutter, docutils, jmespath, botocore, s3transfer, boto3, PyYAML, serverlessrepo, aws-lambda-builders, chevron, itsdangerous, Werkzeug, Flask, jsonschema, aws-sam-translator, websocket-client, docker, regex, pytz, tzlocal, dateparser, aws-sam-cli
  90. Successfully installed Flask-1.0.4 MarkupSafe-1.1.1 PyYAML-5.1.2 Werkzeug-0.15.6 arrow-0.15.2 aws-lambda-builders-0.4.0 aws-sam-cli-0.21.0 aws-sam-translator-1.11.0 binaryornot-0.4.4 boto3-1.9.228 botocore-1.12.228 certifi-2019.9.11 chardet-3.0.4 chevron-0.13.1 click-7.0 cookiecutter-1.6.0 dateparser-0.7.1 docker-4.0.2 docutils-0.15.2 future-0.17.1 idna-2.8 itsdangerous-1.1.0 jinja2-2.10.1 jinja2-time-0.2.0 jmespath-0.9.4 jsonschema-2.6.0 poyo-0.5.0 python-dateutil-2.8.0 pytz-2019.2 regex-2019.8.19 requests-2.22.0 s3transfer-0.2.1 serverlessrepo-0.1.9 six-1.11.0 tzlocal-2.0.0 urllib3-1.25.3 websocket-client-0.56.0 whichcraft-0.6.1
  91. (venv) evan@ArchScythe ~/Do/sam-helloworld
  92. $ sam init --runtime python3.7
  93. [+] Initializing project structure...
  94.  
  95. Project generated: ./sam-app
  96.  
  97. Steps you can take next within the project folder
  98. ===================================================
  99. [*] Invoke Function: sam local invoke HelloWorldFunction --event event.json
  100. [*] Start API Gateway locally: sam local start-api
  101.  
  102. Read sam-app/README.md for further instructions
  103.  
  104. [*] Project initialization is now complete
  105. (venv) evan@ArchScythe ~/Do/sam-helloworld
  106. $ ls
  107. sam-app  venv
  108. (venv) evan@ArchScythe ~/Do/sam-helloworld
  109. $ cd sam-app
  110. (venv) evan@ArchScythe ~/Do/sa/sam-app
  111. $ sam build
  112. Building resource 'HelloWorldFunction'
  113. Running PythonPipBuilder:ResolveDependencies
  114. Running PythonPipBuilder:CopySource
  115.  
  116. Build Succeeded
  117.  
  118. Built Artifacts  : .aws-sam/build
  119. Built Template   : .aws-sam/build/template.yaml
  120.  
  121. Commands you can use next
  122. =========================
  123. [*] Invoke Function: sam local invoke
  124. [*] Package: sam package --s3-bucket <yourbucket>
  125.    
  126. (venv) evan@ArchScythe ~/Do/sa/sam-app
  127. $ sam local invoke HelloWorldFunction --event events/event.json
  128. Invoking app.lambda_handler (python3.7)
  129. 2019-09-15 12:11:16 Found credentials in AWS_CREDENTIAL_FILE.
  130.  
  131. Fetching lambci/lambda:python3.7 Docker container image......
  132. Mounting /home/evan/Downloads/sam-helloworld/sam-app/.aws-sam/build/HelloWorldFunction as /var/task:ro,delegated inside runtime container
  133. Traceback (most recent call last):
  134.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/docker/api/client.py", line 261, in _raise_for_status
  135.     response.raise_for_status()
  136.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
  137.     raise HTTPError(http_error_msg, response=self)
  138. requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http+docker://localhost/v1.35/containers/51af2a1c32718a46e283c28e18445706d22be43989a7da476a2798e2b168f191/start
  139.  
  140. During handling of the above exception, another exception occurred:
  141.  
  142. Traceback (most recent call last):
  143.   File "/home/evan/Downloads/sam-helloworld/venv/bin/sam", line 10, in <module>
  144.     sys.exit(cli())
  145.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
  146.     return self.main(*args, **kwargs)
  147.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/click/core.py", line 717, in main
  148.     rv = self.invoke(ctx)
  149.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
  150.     return _process_result(sub_ctx.command.invoke(sub_ctx))
  151.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
  152.     return _process_result(sub_ctx.command.invoke(sub_ctx))
  153.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/click/core.py", line 956, in invoke
  154.     return ctx.invoke(self.callback, **ctx.params)
  155.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/click/core.py", line 555, in invoke
  156.     return callback(*args, **kwargs)
  157.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/click/decorators.py", line 64, in new_func
  158.     return ctx.invoke(f, obj, *args, **kwargs)
  159.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/click/core.py", line 555, in invoke
  160.     return callback(*args, **kwargs)
  161.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/samcli/lib/telemetry/metrics.py", line 94, in wrapped
  162.     raise exception  # pylint: disable=raising-bad-type
  163.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/samcli/lib/telemetry/metrics.py", line 65, in wrapped
  164.     return_value = func(*args, **kwargs)
  165.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/samcli/commands/local/invoke/cli.py", line 58, in cli
  166.     parameter_overrides)  # pragma: no cover
  167.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/samcli/commands/local/invoke/cli.py", line 102, in do_cli
  168.     stderr=context.stderr)
  169.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/samcli/commands/local/lib/local_lambda.py", line 93, in invoke
  170.     self.local_runtime.invoke(config, event, debug_context=self.debug_context, stdout=stdout, stderr=stderr)
  171.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/samcli/local/lambdafn/runtime.py", line 86, in invoke
  172.     self._container_manager.run(container)
  173.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/samcli/local/docker/manager.py", line 98, in run
  174.     container.start(input_data=input_data)
  175.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/samcli/local/docker/container.py", line 189, in start
  176.     real_container.start()
  177.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/docker/models/containers.py", line 400, in start
  178.     return self.client.api.start(self.id, **kwargs)
  179.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/docker/utils/decorators.py", line 19, in wrapped
  180.     return f(self, resource_id, *args, **kwargs)
  181.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/docker/api/container.py", line 1093, in start
  182.     self._raise_for_status(res)
  183.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/docker/api/client.py", line 263, in _raise_for_status
  184.     raise create_api_error_from_http_exception(e)
  185.   File "/home/evan/Downloads/sam-helloworld/venv/lib/python3.7/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
  186.     raise cls(e, response=response, explanation=explanation)
  187. docker.errors.APIError: 400 Client Error: Bad Request ("OCI runtime create failed: container_linux.go:345: starting container process caused "chdir to cwd (\"/var/task\") set in config.json failed: permission denied": unknown")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top