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

Maximum call stack size exceeded - python 3.6 - jsii 0.21.1 #5877

Closed
medbensalem opened this issue Jan 20, 2020 · 6 comments
Closed

Maximum call stack size exceeded - python 3.6 - jsii 0.21.1 #5877

medbensalem opened this issue Jan 20, 2020 · 6 comments
Assignees
Labels
bug This issue is a bug. closing-soon This issue will automatically close in 4 days unless further comments are made.

Comments

@medbensalem
Copy link

medbensalem commented Jan 20, 2020

We are currently working with CDK to deploy multiple stacks that create an ECS Cluster/tasks and ALBs.
Deploying more than a certain number of stacks simultaneously creates the error reported bellow. Deploying the stacks individually works perfectly.
I wanted to note that in my code I'm passing some cdk objects from stack to stack like in the example in this link:
https://github.com/aws-samples/aws-cdk-examples/blob/master/python/codepipeline-docker-build/Base.py#L68-L70
https://github.com/aws-samples/aws-cdk-examples/blob/master/python/codepipeline-docker-build/app.py#L12-L15

Reproduction Steps

I don't have any easy way to reproduce the steps without sharing confidential code.

Error Log

$ cdk synthesize -c "deploy=stg"

/Users/med.bensalem/WorkSpace/repos/devops.cdk-pipeline/infrastructure/.env/lib/python3.6/site-packages/jsii/_embedded/jsii/jsii-runtime.js:13374
                throw e;
                ^

RangeError: Maximum call stack size exceeded
    at new Uint8Array (<anonymous>)
    at new FastBuffer (internal/buffer.js:944:1)
    at Function.alloc (buffer.js:358:10)
    at SyncStdio.readLine (/Users/med.bensalem/WorkSpace/repos/devops.cdk-pipeline/infrastructure/.env/lib/python3.6/site-packages/jsii/_embedded/jsii/jsii-runtime.js:13350:33)
    at SyncStdio.readLine (/Users/med.bensalem/WorkSpace/repos/devops.cdk-pipeline/infrastructure/.env/lib/python3.6/site-packages/jsii/_embedded/jsii/jsii-runtime.js:13379:25)
    at SyncStdio.readLine (/Users/med.bensalem/WorkSpace/repos/devops.cdk-pipeline/infrastructure/.env/lib/python3.6/site-packages/jsii/_embedded/jsii/jsii-runtime.js:13379:25)
    at SyncStdio.readLine (/Users/med.bensalem/WorkSpace/repos/devops.cdk-pipeline/infrastructure/.env/lib/python3.6/site-packages/jsii/_embedded/jsii/jsii-runtime.js:13379:25)
    at SyncStdio.readLine (/Users/med.bensalem/WorkSpace/repos/devops.cdk-pipeline/infrastructure/.env/lib/python3.6/site-packages/jsii/_embedded/jsii/jsii-runtime.js:13379:25)
    at SyncStdio.readLine (/Users/med.bensalem/WorkSpace/repos/devops.cdk-pipeline/infrastructure/.env/lib/python3.6/site-packages/jsii/_embedded/jsii/jsii-runtime.js:13379:25)
    at SyncStdio.readLine (/Users/med.bensalem/WorkSpace/repos/devops.cdk-pipeline/infrastructure/.env/lib/python3.6/site-packages/jsii/_embedded/jsii/jsii-runtime.js:13379:25)
Traceback (most recent call last):
  File "infrastructure.py", line 165, in <module>
    ecs_task_name=ecs_task['name']
  File "/Users/med.bensalem/WorkSpace/repos/devops.cdk-pipeline/infrastructure/.env/lib/python3.6/site-packages/jsii/_runtime.py", line 66, in __call__
    inst = super().__call__(*args, **kwargs)
  File "/Users/med.bensalem/WorkSpace/repos/devops.cdk-pipeline/infrastructure/stacks/alb.py", line 53, in __init__
    route_table_id=subnet_route_table
  File "/Users/med.bensalem/WorkSpace/repos/devops.cdk-pipeline/infrastructure/.env/lib/python3.6/site-packages/aws_cdk/aws_ec2/__init__.py", line 23182, in from_subnet_attributes
    return jsii.sinvoke(cls, "fromSubnetAttributes", [scope, id, attrs])
  File "/Users/med.bensalem/WorkSpace/repos/devops.cdk-pipeline/infrastructure/.env/lib/python3.6/site-packages/jsii/_kernel/__init__.py", line 113, in wrapped
    return _recursize_dereference(kernel, fn(kernel, *args, **kwargs))
  File "/Users/med.bensalem/WorkSpace/repos/devops.cdk-pipeline/infrastructure/.env/lib/python3.6/site-packages/jsii/_kernel/__init__.py", line 307, in sinvoke
    args=_make_reference_for_native(self, args),
  File "/Users/med.bensalem/WorkSpace/repos/devops.cdk-pipeline/infrastructure/.env/lib/python3.6/site-packages/jsii/_kernel/providers/process.py", line 351, in sinvoke
    return self._process.send(request, InvokeResponse)
  File "/Users/med.bensalem/WorkSpace/repos/devops.cdk-pipeline/infrastructure/.env/lib/python3.6/site-packages/jsii/_kernel/providers/process.py", line 307, in send
    self._process.stdin.flush()
BrokenPipeError: [Errno 32] Broken pipe
Subprocess exited with error 1

Environment

  • **CDK CLI Version :1.21.0
  • **JSII Version:0.21.1
  • **OS :OSX Catalina
  • **Language :python 3.6

This is 🐛 Bug Report

@medbensalem medbensalem added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 20, 2020
@MrArnoldPalmer
Copy link
Contributor

MrArnoldPalmer commented Jan 21, 2020

Hey there! Some questions for you about this issue.

  1. Was the code that is currently breaking working with previous versions of CDK or JSII?
  2. Was the application working as expected until it got beyond some certain # of stacks or beyond some other parameter that you know of?
  3. Can you provide some high level information about the layout of your stacks? I.E. Stack one creates VPC and security groups, Stack 2 creates ECS Cluster referencing VPC and SGs from Stack 1 etc...
  4. Also when you say deploying stacks simultaneously, does that mean deploying a single stack that has dependencies on other stacks that then get auto-deplyoed or does that mean cdk deploy Stack1 Stack2 Stack3 and the stacks don't necessarily depend on each other?
  5. Does the code break on any command other than deploy? i.e.cdk diff or cdk synth

@MrArnoldPalmer
Copy link
Contributor

Looks like this could be stemming from a known issue with JSII running on NodeJS >= 13.2. What is your current Node Version?

See aws/jsii#1142 for more info on that.

@SomayaB SomayaB added management/jsii response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. closing-soon This issue will automatically close in 4 days unless further comments are made. and removed needs-triage This issue or PR still needs to be triaged. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Jan 21, 2020
@alukach
Copy link
Contributor

alukach commented Jan 27, 2020

@MrArnoldPalmer I was experiencing this issue. Using nvm use 12 to force my node version from 13.7 to 12 did the trick. Thanks!

@medbensalem
Copy link
Author

I confirm that reversing back to node 12, solved the issue.

@LinaToquica
Copy link

I confirm that reversing back to node 12, solved the issue.

worked for me too!

@nenetto
Copy link

nenetto commented Mar 24, 2020

I confirm that reversing back to node 12, solved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closing-soon This issue will automatically close in 4 days unless further comments are made.
Projects
None yet
Development

No branches or pull requests

6 participants