Closed HemishGarden closed 1 year ago
Hi @HemishGarden,
Good morning.
Could you please share the sample code solution including the template.yaml
to reproduce the issue? Also, I noticed that you are using very old version 3.1.0
Amazon Lambda Tools, the current version is 5.6.6
. Any specific reason or bottleneck for not upgrading to later version?
Thanks, Ashish
Hi @ashishdhingra , This is a medium size project so it's hard to send you the code. Regarding the Yaml file, it contains infrastructure details so, can't share the file aswell. I am trying to upgrade from 3.1.0 to 5.6.6. That's when I hit this error. I rolled back to 3.1.0 and I still see the same errors. Something has changed since early this year with this lib.
Please let me know if you need any specific details, I can provide that to you.
Thanks
Hi @ashishdhingra ,
This is my pipeline yaml file.
trigger: batch: true branches: include:
pool: vmImage: 'windows-latest'
steps:
task: DotNetCoreCLI@2 displayName: 'DotNet Core restore' inputs: command: 'restore' projects: '*/.csproj' feedsToUse: 'select'
task: DotNetCoreCLI@2 displayName: 'DotNet Core test' inputs: command: 'test' projects: '*/.Tests.csproj' testRunTitle: '$(Build.BuildId) Tests' arguments: "/p:CollectCoverage=true /p:CoverletOutputFormat=cobertura" workingDirectory: '$(Build.SourcesDirectory)/myproject'
script: | dotnet tool install -g dotnet-reportgenerator-globaltool reportgenerator -reports:**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/CodeCoverageReport -reporttypes:HtmlInline_AzurePipelines;Cobertura displayName: Create Code coverage report
task: PublishCodeCoverageResults@1 inputs: codeCoverageTool: 'Cobertura' summaryFileLocation: '$(Build.SourcesDirectory)/CodeCoverageReport/Cobertura.xml' reportDirectory: '$(Build.SourcesDirectory)/CodeCoverageReport'
task: DotNetCoreCLI@2 displayName: 'DotNet Core publish' inputs: command: 'publish' publishWebProjects: false projects: '*/.csproj' arguments: '-c Release /p:DebugType=None /p:DebugSymbols=false' zipAfterPublish: false
task: CopyFiles@2 displayName: 'Copy files to Artifact directory' inputs: SourceFolder: '$(Build.SourcesDirectory)' Contents: | /bin/Release/net6.0/publish/ template.yaml TargetFolder: '$(Build.ArtifactStagingDirectory)' CleanTargetFolder: true OverWrite: true
task: PublishBuildArtifacts@1 displayName: 'Publish artifacts' inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)' ArtifactName: '$(Build.BuildId)' publishLocation: 'Container'
@HemishGarden Since you are using Amazon.Lambda.Tools
version 3.1.0
, it is most likely the commit source https://github.com/aws/aws-extensions-for-dotnet-cli/tree/1305565941f1409d9f8e445b023b741dab5fe417/src. Looking at the stack trace of the error, it is most likely thrown at this line where it is inspecting updatable resource properties. A serverless resource should define set of Properties
in YAML template (refer AWS SAM resource and property reference). It is quite possible that one of your resources is missing Properties
information which is throwing this error. Kindly note that a YAML template must be properly indented for YAML parser to process it properly.
Please use guidance above to investigate your YAML template.
Thanks, Ashish
This issue has not received a response in 5 days. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.
Describe the bug
~/.dotnet/tools/dotnet-lambda deploy-serverless --template ./template.yaml
Error![image](https://user-images.githubusercontent.com/25730644/233044356-dd80fdbc-025b-462f-91a1-cbe356534d5d.png)
2023-04-19T09:23:46.9788260Z Unknown error executing command: The given key 'Properties' was not present in the dictionary. 2023-04-19T09:23:46.9967789Z at System.Collections.Generic.Dictionary
2.get_Item(TKey key) 2023-04-19T09:23:46.9969437Z at Amazon.Lambda.Tools.TemplateProcessor.YamlTemplateParser.UpdatableResources()+MoveNext() in E:\JenkinsWorkspaces\aws-extensions-for-dotnet-cli\src\Amazon.Lambda.Tools\TemplateProcessor\YamlTemplateParser.cs:line 50 2023-04-19T09:23:46.9971311Z at Amazon.Lambda.Tools.TemplateProcessor.TemplateProcessorManager.TransformTemplateAsync(String templateDirectory, String templateBody) in E:\JenkinsWorkspaces\aws-extensions-for-dotnet-cli\src\Amazon.Lambda.Tools\TemplateProcessor\TemplateProcessorManager.cs:line 72 2023-04-19T09:23:46.9973814Z at Amazon.Lambda.Tools.Commands.DeployServerlessCommand.PerformActionAsync() in E:\JenkinsWorkspaces\aws-extensions-for-dotnet-cli\src\Amazon.Lambda.Tools\Commands\DeployServerlessCommand.cs:line 167 2023-04-19T09:23:46.9975321Z at Amazon.Common.DotNetCli.Tools.Commands.BaseCommand
1.ExecuteAsync() in E:\JenkinsWorkspaces\aws-extensions-for-dotnet-cli\src\Amazon.Common.DotNetCli.Tools\Commands\BaseCommand.cs:line 44 2023-04-19T09:23:47.0089355Z ##[error]Error: The process '/bin/bash' failed with exit code 255Expected Behavior
It was deploying without error when I deployed in Feb
Current Behavior
Throwing error
2023-04-19T09:23:46.9788260Z Unknown error executing command: The given key 'Properties' was not present in the dictionary. 2023-04-19T09:23:46.9967789Z at System.Collections.Generic.Dictionary
2.get_Item(TKey key) 2023-04-19T09:23:46.9969437Z at Amazon.Lambda.Tools.TemplateProcessor.YamlTemplateParser.UpdatableResources()+MoveNext() in E:\JenkinsWorkspaces\aws-extensions-for-dotnet-cli\src\Amazon.Lambda.Tools\TemplateProcessor\YamlTemplateParser.cs:line 50 2023-04-19T09:23:46.9971311Z at Amazon.Lambda.Tools.TemplateProcessor.TemplateProcessorManager.TransformTemplateAsync(String templateDirectory, String templateBody) in E:\JenkinsWorkspaces\aws-extensions-for-dotnet-cli\src\Amazon.Lambda.Tools\TemplateProcessor\TemplateProcessorManager.cs:line 72 2023-04-19T09:23:46.9973814Z at Amazon.Lambda.Tools.Commands.DeployServerlessCommand.PerformActionAsync() in E:\JenkinsWorkspaces\aws-extensions-for-dotnet-cli\src\Amazon.Lambda.Tools\Commands\DeployServerlessCommand.cs:line 167 2023-04-19T09:23:46.9975321Z at Amazon.Common.DotNetCli.Tools.Commands.BaseCommand
1.ExecuteAsync() in E:\JenkinsWorkspaces\aws-extensions-for-dotnet-cli\src\Amazon.Common.DotNetCli.Tools\Commands\BaseCommand.cs:line 44 2023-04-19T09:23:47.0089355Z ##[error]Error: The process '/bin/bash' failed with exit code 255Reproduction Steps
deploy lambda using ~/.dotnet/tools/dotnet-lambda deploy-serverless --template ./template.yaml
Possible Solution
No response
Additional Information/Context
No response
Targeted .NET platform
.Net 3.1 and 6.0
CLI extension version
Amazon Lambda Tools for .NET Core applications (3.1.0)
Environment details (OS name and version, etc.)
windows-latest