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

Lambda: cdk deploy suddenly getting ECONNRESET on asset publish #28763

Open
matan-orland-lmnd opened this issue Jan 18, 2024 · 3 comments
Open
Labels
@aws-cdk/aws-lambda Related to AWS Lambda @aws-cdk/aws-s3 Related to Amazon S3 bug This issue is a bug. effort/medium Medium work item – several days of effort p2

Comments

@matan-orland-lmnd
Copy link

matan-orland-lmnd commented Jan 18, 2024

Describe the bug

I have a stack that contains docker images. I've been deploying it locally for the past 4 months without a hitch (deploy also worked on my partner's computer), and then suddenly today I've started getting fail: read ECONNRESET. I'm using PythonLambda construct, as well as DockerImageFunction construct. All fail.

When running cdk deploy with --verbose I see these errors are as follows:

[23:47:53] Call failed: getBucketLocation({"Bucket":"cdk-hnb659fds-assets-REDACTED-us-east-1"}) => read ECONNRESET (code=TimeoutError)

and

[23:47:32] Call failed: listObjectsV2({"Bucket":"cdk-hnb659fds-assets-REDACTED-us-east-1","Prefix":"1ce78b814fad9fc710c056afbe94fd1fe40b81d185a68ffa975c6079c9a9cd53.zip","MaxKeys":1}) => read ECONNRESET (code=TimeoutError)

Other AWS CLI requests to the account work (such as to ECR).

This started today on both computers I and my partner have access to. Could not find a solution for the life of me. both AWS CLI and AWS CDK, and all libraries are on latest versions.

Deploy finishes with:

Deployment failed: Error: Failed to publish asset 109bd108d6c60e825885f808d1cf43f42060382afaceed0935d0028c2d821a18:REDACTED-us-east-1
    at Deployments.publishSingleAsset (/Users/matan.orland/.nvm/versions/node/v18.9.0/lib/node_modules/aws-cdk/lib/index.js:424:11655)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.publishAsset (/Users/matan.orland/.nvm/versions/node/v18.9.0/lib/node_modules/aws-cdk/lib/index.js:424:180233)
    at async /Users/matan.orland/.nvm/versions/node/v18.9.0/lib/node_modules/aws-cdk/lib/index.js:424:164772

No issues on AWS status pages reported for S3.

Expected Behavior

Stack should deploy and assets should be published.

Current Behavior

Failing with:

Deployment failed: Error: Failed to publish asset 109bd108d6c60e825885f808d1cf43f42060382afaceed0935d0028c2d821a18:REDACTED-us-east-1
    at Deployments.publishSingleAsset (/Users/matan.orland/.nvm/versions/node/v18.9.0/lib/node_modules/aws-cdk/lib/index.js:424:11655)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.publishAsset (/Users/matan.orland/.nvm/versions/node/v18.9.0/lib/node_modules/aws-cdk/lib/index.js:424:180233)
    at async /Users/matan.orland/.nvm/versions/node/v18.9.0/lib/node_modules/aws-cdk/lib/index.js:424:164772

after getting:

[23:47:53] Call failed: getBucketLocation({"Bucket":"cdk-hnb659fds-assets-REDACTED-us-east-1"}) => read ECONNRESET (code=TimeoutError)

and

[23:47:32] Call failed: listObjectsV2({"Bucket":"cdk-hnb659fds-assets-REDACTED-us-east-1","Prefix":"1ce78b814fad9fc710c056afbe94fd1fe40b81d185a68ffa975c6079c9a9cd53.zip","MaxKeys":1}) => read ECONNRESET (code=TimeoutError)

Reproduction Steps

Create a stack in us-east-1 which uses the PythonLambda or the DockerImageFunction constructs. Example usage:

    const lambda = new lambda.DockerImageFunction(this, 'some-name', {
      functionName: 'some-name',
      code: lambda.DockerImageCode.fromImageAsset('path/to/dockerfile'),
      memorySize: 2048,
      ephemeralStorageSize: cdk.Size.gibibytes(2),
      architecture: lambda.Architecture.X86_64,
      timeout: cdk.Duration.minutes(10),
      retryAttempts: 0,
    })

Possible Solution

I have read somewhere that this is because the underlying AWS SDK uses V4 signatures, and S3 expects V2. Not sure if that is the case here, or why it would change all of a sudden.

Additional Information/Context

I have already tried several versions of CDK, as well as to delete the CDKToolkit stack and reinstall it. Nothing worked.

CDK CLI Version

2.122.0 (build 7e77e02)

Framework Version

No response

Node.js Version

v18.9.0

OS

MacOS 14.2.1 (23C71) (Sonoma)

Language

TypeScript

Language Version

No response

Other information

Thank you <3

@matan-orland-lmnd matan-orland-lmnd added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 18, 2024
@github-actions github-actions bot added the @aws-cdk/aws-s3 Related to Amazon S3 label Jan 18, 2024
@matan-orland-lmnd matan-orland-lmnd changed the title S3: cdk deploy suddenly getting ECONNRESET Lambda: cdk deploy suddenly getting ECONNRESET on asset publish Jan 18, 2024
@github-actions github-actions bot added the @aws-cdk/aws-lambda Related to AWS Lambda label Jan 18, 2024
@matan-orland-lmnd
Copy link
Author

Update - I tried deploying my stack to us-west-2 and it seems to be working fine. I guess something is wrong with S3 in us-east-1?

@pahud
Copy link
Contributor

pahud commented Jan 19, 2024

[23:47:53] Call failed: getBucketLocation({"Bucket":"cdk-hnb659fds-assets-REDACTED-us-east-1"}) => read ECONNRESET (code=TimeoutError)

[23:47:32] Call failed: listObjectsV2({"Bucket":"cdk-hnb659fds-assets-REDACTED-us-east-1","Prefix":"1ce78b814fad9fc710c056afbe94fd1fe40b81d185a68ffa975c6079c9a9cd53.zip","MaxKeys":1}) => read ECONNRESET (code=TimeoutError)

Looks like it's a timeout error. Are you able to list all objects in the bucket using AWS CLI?

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jan 19, 2024
@matan-orland-lmnd
Copy link
Author

matan-orland-lmnd commented Jan 19, 2024

@pahud thank you, yes I am able to list no problem.

aws s3 ls s3://cdk-hnb659fds-assets-REDACTED-us-east-1

works just fine.

Just to add some clarification from before - my partner's computer is not only on a different internet connection, but in a different city.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda Related to AWS Lambda @aws-cdk/aws-s3 Related to Amazon S3 bug This issue is a bug. effort/medium Medium work item – several days of effort p2
Projects
None yet
Development

No branches or pull requests

2 participants