Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lambda-nodejs): maximum call stack size exceeded or converting circular structure to JSON #11698

Merged
merged 11 commits into from
Nov 29, 2020

Conversation

jogold
Copy link
Contributor

@jogold jogold commented Nov 25, 2020

All the FunctionOptions were leaking into core where a cache key is
calculated in asset staging. Some of those options have circular references
making it impossible to calculate a cache key with the current implementation.

Another PR is needed to make the cache key calculation in core more
robust.

Closes #11693
Closes #11726
Closes #11762

BREAKING CHANGE: bundling customization options like minify or sourceMap are now gathered under a new bundling prop.

  • lambda-nodejs: bundlingEnvironment is now bundling.environment
  • lambda-nodejs: bundlingDockerImage is now bundling.dockerImage

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

… a VPC

All the `FunctionOptions` were leaking into `core` where a cache key is
calculated in asset staging. For a function in a VPC, those options have
circular references making it impossible to calculate a cache key with
the current implementation.

Another PR is needed to make the cache key calculation in core more
robust.

BREAKING CHANGE: bundling customization options like `minify` or
`sourcemap` are now gathered under a new `bundling` prop.
@gitpod-io
Copy link

gitpod-io bot commented Nov 25, 2020

@jogold
Copy link
Contributor Author

jogold commented Nov 25, 2020

Will add a test for the VPC case

@jogold
Copy link
Contributor Author

jogold commented Nov 25, 2020

@eladb this is ready for review and will fix the issue

@ligaz
Copy link
Contributor

ligaz commented Nov 25, 2020

@jogold Can you update the README.md as well?

@jogold
Copy link
Contributor Author

jogold commented Nov 25, 2020

@jogold Can you update the README.md as well?

Good catch! Done.

@josebrandaoppb
Copy link

josebrandaoppb commented Nov 25, 2020

Nice finding. I'm actually hitting this case right now when passing a vpc to my lambda function. Is there any version where this is not happening ?

@jogold
Copy link
Contributor Author

jogold commented Nov 25, 2020

Nice finding. I'm actually hitting this case right now when passing a vpc to my lambda function. Is there any version where this is not happening ?

The problem starts with 1.75.0

@matthias-pichler
Copy link
Contributor

This actually also happens when I try to deploy a Lambda@Edge (so not only VPC)

@jogold
Copy link
Contributor Author

jogold commented Nov 25, 2020

This actually also happens when I try to deploy a Lambda@Edge (so not only VPC)

Thanks for the feedback, this PR will also fix this.

@msimpsonnz
Copy link
Contributor

I am getting the same issue when trying to add defined IAM Role to the NodeJS function, hopefully this is fixed here too but thought I would mention it

@jogold
Copy link
Contributor Author

jogold commented Nov 26, 2020

hopefully this is fixed here too but thought I would mention it

Yes, it should be the case.

@jogold jogold changed the title fix(lambda-nodejs): maximum call stack size exceeded with function in a VPC fix(lambda-nodejs): maximum call stack size exceeded or converting circular structure to JSON Nov 26, 2020
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 50f439e
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@mergify
Copy link
Contributor

mergify bot commented Nov 29, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 4401725 into aws:master Nov 29, 2020
@jogold jogold deleted the lambda-nodejs-bundling-opts branch November 29, 2020 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants