question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Globals no longer supported

See original GitHub issue

I’ve upgraded from 2.2.0 to 3.1.0 (a big update, I know) and it’s broken globals. For example, I have this in my template:

Globals:
  Function:
    Runtime: "dotnetcore2.1"

# later 
  PingFunction:
    Type: "AWS::Serverless::Function"
    Properties:
      FunctionName: !Sub ${Environment}_Ping
      Handler: "LambdaFunctions::LambdaFunctions::Ping"
      Role: !GetAtt LambdaRole.Arn

But attempting deployment fails with:

Unknown error executing command: Value cannot be null.
Parameter name: key
   at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
   at Amazon.Lambda.Tools.LambdaUtilities.DetermineTargetFrameworkFromLambdaRuntime(String lambdaRuntime) in E:\JenkinsWorkspaces\aws-extensions-for-dotnet-cli\src\Amazon.Lambda.Tools\LambdaUtilities.cs:line 31
   at Amazon.Lambda.Tools.TemplateProcessor.TemplateProcessorManager.PackageDotnetProjectAsync(IUpdateResourceField field, String location) in E:\JenkinsWorkspaces\aws-extensions-for-dotnet-cli\src\Amazon.Lambda.Tools\TemplateProcessor\TemplateProcessorManager.cs:line 203
   at Amazon.Lambda.Tools.TemplateProcessor.TemplateProcessorManager.ProcessUpdatableResourceAsync(String templateDirectory, IUpdateResourceField field) in E:\JenkinsWorkspaces\aws-extensions-for-dotnet-cli\src\Amazon.Lambda.Tools\TemplateProcessor\TemplateProcessorManager.cs:line 155
   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 87
   at Amazon.Lambda.Tools.Commands.DeployServerlessCommand.PerformActionAsync() in E:\JenkinsWorkspaces\aws-extensions-for-dotnet-cli\src\Amazon.Lambda.Tools\Commands\DeployServerlessCommand.cs:line 167
   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

Debugging through the code, I can see it is because it expects, for example, a Runtime value on the IUpdatableResourceDataSource, but that is null when using a global. I tried adding it manually to my function and it was then present, but obviously I don’t want to be doing that.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
normjcommented, Nov 15, 2018

I have a fix checked in on the dev branch https://github.com/aws/aws-extensions-for-dotnet-cli/commit/338a5cbe4bfb167d706b9c1c9aa126d594f95261.

I was planning on doing a release in a couple days. Are you blocked or can you wait a couple days for the fix to be a part of the next release?

0reactions
normjcommented, Nov 20, 2018

I just push the fix in version 3.1.1 of Amazon.Lambda.Tools.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't use npx create-react-app "no longer support global ...
But create-react-app keeps saying I have globally installed "create-react-app 4.0.3". After all I did clean cache with npm cache clean --force ...
Read more >
PHP 8.1: $GLOBALS variable restrictions
Mass changes to $GLOBALS are no longer allowed. Overwriting, unsetting, or otherwise making mass changes to the $GLOBALS array is no longer allowed....
Read more >
$GLOBALS - Manual
As of PHP 8.1.0, write access to the entire $GLOBALS array is no longer supported: Example #2 writing entire $GLOBALS will result in...
Read more >
We no longer support global installation of Create React App
Try creating a new react app using CRA. npx create-react-app@4.0.3 your-new-app; Get above error, app not created. Try removing ...
Read more >
How to fix PHP register_globals errors
The article describes how to solve the error PHP Fatal error: Directive 'register_globals' is no longer available in PHP in Unknown on line ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found