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

the-big-fan npm run deploy result in error #273

Open
andsus opened this issue Sep 18, 2022 · 1 comment
Open

the-big-fan npm run deploy result in error #273

andsus opened this issue Sep 18, 2022 · 1 comment

Comments

@andsus
Copy link

andsus commented Sep 18, 2022

Steps:
On cloud9
git clone https://github.com/cdk-patterns/serverless.git
cd the-big-hit
npm run build
npm run deploy

9:08:16 PM | CREATE_FAILED        | AWS::Lambda::Function           | SQSCreatedStatusSu...bdaHandler0467DB95
Resource handler returned message: "Uploaded file must be a non-empty zip (Service: Lambda, Status Code: 400, Request ID: b2f597b6-3556-4df6-8d90-3541ed3ed7c0)" (RequestToken: b2579
b25-26d2-662e-ff4b-28fb634df493, HandlerErrorCode: InvalidRequest)

        new Function (/home/ec2-user/environment/serverless/the-big-fan/typescript/node_modules/@aws-cdk/aws-lambda/lib/function.ts:608:35)
        \_ new TheBigFanStack (/home/ec2-user/environment/serverless/the-big-fan/typescript/lib/the-big-fan-stack.ts:65:45)
        \_ Object.<anonymous> (/home/ec2-user/environment/serverless/the-big-fan/typescript/bin/the-big-fan.ts:7:1)
        \_ Module._compile (node:internal/modules/cjs/loader:1126:14)
        \_ Module.m._compile (/home/ec2-user/environment/serverless/the-big-fan/typescript/node_modules/ts-node/src/index.ts:1056:23)
        \_ Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
        \_ Object.require.extensions.<computed> [as .ts] (/home/ec2-user/environment/serverless/the-big-fan/typescript/node_modules/ts-node/src/index.ts:1059:12)
        \_ Module.load (node:internal/modules/cjs/loader:1004:32)
        \_ Function.Module._load (node:internal/modules/cjs/loader:839:12)

Same issue with the-scalable-webhook

@sumitlni
Copy link

sumitlni commented Oct 2, 2022

I ran into the same issue but with the-eventbridge-etl. The issue seemed to be caused by the fact that I had previously deployed a template using v2 of the CDK, and these templates are using v1.

To resolve the issue, I followed these steps:

  1. Created a new CDK project, using cdk init app --language=typescript in a new directory
  2. Copied over the code and replaced the "aws-cdk" entries with "aws-cdk-lib" entries (basically switching from v1 to v2 of the CDK)
  3. (Optional) added platform: Platform.LINUX_AMD64 in ContainerImage.fromAsset as I am running cdk deploy from a Mac with M1 chip and the Fargate task running the docker container was throwing exec format error. I also updated the Makefile for the container at the stage where docker build is called, to use --platform=linux/amd64.

After making these changes, I was able to deploy and run the-eventbridge-etl pattern successfully. Hopefully these steps will help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants