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

Deno hangs during S3 bucket upload when deploying with AWS CDK #27239

Open
eriklz opened this issue Dec 5, 2024 · 3 comments · May be fixed by #27381
Open

Deno hangs during S3 bucket upload when deploying with AWS CDK #27239

eriklz opened this issue Dec 5, 2024 · 3 comments · May be fixed by #27381
Assignees
Labels
bug Something isn't working correctly needs investigation requires further investigation before determining if it is an issue or not node compat triage required 👀 Deno team needs to make a decision if this change is desired

Comments

@eriklz
Copy link

eriklz commented Dec 5, 2024

Version: Deno 2.1.2

AWS CDK: 2.171.1

When trying to deploy infrastructure using the cdk deploy command, the process hangs when uploading assets to the CDK deplloyment asset S3 bucket. This works fine if using Node.js.

❯ cdk deploy

✨ Synthesis time: 0.4s

my-stack: start: Building 5dc4439c955fa5cef985fdc3a01dc6df93ad4777214f12b9027aba5873263b9f:nnnnnnnnnnnn-eu-west-1
my-stack: success: Built 5dc4439c955fa5cef985fdc3a01dc6df93ad4777214f12b9027aba5873263b9f:nnnnnnnnnnnn-eu-west-1
my-stack: start: Publishing 5dc4439c955fa5cef985fdc3a01dc6df93ad4777214f12b9027aba5873263b9f:nnnnnnnnnnnn-eu-west-1

(no progress from here...)


AWS CDK installed as global install: deno install -g --name cdk npm:aws-cdk

cdk.json:

{
  "app": "deno run -A main.ts"
}

deno.json:

{
  "tasks": {
    "dev": "deno run --watch main.ts"
  },
  "imports": {
    "@std/assert": "jsr:@std/assert@1",
    "aws-cdk-lib": "npm:aws-cdk-lib@^2.171.1"
  }
}

main.ts:

import * as cdk from 'aws-cdk-lib';
import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as process from 'node:process';

const app = new cdk.App();
const stack = new cdk.Stack(app, 'my-stack', {
  env: {
    account: process.env.CDK_DEFAULT_ACCOUNT,
    region: process.env.CDK_DEFAULT_REGION,
  },
});

const vpc = ec2.Vpc.fromLookup(stack, 'my-vpc', {
  isDefault: true,
});

const instance = new ec2.Instance(stack, 'my-ec2', {
  instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.MICRO),
  machineImage: ec2.MachineImage.latestAmazonLinux2023(),
  vpc,
});
@bartlomieju bartlomieju added bug Something isn't working correctly needs investigation requires further investigation before determining if it is an issue or not node compat triage required 👀 Deno team needs to make a decision if this change is desired labels Dec 6, 2024
@gdtroszak
Copy link

FWIW, this behavior started for me at CDK v2.167.0. Perhaps the biggest change was the transition from using aws-sdk v2 to v3.

@gdtroszak
Copy link

gdtroszak commented Dec 13, 2024

I believe the issue indeed has to do with some interaction with the @aws-sdk/client-s3, specifically because of a recent update to the @smithy/node-http-handler dependency around how it handles expect request headers with 100-continue.

I've created a repo the reproduces the problem and demonstrates that using a prior version of @smithy/node-http-handler works.

@roseMix
Copy link

roseMix commented Dec 15, 2024

@gdtroszak Thanks, your solution worked for me.
I've had the same issue with @aws-sdk/client-s3 changing @smithy/node-http-handler version to 3.3.1 in deno.lock worked!

@devsnek devsnek linked a pull request Dec 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly needs investigation requires further investigation before determining if it is an issue or not node compat triage required 👀 Deno team needs to make a decision if this change is desired
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants