Skip to content

Getting error: failed: _ToolkitError: connect ENOMEM 44.216.188.38:443 - Local (0.0.0.0:0) after running cdk deploy {stack-name}

0

Hi. I've been trying to deploy a cdk stack and keep getting the error from the title. It happens almost always a little before finalizing the creation of the resources. Now I know that it is a memory issue, which is unlikely in my case since I have enough RAM available. In one part of my code, I invoke a lambda handler that was written in TS. I tried to rewrite it with JS so it wouldn't have to use esbuild and add more memory usage. I also restarted my laptop and still doesn't work... does anyone know why could this be happening? When I check my CloudFormation pane, I see that is still in the "CREATE_IN_PROGRESS" status.

2 Answers
0

This error message indicates a memory issue during the CDK deployment process. The "ENOMEM" error code specifically refers to "not enough memory" when trying to establish a connection to the AWS CloudFormation service.

While you mention having enough RAM available on your system, there are several potential causes and solutions to consider:

  1. CloudFormation stack status: Since your CloudFormation stack is stuck in "CREATE_IN_PROGRESS" status, it's possible that a resource is taking longer than expected to create or has failed but hasn't properly reported back. This can cause the CDK CLI to wait indefinitely and potentially consume memory.

  2. Network connection issues: The error shows it's trying to connect to an AWS endpoint (44.216.188.38:443). Network issues or proxy configurations might be contributing to the problem.

  3. Node.js memory limitations: By default, Node.js has memory limitations that might be reached during complex CDK deployments. You can try increasing the Node.js memory limit by setting an environment variable before running your deployment:

export NODE_OPTIONS=--max_old_space_size=4096

(This sets the limit to 4GB, adjust as needed)

  1. CDK deployment options: You could try using the --no-rollback flag with your deployment to prevent automatic rollback if a resource fails to create:
cdk deploy --no-rollback {stack-name}
  1. Check CloudFormation logs: If a specific resource is failing to create, you might find more details in the CloudFormation events for your stack in the AWS Console.

  2. Break up your stack: If your stack is very large or complex, consider breaking it into smaller, more manageable stacks.

If the issue persists, you might need to manually delete the stack from the AWS CloudFormation console and try deploying again, possibly with a simplified version of your stack to identify the problematic resource.
Sources
Troubleshooting cluster deployment issues - AWS ParallelCluster
Community | Bootstrapping an Amazon EC2 Instance Using User-data to Run a Python Web App

answered 10 months ago
EXPERT
reviewed 10 months ago
0

Hello.

I have found cases where errors are occurring due to problems with software installed on the PC.
Just to be on the safe side, please check that there is no security software, proxy software, or other software on your PC interfering with the operation of CDK.
https://github.com/aws/aws-cdk/discussions/32870

EXPERT
answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Relevant content