-
Notifications
You must be signed in to change notification settings - Fork 4k
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
AWS CDK Java "cdk synth" with NodejsFunction construct returns [ERROR] RangeError: Maximum call stack size exceeded #8902
Comments
@th3r10n can you try with an absolute path for your |
…try file Use absolute paths in `findUp()` to avoid this. Fixes aws#8902
I've added the absolute path to the "entry". But now it complaints about: ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project 02-ecom-create-command-rest-controller: An exception occured while executing the Java class. Cannot find a See errors.txt |
@th3r10n can you share your folder structure? |
Here it is @jogold: |
@th3r10n can you add an "empty" {} The construct currently expects a |
If I add the package.json(empty i.e. {} or with content) the "cdk synth/deploy" just hangs. Adding -X in cdk.json and then executing cdk synth hangs at: |
@jogold wondering if we should have been more explicit about the project root instead of magically looking for a git repo. |
There two issues here:
|
Executing "cdk synth" on a Java CDK project with a Stack that has a NodejsFunction construct is returning:
[ERROR] RangeError: Maximum call stack size exceeded
CreateCommandRestControllerStack.zip
Reproduction Steps
Synthesize the attached CreateCommandRestControllerStack to see the error. Removing the following construct allows the Stack to be synthesized.
NodejsFunction sendProductEventWrapper = NodejsFunction.Builder
.create(this, "SendProductEventHandler")
.entry("resources/lambda/send-product-event.js")
.handler("handler")
.runtime(Runtime.NODEJS_12_X)
.timeout(Duration.seconds(15))
.build();
Error Log
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project 02-ecom-create-command-rest-controller: An exception occured while executing the Java class. Maximum call stack size exceeded
[ERROR] RangeError: Maximum call stack size exceeded
[ERROR] at Object.join (path.js:1033:7)
[ERROR] at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:47:28)
[ERROR] at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
[ERROR] at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
[ERROR] at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
[ERROR] at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
[ERROR] at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
[ERROR] at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
[ERROR] at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
[ERROR] at Kernel._wrapSandboxCode (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:8391:19)
[ERROR] at Kernel._create (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7915:26)
[ERROR] at Kernel.create (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7659:21)
[ERROR] at KernelHost.processRequest (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7439:28)
[ERROR] at KernelHost.run (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7377:14)
[ERROR] at Immediate._onImmediate (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7380:37)
[ERROR] at processImmediate (internal/timers.js:456:21)
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project 02-ecom-create-command-rest-controller: An exception occured while executing the Java class. Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
at Object.join (path.js:1033:7)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:47:28)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at Kernel._wrapSandboxCode (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:8391:19)
at Kernel._create (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7915:26)
at Kernel.create (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7659:21)
at KernelHost.processRequest (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7439:28)
at KernelHost.run (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7377:14)
at Immediate._onImmediate (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7380:37)
at processImmediate (internal/timers.js:456:21)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: An exception occured while executing the Java class. Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
at Object.join (path.js:1033:7)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:47:28)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at Kernel._wrapSandboxCode (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:8391:19)
at Kernel._create (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7915:26)
at Kernel.create (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7659:21)
at KernelHost.processRequest (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7439:28)
at KernelHost.run (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7377:14)
at Immediate._onImmediate (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7380:37)
at processImmediate (internal/timers.js:456:21)
at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:339)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: software.amazon.jsii.JsiiException: Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
at Object.join (path.js:1033:7)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:47:28)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at findUp (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-kernel-q4WbAo/node_modules/@aws-cdk/aws-lambda-nodejs/lib/util.js:50:12)
at Kernel._wrapSandboxCode (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:8391:19)
at Kernel._create (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7915:26)
at Kernel.create (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7659:21)
at KernelHost.processRequest (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7439:28)
at KernelHost.run (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7377:14)
at Immediate._onImmediate (/private/var/folders/wq/ntl4l5ws2hb44qtf6ss8x2s40000gn/T/jsii-java-runtime12917045189774538847/jsii-runtime.js:7380:37)
at processImmediate (internal/timers.js:456:21)
at software.amazon.jsii.JsiiRuntime.processErrorResponse(JsiiRuntime.java:119)
at software.amazon.jsii.JsiiRuntime.requestResponse(JsiiRuntime.java:91)
at software.amazon.jsii.JsiiClient.createObject(JsiiClient.java:88)
at software.amazon.jsii.JsiiEngine.createNewObject(JsiiEngine.java:526)
at software.amazon.awscdk.services.lambda.nodejs.NodejsFunction.(NodejsFunction.java:31)
at software.amazon.awscdk.services.lambda.nodejs.NodejsFunction$Builder.build(NodejsFunction.java:706)
at com.myorg.CreateCommandRestControllerStack.(CreateCommandRestControllerStack.java:84)
at com.myorg.CreateCommandRestControllerStack.(CreateCommandRestControllerStack.java:29)
at com.myorg.CreateCommandRestControllerApp.main(CreateCommandRestControllerApp.java:11)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
at java.base/java.lang.Thread.run(Thread.java:832)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: