aws / aws-sam-cli

CLI tool to build, test, debug, and deploy Serverless applications using AWS SAM
https://aws.amazon.com/serverless/sam/
Apache License 2.0
6.51k stars 1.17k forks source link

Local invoke fails for dotnetcore2.1 when there is a --template argument #1229

Closed mpiroc closed 5 years ago

mpiroc commented 5 years ago

Description

When I run sam local invoke without specifying a template, it succeeds. But if I do specify a template (event the same template, from the same working directory), the invocation throws.

Steps to reproduce

sam init -r dotnetcore2.1 --debug
cd .\sam-app\
sam build --debug
sam local invoke HelloWorldFunction --no-event --debug
sam local invoke HelloWorldFunction --no-event --template ./template.yaml --debug
sam local invoke HelloWorldFunction --no-event --template /absolute/path/to/sam-app/template.yaml --debug

Observed result

**********************
PowerShell transcript start
Start time: 20190617155707
Username: ANT\pirocchi
RunAs User: ANT\pirocchi
Configuration Name: 
Machine: SEA-9901443231 (Microsoft Windows NT 10.0.17134.0)
Host Application: C:\Program Files\PowerShell\6\pwsh.dll -WorkingDirectory ~
Process ID: 2540
PSVersion: 6.1.0
PSEdition: Core
GitCommitId: 6.1.0
OS: Microsoft Windows 10.0.17134 
Platform: Win32NT
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.10032.0, 6.1.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1
WSManStackVersion: 3.0
**********************
Transcript started, output file is C:\Users\pirocchi\Documents\PowerShell_transcript.SEA-9901443231.cwxmzJZn.20190617155707.txt
PS C:\Users\pirocchi\repro> sam init -r dotnetcore2.1 --debug
2019-06-17 15:57:17 Init command
[+] Initializing project structure...
2019-06-17 15:57:17 Parameters dict created with input given
2019-06-17 15:57:17 {'template': 'C:\\Program Files\\Amazon\\AWSSAMCLI\\runtime\\lib\\site-packages\\samcli\\local\\init\\templates\\cookiecutter-aws-sam-hello-dotnet', 'output_dir': '.', 'no_input': False}
2019-06-17 15:57:17 Parameters dict updated with project name as extra_context
2019-06-17 15:57:17 {'template': 'C:\\Program Files\\Amazon\\AWSSAMCLI\\runtime\\lib\\site-packages\\samcli\\local\\init\\templates\\cookiecutter-aws-sam-hello-dotnet', 'output_dir': '.', 'no_input': True, 'extra_context': {'project_name': 'sam-app', 'runtime': 'dotnetcore2.1'}}
2019-06-17 15:57:17 Baking a new template with cookiecutter with all parameters
2019-06-17 15:57:17 context_file is C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\local\init\templates\cookiecutter-aws-sam-hello-dotnet\cookiecutter.json
2019-06-17 15:57:17 Context generated is {'cookiecutter': OrderedDict([('project_name', 'sam-app'), ('runtime', 'dotnetcore2.1')])}
2019-06-17 15:57:17 Making sure path exists: C:\Users\pirocchi/.cookiecutter_replay/
2019-06-17 15:57:17 Searching C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\local\init\templates\cookiecutter-aws-sam-hello-dotnet for the project template.
2019-06-17 15:57:17 The project template appears to be C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\local\init\templates\cookiecutter-aws-sam-hello-dotnet\{{cookiecutter.project_name}}
2019-06-17 15:57:17 Generating project from C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\local\init\templates\cookiecutter-aws-sam-hello-dotnet\{{cookiecutter.project_name}}...
2019-06-17 15:57:17 Rendered dir sam-app must exist in output_dir .
2019-06-17 15:57:17 Making sure path exists: sam-app
2019-06-17 15:57:17 Created directory at: sam-app
2019-06-17 15:57:17 Project directory is C:\Users\pirocchi\repro\sam-app
2019-06-17 15:57:17 hooks_dir is C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\local\init\templates\cookiecutter-aws-sam-hello-dotnet\hooks
2019-06-17 15:57:17 No hooks/ dir in template_dir
2019-06-17 15:57:17 No pre_gen_project hook found
2019-06-17 15:57:17 Rendered dir C:\Users\pirocchi\repro\sam-app\src must exist in output_dir .
2019-06-17 15:57:17 Making sure path exists: C:\Users\pirocchi\repro\sam-app\src
2019-06-17 15:57:17 Created directory at: C:\Users\pirocchi\repro\sam-app\src
2019-06-17 15:57:17 Rendered dir C:\Users\pirocchi\repro\sam-app\test must exist in output_dir .
2019-06-17 15:57:17 Making sure path exists: C:\Users\pirocchi\repro\sam-app\test
2019-06-17 15:57:17 Created directory at: C:\Users\pirocchi\repro\sam-app\test
2019-06-17 15:57:17 Processing file .gitignore
2019-06-17 15:57:17 Created file at C:\Users\pirocchi\repro\sam-app\.gitignore
2019-06-17 15:57:17 Check .gitignore to see if it's a binary
2019-06-17 15:57:17 is_binary: '.gitignore'
2019-06-17 15:57:17 nontext_ratio1: 0.0
2019-06-17 15:57:17 nontext_ratio2: 1.0
2019-06-17 15:57:17 is_likely_binary: False
2019-06-17 15:57:17 detected_encoding: {'encoding': 'ascii', 'confidence': 1.0, 'language': ''}
2019-06-17 15:57:17 failure: decodable_as_unicode: False
2019-06-17 15:57:17 Writing contents to file C:\Users\pirocchi\repro\sam-app\.gitignore
2019-06-17 15:57:17 Processing file omnisharp.json
2019-06-17 15:57:17 Created file at C:\Users\pirocchi\repro\sam-app\omnisharp.json
2019-06-17 15:57:17 Check omnisharp.json to see if it's a binary
2019-06-17 15:57:17 is_binary: 'omnisharp.json'
2019-06-17 15:57:17 nontext_ratio1: 0.0
2019-06-17 15:57:17 nontext_ratio2: 1.0
2019-06-17 15:57:17 is_likely_binary: False
2019-06-17 15:57:17 detected_encoding: {'encoding': 'ascii', 'confidence': 1.0, 'language': ''}
2019-06-17 15:57:17 failure: decodable_as_unicode: False
2019-06-17 15:57:17 Writing contents to file C:\Users\pirocchi\repro\sam-app\omnisharp.json
2019-06-17 15:57:17 Processing file README.md
2019-06-17 15:57:17 Created file at C:\Users\pirocchi\repro\sam-app\README.md
2019-06-17 15:57:17 Check README.md to see if it's a binary
2019-06-17 15:57:17 is_binary: 'README.md'
2019-06-17 15:57:17 nontext_ratio1: 0.0
2019-06-17 15:57:17 nontext_ratio2: 1.0
2019-06-17 15:57:17 is_likely_binary: False
2019-06-17 15:57:17 detected_encoding: {'encoding': 'ascii', 'confidence': 1.0, 'language': ''}
2019-06-17 15:57:17 failure: decodable_as_unicode: False
2019-06-17 15:57:17 Writing contents to file C:\Users\pirocchi\repro\sam-app\README.md
2019-06-17 15:57:17 Processing file template.yaml
2019-06-17 15:57:17 Created file at C:\Users\pirocchi\repro\sam-app\template.yaml
2019-06-17 15:57:17 Check template.yaml to see if it's a binary
2019-06-17 15:57:17 is_binary: 'template.yaml'
2019-06-17 15:57:17 nontext_ratio1: 0.0
2019-06-17 15:57:17 nontext_ratio2: 1.0
2019-06-17 15:57:17 is_likely_binary: False
2019-06-17 15:57:17 detected_encoding: {'encoding': 'ascii', 'confidence': 1.0, 'language': ''}
2019-06-17 15:57:17 failure: decodable_as_unicode: False
2019-06-17 15:57:17 Writing contents to file C:\Users\pirocchi\repro\sam-app\template.yaml
2019-06-17 15:57:17 Rendered dir C:\Users\pirocchi\repro\sam-app\src\HelloWorld must exist in output_dir .
2019-06-17 15:57:17 Making sure path exists: C:\Users\pirocchi\repro\sam-app\src\HelloWorld
2019-06-17 15:57:17 Created directory at: C:\Users\pirocchi\repro\sam-app\src\HelloWorld
2019-06-17 15:57:17 Processing file src\HelloWorld\aws-lambda-tools-defaults.json
2019-06-17 15:57:17 Created file at C:\Users\pirocchi\repro\sam-app\src\HelloWorld\aws-lambda-tools-defaults.json
2019-06-17 15:57:17 Check src\HelloWorld\aws-lambda-tools-defaults.json to see if it's a binary
2019-06-17 15:57:17 is_binary: 'src\\HelloWorld\\aws-lambda-tools-defaults.json'
2019-06-17 15:57:17 nontext_ratio1: 0.003579952267303103
2019-06-17 15:57:17 nontext_ratio2: 0.9964200477326969
2019-06-17 15:57:17 is_likely_binary: False
2019-06-17 15:57:17 detected_encoding: {'encoding': 'UTF-8-SIG', 'confidence': 1.0, 'language': ''}
2019-06-17 15:57:17 success: decodable_as_unicode: True
2019-06-17 15:57:17 failure: decodable_as_unicode: True
2019-06-17 15:57:17 Writing contents to file C:\Users\pirocchi\repro\sam-app\src\HelloWorld\aws-lambda-tools-defaults.json
2019-06-17 15:57:17 Processing file src\HelloWorld\Function.cs
2019-06-17 15:57:17 Created file at C:\Users\pirocchi\repro\sam-app\src\HelloWorld\Function.cs
2019-06-17 15:57:17 Check src\HelloWorld\Function.cs to see if it's a binary
2019-06-17 15:57:17 is_binary: 'src\\HelloWorld\\Function.cs'
2019-06-17 15:57:17 nontext_ratio1: 0.0
2019-06-17 15:57:17 nontext_ratio2: 1.0
2019-06-17 15:57:17 is_likely_binary: False
2019-06-17 15:57:17 detected_encoding: {'encoding': 'ascii', 'confidence': 1.0, 'language': ''}
2019-06-17 15:57:17 failure: decodable_as_unicode: False
2019-06-17 15:57:17 Writing contents to file C:\Users\pirocchi\repro\sam-app\src\HelloWorld\Function.cs
2019-06-17 15:57:17 Processing file src\HelloWorld\HelloWorld.csproj
2019-06-17 15:57:17 Created file at C:\Users\pirocchi\repro\sam-app\src\HelloWorld\HelloWorld.csproj
2019-06-17 15:57:17 Check src\HelloWorld\HelloWorld.csproj to see if it's a binary
2019-06-17 15:57:17 is_binary: 'src\\HelloWorld\\HelloWorld.csproj'
2019-06-17 15:57:17 nontext_ratio1: 0.0
2019-06-17 15:57:17 nontext_ratio2: 1.0
2019-06-17 15:57:17 is_likely_binary: False
2019-06-17 15:57:17 detected_encoding: {'encoding': 'ascii', 'confidence': 1.0, 'language': ''}
2019-06-17 15:57:17 failure: decodable_as_unicode: False
2019-06-17 15:57:17 Writing contents to file C:\Users\pirocchi\repro\sam-app\src\HelloWorld\HelloWorld.csproj
2019-06-17 15:57:17 Rendered dir C:\Users\pirocchi\repro\sam-app\test\HelloWorld.Test must exist in output_dir .
2019-06-17 15:57:17 Making sure path exists: C:\Users\pirocchi\repro\sam-app\test\HelloWorld.Test
2019-06-17 15:57:17 Created directory at: C:\Users\pirocchi\repro\sam-app\test\HelloWorld.Test
2019-06-17 15:57:17 Processing file test\HelloWorld.Test\FunctionTest.cs
2019-06-17 15:57:17 Created file at C:\Users\pirocchi\repro\sam-app\test\HelloWorld.Test\FunctionTest.cs
2019-06-17 15:57:17 Check test\HelloWorld.Test\FunctionTest.cs to see if it's a binary
2019-06-17 15:57:17 is_binary: 'test\\HelloWorld.Test\\FunctionTest.cs'
2019-06-17 15:57:17 nontext_ratio1: 0.0
2019-06-17 15:57:17 nontext_ratio2: 1.0
2019-06-17 15:57:17 is_likely_binary: False
2019-06-17 15:57:17 detected_encoding: {'encoding': 'ascii', 'confidence': 1.0, 'language': ''}
2019-06-17 15:57:17 failure: decodable_as_unicode: False
2019-06-17 15:57:17 Writing contents to file C:\Users\pirocchi\repro\sam-app\test\HelloWorld.Test\FunctionTest.cs
2019-06-17 15:57:17 Processing file test\HelloWorld.Test\HelloWorld.Tests.csproj
2019-06-17 15:57:17 Created file at C:\Users\pirocchi\repro\sam-app\test\HelloWorld.Test\HelloWorld.Tests.csproj
2019-06-17 15:57:17 Check test\HelloWorld.Test\HelloWorld.Tests.csproj to see if it's a binary
2019-06-17 15:57:17 is_binary: 'test\\HelloWorld.Test\\HelloWorld.Tests.csproj'
2019-06-17 15:57:17 nontext_ratio1: 0.0
2019-06-17 15:57:17 nontext_ratio2: 1.0
2019-06-17 15:57:17 is_likely_binary: False
2019-06-17 15:57:17 detected_encoding: {'encoding': 'ascii', 'confidence': 1.0, 'language': ''}
2019-06-17 15:57:17 failure: decodable_as_unicode: False
2019-06-17 15:57:17 Writing contents to file C:\Users\pirocchi\repro\sam-app\test\HelloWorld.Test\HelloWorld.Tests.csproj
2019-06-17 15:57:17 hooks_dir is C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\local\init\templates\cookiecutter-aws-sam-hello-dotnet\hooks
2019-06-17 15:57:17 No hooks/ dir in template_dir
2019-06-17 15:57:17 No post_gen_project hook found

Project generated: ./sam-app

Steps you can take next within the project folder
===================================================
[*] Install dependencies
[*] Invoke Function: sam local invoke HelloWorldFunction --event event.json
[*] Start API Gateway locally: sam local start-api

Read sam-app/README.md for further instructions

[*] Project initialization is now complete
PS C:\Users\pirocchi\repro> cd .\sam-app\
PS C:\Users\pirocchi\repro\sam-app> sam build --debug
2019-06-17 15:57:42 Using SAM Template at C:\Users\pirocchi\repro\sam-app\template.yaml
2019-06-17 15:57:42 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-06-17 15:57:42 Changing event name from before-call.apigateway to before-call.api-gateway
2019-06-17 15:57:42 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-06-17 15:57:42 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2019-06-17 15:57:42 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-06-17 15:57:42 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-06-17 15:57:42 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2019-06-17 15:57:42 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2019-06-17 15:57:42 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2019-06-17 15:57:42 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2019-06-17 15:57:42 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2019-06-17 15:57:42 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-06-17 15:57:42 Changing event name from before-call.apigateway to before-call.api-gateway
2019-06-17 15:57:42 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-06-17 15:57:42 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2019-06-17 15:57:42 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-06-17 15:57:42 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-06-17 15:57:42 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2019-06-17 15:57:42 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2019-06-17 15:57:42 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2019-06-17 15:57:42 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2019-06-17 15:57:42 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2019-06-17 15:57:42 'build' command is called
2019-06-17 15:57:42 No Parameters detected in the template
2019-06-17 15:57:42 2 resources found in the template
2019-06-17 15:57:42 Found Serverless function with name='HelloWorldFunction' and CodeUri='./src/HelloWorld/'
2019-06-17 15:57:42 Building resource 'HelloWorldFunction'
2019-06-17 15:57:42 Loading workflow module 'aws_lambda_builders.workflows'
2019-06-17 15:57:42 Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip', application_framework=None)'
2019-06-17 15:57:42 Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm', application_framework=None)'
2019-06-17 15:57:42 Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'
2019-06-17 15:57:42 Registering workflow 'GoDepBuilder' with capability 'Capability(language='go', dependency_manager='dep', application_framework=None)'
2019-06-17 15:57:42 Registering workflow 'GoModulesBuilder' with capability 'Capability(language='go', dependency_manager='modules', application_framework=None)'
2019-06-17 15:57:42 Registering workflow 'JavaGradleWorkflow' with capability 'Capability(language='java', dependency_manager='gradle', application_framework=None)'
2019-06-17 15:57:42 Registering workflow 'JavaMavenWorkflow' with capability 'Capability(language='java', dependency_manager='maven', application_framework=None)'
2019-06-17 15:57:42 Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package', application_framework=None)'
2019-06-17 15:57:42 Found workflow 'DotnetCliPackageBuilder' to support capabilities 'Capability(language='dotnet', dependency_manager='cli-package', application_framework=None)'
2019-06-17 15:57:42 Running workflow 'DotnetCliPackageBuilder'
2019-06-17 15:57:42 Running DotnetCliPackageBuilder:GlobalToolInstall
2019-06-17 15:57:42 Installing Amazon.Lambda.Tools Global Tool
2019-06-17 15:57:42 executing dotnet: ['dotnet.exe', 'tool', 'install', '-g', 'Amazon.Lambda.Tools']
2019-06-17 15:57:42
2019-06-17 15:57:42 Error installing probably due to already installed. Attempt to update to latest version.
2019-06-17 15:57:42 executing dotnet: ['dotnet.exe', 'tool', 'update', '-g', 'Amazon.Lambda.Tools']
2019-06-17 15:57:47 Tool 'amazon.lambda.tools' was reinstalled with the latest stable version (version '3.2.3').
2019-06-17 15:57:47 DotnetCliPackageBuilder:GlobalToolInstall succeeded
2019-06-17 15:57:47 Running DotnetCliPackageBuilder:RunPackageAction
2019-06-17 15:57:47 Running `dotnet lambda package` in C:\Users\pirocchi\repro\sam-app\src\HelloWorld
2019-06-17 15:57:47 executing dotnet: ['dotnet.exe', 'lambda', 'package', '--output-package', 'C:\\Users\\pirocchi\\repro\\sam-app\\.aws-sam\\build\\HelloWorldFunction\\HelloWorld.zip']
2019-06-17 15:57:50 Amazon Lambda Tools for .NET Core applications (3.2.3)
Project Home: https://github.com/aws/aws-extensions-for-dotnet-cli, https://github.com/aws/aws-lambda-dotnet

Executing publish command
... invoking 'dotnet publish', working folder 'C:\Users\pirocchi\repro\sam-app\src\HelloWorld\bin\Release\netcoreapp2.1\publish'
... Disabling compilation context to reduce package size. If compilation context is needed pass in the "/p:PreserveCompilationContext=false" switch.
... publish: Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
... publish: Copyright (C) Microsoft Corporation. All rights reserved.
... publish:   Restoring packages for C:\Users\pirocchi\repro\sam-app\src\HelloWorld\HelloWorld.csproj...
... publish:   Generating MSBuild file C:\Users\pirocchi\repro\sam-app\src\HelloWorld\obj\HelloWorld.csproj.nuget.g.props.
... publish:   Generating MSBuild file C:\Users\pirocchi\repro\sam-app\src\HelloWorld\obj\HelloWorld.csproj.nuget.g.targets.
... publish:   Restore completed in 188.59 ms for C:\Users\pirocchi\repro\sam-app\src\HelloWorld\HelloWorld.csproj.
... publish:   HelloWorld -> C:\Users\pirocchi\repro\sam-app\src\HelloWorld\bin\Release\netcoreapp2.1\rhel.7.2-x64\HelloWorld.dll
... publish:   HelloWorld -> C:\Users\pirocchi\repro\sam-app\src\HelloWorld\bin\Release\netcoreapp2.1\publish\
Zipping publish folder C:\Users\pirocchi\repro\sam-app\src\HelloWorld\bin\Release\netcoreapp2.1\publish to C:\Users\pirocchi\repro\sam-app\.aws-sam\build\HelloWorldFunction\HelloWorld.zip
Creating directory C:\Users\pirocchi\repro\sam-app\.aws-sam\build\HelloWorldFunction
... zipping: Amazon.Lambda.APIGatewayEvents.dll
... zipping: Amazon.Lambda.Core.dll
... zipping: Amazon.Lambda.Serialization.Json.dll
... zipping: HelloWorld.deps.json
... zipping: HelloWorld.dll
... zipping: HelloWorld.pdb
... zipping: HelloWorld.runtimeconfig.json
... zipping: Newtonsoft.Json.dll
Created publish archive (C:\Users\pirocchi\repro\sam-app\.aws-sam\build\HelloWorldFunction\HelloWorld.zip).
Lambda project successfully packaged: C:\Users\pirocchi\repro\sam-app\.aws-sam\build\HelloWorldFunction\HelloWorld.zip
2019-06-17 15:57:50 DotnetCliPackageBuilder:RunPackageAction succeeded

Build Succeeded

Built Artifacts  : .aws-sam\build
Built Template   : .aws-sam\build\template.yaml

Commands you can use next
=========================
[*] Invoke Function: sam local invoke
[*] Package: sam package --s3-bucket <yourbucket>
PS C:\Users\pirocchi\repro\sam-app> sam local invoke HelloWorldFunction --no-event --debug
2019-06-17 15:58:08 Using SAM Template at C:\Users\pirocchi\repro\sam-app\.aws-sam\build\template.yaml
2019-06-17 15:58:08 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-06-17 15:58:08 Changing event name from before-call.apigateway to before-call.api-gateway
2019-06-17 15:58:08 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-06-17 15:58:08 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2019-06-17 15:58:08 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-06-17 15:58:08 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-06-17 15:58:08 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2019-06-17 15:58:08 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2019-06-17 15:58:08 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2019-06-17 15:58:08 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2019-06-17 15:58:08 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2019-06-17 15:58:08 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-06-17 15:58:08 Changing event name from before-call.apigateway to before-call.api-gateway
2019-06-17 15:58:08 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-06-17 15:58:08 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2019-06-17 15:58:08 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-06-17 15:58:08 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-06-17 15:58:08 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2019-06-17 15:58:08 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2019-06-17 15:58:08 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2019-06-17 15:58:08 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2019-06-17 15:58:08 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2019-06-17 15:58:08 local invoke command is called
2019-06-17 15:58:08 No Parameters detected in the template
2019-06-17 15:58:08 2 resources found in the template
2019-06-17 15:58:08 Found Serverless function with name='HelloWorldFunction' and CodeUri='HelloWorldFunction'
2019-06-17 15:58:08 Trying paths: ['C:\\Users\\pirocchi\\.docker\\config.json', 'C:\\Users\\pirocchi\\.dockercfg']
2019-06-17 15:58:08 Found file at path: C:\Users\pirocchi\.docker\config.json
2019-06-17 15:58:08 Found 'auths' section
2019-06-17 15:58:08 Auth data for 014427093950.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:08 Auth data for 260708760616.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:08 Auth data for 791291776206.dkr.ecr.us-west-2.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:08 Auth data for 831572917941.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:08 Found 'credsStore' section
2019-06-17 15:58:08 http://localhost:None "GET /v1.35/_ping HTTP/1.1" 200 2
2019-06-17 15:58:08 Looking for credentials via: env
2019-06-17 15:58:08 Looking for credentials via: assume-role
2019-06-17 15:58:08 Looking for credentials via: shared-credentials-file
2019-06-17 15:58:08 Found credentials in shared credentials file: ~/.aws/credentials
2019-06-17 15:58:08 Loading JSON file: C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\botocore\data\endpoints.json
2019-06-17 15:58:08 Event choose-service-name: calling handler <function handle_service_name_alias at 0x000001D42241E378>
2019-06-17 15:58:08 Loading JSON file: C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\botocore\data\lambda\2015-03-31\service-2.json
2019-06-17 15:58:08 Event creating-client-class.lambda: calling handler <function add_generate_presigned_url at 0x000001D42239A840>
2019-06-17 15:58:08 The s3 config key is not a dictionary type, ignoring its value of: None
2019-06-17 15:58:08 Setting lambda timeout as (60, 60)
2019-06-17 15:58:08 Loading JSON file: C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\botocore\data\_retry.json
2019-06-17 15:58:08 Registering retry handlers for service: lambda
2019-06-17 15:58:08 Trying paths: ['C:\\Users\\pirocchi\\.docker\\config.json', 'C:\\Users\\pirocchi\\.dockercfg']
2019-06-17 15:58:08 Found file at path: C:\Users\pirocchi\.docker\config.json
2019-06-17 15:58:08 Found 'auths' section
2019-06-17 15:58:08 Auth data for 014427093950.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:08 Auth data for 260708760616.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:08 Auth data for 791291776206.dkr.ecr.us-west-2.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:08 Auth data for 831572917941.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:08 Found 'credsStore' section
2019-06-17 15:58:08 Found one Lambda function with name 'HelloWorldFunction'
2019-06-17 15:58:08 Invoking HelloWorld::HelloWorld.Function::FunctionHandler (dotnetcore2.1)
2019-06-17 15:58:08 Environment variables overrides data is standard format
2019-06-17 15:58:08 Loading AWS credentials from session with profile 'default'
2019-06-17 15:58:08 Resolving code path. Cwd=C:\Users\pirocchi\repro\sam-app\.aws-sam\build, CodeUri=HelloWorldFunction
2019-06-17 15:58:08 Resolved absolute path to code is C:\Users\pirocchi\repro\sam-app\.aws-sam\build\HelloWorldFunction
2019-06-17 15:58:08 Code C:\Users\pirocchi\repro\sam-app\.aws-sam\build\HelloWorldFunction is not a zip/jar file
2019-06-17 15:58:08 Skipping building an image since no layers were defined
2019-06-17 15:58:08 Trying paths: ['C:\\Users\\pirocchi\\.docker\\config.json', 'C:\\Users\\pirocchi\\.dockercfg']
2019-06-17 15:58:08 Found file at path: C:\Users\pirocchi\.docker\config.json
2019-06-17 15:58:08 Found 'auths' section
2019-06-17 15:58:08 Auth data for 014427093950.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:08 Auth data for 260708760616.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:08 Auth data for 791291776206.dkr.ecr.us-west-2.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:08 Auth data for 831572917941.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:08 Found 'credsStore' section
2019-06-17 15:58:08 http://localhost:None "GET /v1.35/images/lambci/lambda:dotnetcore2.1/json HTTP/1.1" 200 None
2019-06-17 15:58:08 Looking for auth config
2019-06-17 15:58:08 Using credentials store "wincred"
2019-06-17 15:58:08 Looking for auth entry for 'https://index.docker.io/v1/'
2019-06-17 15:58:09 No entry found
2019-06-17 15:58:09 No entry in credstore - fetching from auth dict
2019-06-17 15:58:09 Looking for auth entry for 'docker.io'
2019-06-17 15:58:09 No entry found
2019-06-17 15:58:09 No auth config found
2019-06-17 15:58:09 http://localhost:None "POST /v1.35/images/create?tag=dotnetcore2.1&fromImage=lambci%2Flambda HTTP/1.1" 200 None

Fetching lambci/lambda:dotnetcore2.1 Docker container image......
2019-06-17 15:58:09 Mounting C:\Users\pirocchi\repro\sam-app\.aws-sam\build\HelloWorldFunction as /var/task:ro,delegated inside runtime container
2019-06-17 15:58:09 http://localhost:None "POST /v1.35/containers/create HTTP/1.1" 201 90
2019-06-17 15:58:09 http://localhost:None "GET /v1.35/containers/0cfc1a7c0f27a41ca1680f8354b4de2c6b5ed49274593f3969968cec1d0cb8cb/json HTTP/1.1" 200 None
2019-06-17 15:58:09 http://localhost:None "GET /v1.35/containers/0cfc1a7c0f27a41ca1680f8354b4de2c6b5ed49274593f3969968cec1d0cb8cb/json HTTP/1.1" 200 None
2019-06-17 15:58:10 http://localhost:None "POST /v1.35/containers/0cfc1a7c0f27a41ca1680f8354b4de2c6b5ed49274593f3969968cec1d0cb8cb/start HTTP/1.1" 204 0
2019-06-17 15:58:10 Starting a timer for 10 seconds for function 'HelloWorldFunction'
2019-06-17 15:58:10 http://localhost:None "GET /v1.35/containers/0cfc1a7c0f27a41ca1680f8354b4de2c6b5ed49274593f3969968cec1d0cb8cb/json HTTP/1.1" 200 None
2019-06-17 15:58:10 http://localhost:None "POST /containers/0cfc1a7c0f27a41ca1680f8354b4de2c6b5ed49274593f3969968cec1d0cb8cb/attach?stdout=1&stderr=1&logs=1&stream=1&stdin=0 HTTP/1.1" 101 0
START RequestId: 209e9694-2b6b-46a0-9296-0829c9124760 Version: $LATEST
END  RequestId: 209e9694-2b6b-46a0-9296-0829c9124760
REPORT RequestId 209e9694-2b6b-46a0-9296-0829c9124760   Duration: 441 ms        Billed Duration: 500 ms Memory Size 128 MB      Max Memory Used: 45 MB
2019-06-17 15:58:11 http://localhost:None "GET /v1.35/containers/0cfc1a7c0f27a41ca1680f8354b4de2c6b5ed49274593f3969968cec1d0cb8cb/json HTTP/1.1" 200 None
2019-06-17 15:58:11 http://localhost:None "DELETE /v1.35/containers/0cfc1a7c0f27a41ca1680f8354b4de2c6b5ed49274593f3969968cec1d0cb8cb?v=False&link=False&force=True HTTP/1.1" 204 0
{"statusCode":200,"headers":{"Content-Type":"application/json"},"multiValueHeaders":null,"body":"{\"message\":\"hello world\",\"location\":\"68.33.119.204\"}","isBase64Encoded":false}
PS C:\Users\pirocchi\repro\sam-app> sam local invoke HelloWorldFunction --no-event --template .\template.yaml --debug
2019-06-17 15:58:31 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-06-17 15:58:31 Changing event name from before-call.apigateway to before-call.api-gateway
2019-06-17 15:58:31 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-06-17 15:58:31 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2019-06-17 15:58:31 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-06-17 15:58:31 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-06-17 15:58:31 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2019-06-17 15:58:31 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2019-06-17 15:58:31 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2019-06-17 15:58:31 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2019-06-17 15:58:31 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2019-06-17 15:58:31 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-06-17 15:58:31 Changing event name from before-call.apigateway to before-call.api-gateway
2019-06-17 15:58:31 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-06-17 15:58:31 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2019-06-17 15:58:31 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-06-17 15:58:31 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-06-17 15:58:31 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2019-06-17 15:58:31 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2019-06-17 15:58:31 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2019-06-17 15:58:31 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2019-06-17 15:58:31 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2019-06-17 15:58:31 local invoke command is called
2019-06-17 15:58:31 No Parameters detected in the template
2019-06-17 15:58:31 2 resources found in the template
2019-06-17 15:58:31 Found Serverless function with name='HelloWorldFunction' and CodeUri='./src/HelloWorld/'
2019-06-17 15:58:31 Trying paths: ['C:\\Users\\pirocchi\\.docker\\config.json', 'C:\\Users\\pirocchi\\.dockercfg']
2019-06-17 15:58:31 Found file at path: C:\Users\pirocchi\.docker\config.json
2019-06-17 15:58:31 Found 'auths' section
2019-06-17 15:58:31 Auth data for 014427093950.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:31 Auth data for 260708760616.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:31 Auth data for 791291776206.dkr.ecr.us-west-2.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:31 Auth data for 831572917941.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:31 Found 'credsStore' section
2019-06-17 15:58:31 http://localhost:None "GET /v1.35/_ping HTTP/1.1" 200 2
2019-06-17 15:58:31 Looking for credentials via: env
2019-06-17 15:58:31 Looking for credentials via: assume-role
2019-06-17 15:58:31 Looking for credentials via: shared-credentials-file
2019-06-17 15:58:31 Found credentials in shared credentials file: ~/.aws/credentials
2019-06-17 15:58:31 Loading JSON file: C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\botocore\data\endpoints.json
2019-06-17 15:58:31 Event choose-service-name: calling handler <function handle_service_name_alias at 0x0000022924B3E378>
2019-06-17 15:58:31 Loading JSON file: C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\botocore\data\lambda\2015-03-31\service-2.json
2019-06-17 15:58:31 Event creating-client-class.lambda: calling handler <function add_generate_presigned_url at 0x0000022924ABA840>
2019-06-17 15:58:31 The s3 config key is not a dictionary type, ignoring its value of: None
2019-06-17 15:58:31 Setting lambda timeout as (60, 60)
2019-06-17 15:58:31 Loading JSON file: C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\botocore\data\_retry.json
2019-06-17 15:58:31 Registering retry handlers for service: lambda
2019-06-17 15:58:31 Trying paths: ['C:\\Users\\pirocchi\\.docker\\config.json', 'C:\\Users\\pirocchi\\.dockercfg']
2019-06-17 15:58:31 Found file at path: C:\Users\pirocchi\.docker\config.json
2019-06-17 15:58:31 Found 'auths' section
2019-06-17 15:58:31 Auth data for 014427093950.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:31 Auth data for 260708760616.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:31 Auth data for 791291776206.dkr.ecr.us-west-2.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:31 Auth data for 831572917941.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:31 Found 'credsStore' section
2019-06-17 15:58:31 Found one Lambda function with name 'HelloWorldFunction'
2019-06-17 15:58:31 Invoking HelloWorld::HelloWorld.Function::FunctionHandler (dotnetcore2.1)
2019-06-17 15:58:31 Environment variables overrides data is standard format
2019-06-17 15:58:31 Loading AWS credentials from session with profile 'default'
2019-06-17 15:58:31 Resolving code path. Cwd=C:\Users\pirocchi\repro\sam-app, CodeUri=./src/HelloWorld/
2019-06-17 15:58:31 Resolved absolute path to code is C:\Users\pirocchi\repro\sam-app\src\HelloWorld
2019-06-17 15:58:31 Code C:\Users\pirocchi\repro\sam-app\src\HelloWorld is not a zip/jar file
2019-06-17 15:58:31 Skipping building an image since no layers were defined
2019-06-17 15:58:31 Trying paths: ['C:\\Users\\pirocchi\\.docker\\config.json', 'C:\\Users\\pirocchi\\.dockercfg']
2019-06-17 15:58:31 Found file at path: C:\Users\pirocchi\.docker\config.json
2019-06-17 15:58:31 Found 'auths' section
2019-06-17 15:58:31 Auth data for 014427093950.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:31 Auth data for 260708760616.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:31 Auth data for 791291776206.dkr.ecr.us-west-2.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:31 Auth data for 831572917941.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:31 Found 'credsStore' section
2019-06-17 15:58:31 http://localhost:None "GET /v1.35/images/lambci/lambda:dotnetcore2.1/json HTTP/1.1" 200 None
2019-06-17 15:58:31 Looking for auth config
2019-06-17 15:58:31 Using credentials store "wincred"
2019-06-17 15:58:31 Looking for auth entry for 'https://index.docker.io/v1/'
2019-06-17 15:58:31 No entry found
2019-06-17 15:58:31 No entry in credstore - fetching from auth dict
2019-06-17 15:58:31 Looking for auth entry for 'docker.io'
2019-06-17 15:58:32 No entry found
2019-06-17 15:58:32 No auth config found
2019-06-17 15:58:32 http://localhost:None "POST /v1.35/images/create?tag=dotnetcore2.1&fromImage=lambci%2Flambda HTTP/1.1" 200 None

Fetching lambci/lambda:dotnetcore2.1 Docker container image......
2019-06-17 15:58:32 Mounting C:\Users\pirocchi\repro\sam-app\src\HelloWorld as /var/task:ro,delegated inside runtime container
2019-06-17 15:58:32 http://localhost:None "POST /v1.35/containers/create HTTP/1.1" 201 90
2019-06-17 15:58:32 http://localhost:None "GET /v1.35/containers/b2cbda9082108c475c90ad14671aa57f28e929044ff32caba102a97b6b41c27f/json HTTP/1.1" 200 None
2019-06-17 15:58:32 http://localhost:None "GET /v1.35/containers/b2cbda9082108c475c90ad14671aa57f28e929044ff32caba102a97b6b41c27f/json HTTP/1.1" 200 None
2019-06-17 15:58:33 http://localhost:None "POST /v1.35/containers/b2cbda9082108c475c90ad14671aa57f28e929044ff32caba102a97b6b41c27f/start HTTP/1.1" 204 0
2019-06-17 15:58:33 Starting a timer for 10 seconds for function 'HelloWorldFunction'
2019-06-17 15:58:33 http://localhost:None "GET /v1.35/containers/b2cbda9082108c475c90ad14671aa57f28e929044ff32caba102a97b6b41c27f/json HTTP/1.1" 200 None
2019-06-17 15:58:33 http://localhost:None "POST /containers/b2cbda9082108c475c90ad14671aa57f28e929044ff32caba102a97b6b41c27f/attach?stdout=1&stderr=1&logs=1&stream=1&stdin=0 HTTP/1.1" 101 0

Unhandled exception occured in runner:
AWSLambda.Internal.Bootstrap.LambdaValidationException: Could not find the specified handler assembly with the file name 'HelloWorld, Culture=neutral, PublicKeyToken=null'. The assembly should be located in the root of your uploaded .zip file.
   at AWSLambda.Internal.Bootstrap.UserCodeLoader.Init(Action`1 customerLoggingAction) in /opt/workspace/LambdaSandboxCoreCLR-2-1/src/Bootstrap/UserCodeLoader.cs:line 105
   at MockLambdaRuntime.Program.Main(String[] args) in /source/Program.cs:line 51
2019-06-17 15:58:34 http://localhost:None "GET /v1.35/containers/b2cbda9082108c475c90ad14671aa57f28e929044ff32caba102a97b6b41c27f/json HTTP/1.1" 200 None
2019-06-17 15:58:34 http://localhost:None "DELETE /v1.35/containers/b2cbda9082108c475c90ad14671aa57f28e929044ff32caba102a97b6b41c27f?v=False&link=False&force=True HTTP/1.1" 204 0
PS C:\Users\pirocchi\repro\sam-app> sam local invoke HelloWorldFunction --no-event --template C:\Users\pirocchi\repro\sam-app\template.yaml --debug
2019-06-17 15:58:53 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-06-17 15:58:53 Changing event name from before-call.apigateway to before-call.api-gateway
2019-06-17 15:58:53 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-06-17 15:58:53 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2019-06-17 15:58:53 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-06-17 15:58:53 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-06-17 15:58:53 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2019-06-17 15:58:53 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2019-06-17 15:58:53 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2019-06-17 15:58:53 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2019-06-17 15:58:53 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2019-06-17 15:58:53 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-06-17 15:58:53 Changing event name from before-call.apigateway to before-call.api-gateway
2019-06-17 15:58:53 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-06-17 15:58:53 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2019-06-17 15:58:53 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-06-17 15:58:53 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-06-17 15:58:53 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2019-06-17 15:58:53 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2019-06-17 15:58:53 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2019-06-17 15:58:53 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2019-06-17 15:58:53 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2019-06-17 15:58:53 local invoke command is called
2019-06-17 15:58:53 No Parameters detected in the template
2019-06-17 15:58:53 2 resources found in the template
2019-06-17 15:58:53 Found Serverless function with name='HelloWorldFunction' and CodeUri='./src/HelloWorld/'
2019-06-17 15:58:53 Trying paths: ['C:\\Users\\pirocchi\\.docker\\config.json', 'C:\\Users\\pirocchi\\.dockercfg']
2019-06-17 15:58:53 Found file at path: C:\Users\pirocchi\.docker\config.json
2019-06-17 15:58:53 Found 'auths' section
2019-06-17 15:58:53 Auth data for 014427093950.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:53 Auth data for 260708760616.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:53 Auth data for 791291776206.dkr.ecr.us-west-2.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:53 Auth data for 831572917941.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:53 Found 'credsStore' section
2019-06-17 15:58:54 http://localhost:None "GET /v1.35/_ping HTTP/1.1" 200 2
2019-06-17 15:58:54 Looking for credentials via: env
2019-06-17 15:58:54 Looking for credentials via: assume-role
2019-06-17 15:58:54 Looking for credentials via: shared-credentials-file
2019-06-17 15:58:54 Found credentials in shared credentials file: ~/.aws/credentials
2019-06-17 15:58:54 Loading JSON file: C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\botocore\data\endpoints.json
2019-06-17 15:58:54 Event choose-service-name: calling handler <function handle_service_name_alias at 0x000002335BACF378>
2019-06-17 15:58:54 Loading JSON file: C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\botocore\data\lambda\2015-03-31\service-2.json
2019-06-17 15:58:54 Event creating-client-class.lambda: calling handler <function add_generate_presigned_url at 0x000002335BA4A840>
2019-06-17 15:58:54 The s3 config key is not a dictionary type, ignoring its value of: None
2019-06-17 15:58:54 Setting lambda timeout as (60, 60)
2019-06-17 15:58:54 Loading JSON file: C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\botocore\data\_retry.json
2019-06-17 15:58:54 Registering retry handlers for service: lambda
2019-06-17 15:58:54 Trying paths: ['C:\\Users\\pirocchi\\.docker\\config.json', 'C:\\Users\\pirocchi\\.dockercfg']
2019-06-17 15:58:54 Found file at path: C:\Users\pirocchi\.docker\config.json
2019-06-17 15:58:54 Found 'auths' section
2019-06-17 15:58:54 Auth data for 014427093950.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:54 Auth data for 260708760616.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:54 Auth data for 791291776206.dkr.ecr.us-west-2.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:54 Auth data for 831572917941.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:54 Found 'credsStore' section
2019-06-17 15:58:54 Found one Lambda function with name 'HelloWorldFunction'
2019-06-17 15:58:54 Invoking HelloWorld::HelloWorld.Function::FunctionHandler (dotnetcore2.1)
2019-06-17 15:58:54 Environment variables overrides data is standard format
2019-06-17 15:58:54 Loading AWS credentials from session with profile 'default'
2019-06-17 15:58:54 Resolving code path. Cwd=C:\Users\pirocchi\repro\sam-app, CodeUri=./src/HelloWorld/
2019-06-17 15:58:54 Resolved absolute path to code is C:\Users\pirocchi\repro\sam-app\src\HelloWorld
2019-06-17 15:58:54 Code C:\Users\pirocchi\repro\sam-app\src\HelloWorld is not a zip/jar file
2019-06-17 15:58:54 Skipping building an image since no layers were defined
2019-06-17 15:58:54 Trying paths: ['C:\\Users\\pirocchi\\.docker\\config.json', 'C:\\Users\\pirocchi\\.dockercfg']
2019-06-17 15:58:54 Found file at path: C:\Users\pirocchi\.docker\config.json
2019-06-17 15:58:54 Found 'auths' section
2019-06-17 15:58:54 Auth data for 014427093950.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:54 Auth data for 260708760616.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:54 Auth data for 791291776206.dkr.ecr.us-west-2.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:54 Auth data for 831572917941.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
2019-06-17 15:58:54 Found 'credsStore' section
2019-06-17 15:58:54 http://localhost:None "GET /v1.35/images/lambci/lambda:dotnetcore2.1/json HTTP/1.1" 200 None
2019-06-17 15:58:54 Looking for auth config
2019-06-17 15:58:54 Using credentials store "wincred"
2019-06-17 15:58:54 Looking for auth entry for 'https://index.docker.io/v1/'
2019-06-17 15:58:54 No entry found
2019-06-17 15:58:54 No entry in credstore - fetching from auth dict
2019-06-17 15:58:54 Looking for auth entry for 'docker.io'
2019-06-17 15:58:54 No entry found
2019-06-17 15:58:54 No auth config found
2019-06-17 15:58:55 http://localhost:None "POST /v1.35/images/create?tag=dotnetcore2.1&fromImage=lambci%2Flambda HTTP/1.1" 200 None

Fetching lambci/lambda:dotnetcore2.1 Docker container image......
2019-06-17 15:58:55 Mounting C:\Users\pirocchi\repro\sam-app\src\HelloWorld as /var/task:ro,delegated inside runtime container
2019-06-17 15:58:55 http://localhost:None "POST /v1.35/containers/create HTTP/1.1" 201 90
2019-06-17 15:58:55 http://localhost:None "GET /v1.35/containers/d252593d27401c55ffbb06c6ef9321e0f72989f8b3e959eec5aa55447df6a69d/json HTTP/1.1" 200 None
2019-06-17 15:58:55 http://localhost:None "GET /v1.35/containers/d252593d27401c55ffbb06c6ef9321e0f72989f8b3e959eec5aa55447df6a69d/json HTTP/1.1" 200 None
2019-06-17 15:58:56 http://localhost:None "POST /v1.35/containers/d252593d27401c55ffbb06c6ef9321e0f72989f8b3e959eec5aa55447df6a69d/start HTTP/1.1" 204 0
2019-06-17 15:58:56 Starting a timer for 10 seconds for function 'HelloWorldFunction'
2019-06-17 15:58:56 http://localhost:None "GET /v1.35/containers/d252593d27401c55ffbb06c6ef9321e0f72989f8b3e959eec5aa55447df6a69d/json HTTP/1.1" 200 None
2019-06-17 15:58:56 http://localhost:None "POST /containers/d252593d27401c55ffbb06c6ef9321e0f72989f8b3e959eec5aa55447df6a69d/attach?stdout=1&stderr=1&logs=1&stream=1&stdin=0 HTTP/1.1" 101 0

Unhandled exception occured in runner:
AWSLambda.Internal.Bootstrap.LambdaValidationException: Could not find the specified handler assembly with the file name 'HelloWorld, Culture=neutral, PublicKeyToken=null'. The assembly should be located in the root of your uploaded .zip file.
   at AWSLambda.Internal.Bootstrap.UserCodeLoader.Init(Action`1 customerLoggingAction) in /opt/workspace/LambdaSandboxCoreCLR-2-1/src/Bootstrap/UserCodeLoader.cs:line 105
   at MockLambdaRuntime.Program.Main(String[] args) in /source/Program.cs:line 51
2019-06-17 15:58:56 http://localhost:None "GET /v1.35/containers/d252593d27401c55ffbb06c6ef9321e0f72989f8b3e959eec5aa55447df6a69d/json HTTP/1.1" 200 None
2019-06-17 15:58:56 http://localhost:None "DELETE /v1.35/containers/d252593d27401c55ffbb06c6ef9321e0f72989f8b3e959eec5aa55447df6a69d?v=False&link=False&force=True HTTP/1.1" 204 0
PS C:\Users\pirocchi\repro\sam-app> Stop-Transcript
**********************
PowerShell transcript end
End time: 20190617155902
**********************

Expected result

All three invocations succeed, not just the first one.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: Repro'd on MacOS and Windows
  2. sam --version: 0.16.1 on both OSes.
jfuss commented 5 years ago

Chatted offline about this. The problem is here is that you are passing the --template option which overrides any defaults we set. If passed, we use the template passed to find code. You will either need to pass --template with the value of the built template or not pass template option at all and allow the cli to auto resolve it.

Closing