質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
AWS Lambda

AWS Lambdaは、クラウド上でアプリを実行できるコンピューティングサービス。サーバーのプロビジョニングや管理を要せず複数のイベントに対してコードを実行します。カスタムロジック用いた他AWSサービスの拡張やAWSの規模やパフォーマンスを用いたバックエンドサービスを作成できます。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

Q&A

0回答

1960閲覧

AWS sam initでのエラー (サンプルコード)

UTtomo

総合スコア4

AWS Lambda

AWS Lambdaは、クラウド上でアプリを実行できるコンピューティングサービス。サーバーのプロビジョニングや管理を要せず複数のイベントに対してコードを実行します。カスタムロジック用いた他AWSサービスの拡張やAWSの規模やパフォーマンスを用いたバックエンドサービスを作成できます。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

0グッド

1クリップ

投稿2020/04/01 01:23

編集2020/04/02 08:53

#AWSのSAMのサンプルコードを実行しようとしています。

こちらのページ(AWSホームページ)に従いAWSのSAMプログラムのサンプルコードを実装しています。
#環境
windows10
git : 2.26.0
#sam init で以下の内容のエラーが出ました。

イメージ説明

Error: Please verify your location. The following types of location are supported: * Github: gh:user/repo (or) https://github.com/user/repo (or) git@github.com:user/repo.git For Git repositories, you must use location of the root of the repository. * Mercurial: hg+ssh://hg@bitbucket.org/repo * Http(s): https://example.com/code.zip * Local Path: /path/to/code.zip

sam init はルートディレクトリで行いましたが、上のようなエラーが出てしまい困っております。
#エラーの詳細
sam init --debugで詳細のログを確認したところ、以下のように表示されました。

Parameters dict created with input given {'template': 'C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\local\init\templates\cookiecutter-aws-sam-hello-python', 'output_dir': '.', 'no_input': True, 'extra_context': {'project_name': 'sam-app', 'runtime': 'python3.8'}} Baking a new template with cookiecutter with all parameters Unable to find cookiecutter.json in the project. Downloading it directly without treating it as a cookiecutter template Downloading project from C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\local\init\templates\cookiecutter-aws-sam-hello-python to sam-app Sending Telemetry: {'metrics': [{'commandRun': {'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam init', 'duration': 14535, 'exitReason': 'ArbitraryProjectDownloadFailed', 'exitCode': 1, 'requestId': '56df9801-7ae7-4e3b-af20-6f1ef4a6ac15', 'installationId': '8077026c-858a-4ff1-8ce5-0a73c980cf80', 'sessionId': 'ecf42a91-5f31-4423-9627-de1c60d4b59c', 'executionEnvironment': 'CLI', 'pyversion': '3.7.6', 'samcliVersion': '0.47.0'}}]} HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)

#ご回答をよろしくお願いいたします。
この作業ができずに困っています。
もしわかる方がいらっしゃれば教えていただけたら幸いです。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

yu_1985

2020/04/01 07:56

sam init を実行したら即座にそのメッセージが出るんでしょうか?
UTtomo

2020/04/01 09:12

ご質問ありがとうございます。 はい、sam init のコマンドに対し、このような文章が返ってきます。
yu_1985

2020/04/01 10:00

それは「即座に」ではなく、いくつか入力を行った後ですね…。 gitは入ってるとのことですが、PowerShellからgitは使えますか?
hayao-k

2020/04/01 10:16

ご使用中のsam cli のバージョンを教えていただくことは可能でしょうか。
UTtomo

2020/04/01 14:54

yu_1985様 ありがとうございます。質問の趣旨を履き違えてしまい申し訳ありません。 はいpowershellからgitは使うことができます。
UTtomo

2020/04/01 14:55

hayao-k様 ご質問ありがとうございます。 SAM CLI, version 0.47.0 です。
hayao-k

2020/04/02 00:09

ありがとうございます。以前のバージョンで sam init に関連する不具合があったのですが ご使用中のバージョンでは既に修正されていますね。 https://github.com/awslabs/aws-sam-cli/pull/1694 sam init --debug を実行するとエラー時の詳細なログが出力されますので、参考になるかもしれません。
UTtomo

2020/04/02 07:58

hayao-k様 ありがとうございます。 おっしゃるとおり--debugをつけると以下のようなエラーコードが出ました。 Parameters dict created with input given {'template': 'C:\\Program Files\\Amazon\\AWSSAMCLI\\runtime\\lib\\site-packages\\samcli\\local\\init\\templates\\cookiecutter-aws-sam-hello-python', 'output_dir': '.', 'no_input': True, 'extra_context': {'project_name': 'sam-app', 'runtime': 'python3.8'}} Baking a new template with cookiecutter with all parameters Unable to find cookiecutter.json in the project. Downloading it directly without treating it as a cookiecutter template Downloading project from C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\local\init\templates\cookiecutter-aws-sam-hello-python to sam-app Sending Telemetry: {'metrics': [{'commandRun': {'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam init', 'duration': 14535, 'exitReason': 'ArbitraryProjectDownloadFailed', 'exitCode': 1, 'requestId': '56df9801-7ae7-4e3b-af20-6f1ef4a6ac15', 'installationId': '8077026c-858a-4ff1-8ce5-0a73c980cf80', 'sessionId': 'ecf42a91-5f31-4423-9627-de1c60d4b59c', 'executionEnvironment': 'CLI', 'pyversion': '3.7.6', 'samcliVersion': '0.47.0'}}]} HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1) ありがとうございます。質問も修正させていただきます。
yu_1985

2020/04/02 09:21

うーん、自分もdebugで同じようなメッセージが出ましたが、sam init自体は成功しています。 ちょっと再現させられないので検討つかないですね…すいません。Windows環境で試してみればわかるのかもしれませんが。 ルートディレクトリじゃなくて、明らかに書き込み権限のあるディレクトリ下で行ったら結果は変わりますか?
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問