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

Applications stack deployment error & fix #281

Open
peteryxu opened this issue Jun 16, 2024 · 0 comments
Open

Applications stack deployment error & fix #281

peteryxu opened this issue Jun 16, 2024 · 0 comments

Comments

@peteryxu
Copy link

ERROR

Applications: deploying... [1/1]
Applications: creating CloudFormation changeset...
9:10:17 PM | CREATE_FAILED | AWS::Lambda::Function | CustomCDKECRDeploy...3666512MiB28EAD8E4
Resource handler returned message: "Uploaded file must be a non-empty zip (Service: Lambda, Status Code: 400, Request ID: 9fc46249-9abf-4e4b-84bc-6849ba071f52)" (RequestT
oken: f4846778-f1e8-ac7f-cfe4-5ed84092ed8e, HandlerErrorCode: InvalidRequest)

    new Function (/home/ubuntu/environment/workshopfiles/one-observability-demo/PetAdoptions/cdk/pet_stack/node_modules/aws-cdk-lib/aws-lambda/lib/function.js:1:11553)
    \_ SingletonFunction.ensureLambda (/home/ubuntu/environment/workshopfiles/one-observability-demo/PetAdoptions/cdk/pet_stack/node_modules/aws-cdk-lib/aws-lambda/lib/singlelowing resource(s) failed to create: [PetSiteServiceAccount6A1851C9, petadoptionshistoryapplicationPetSiteServiceAccountA79DAB67, CustomCDKECRDeploymentbd07c930edb

I did extensive debugging, and found out it was mostly due to the version of these two packages. After I bump both to the lastest version, the Applications stack deploys fine now.

"aws-cdk-lib": &&& "cdk-ecr-deployment":

new package.json

"dependencies": {
"@aws-cdk/aws-lambda-python-alpha": "^2.146.0-alpha.0",
"@types/js-yaml": "^4.0.9",
"aws-cdk-lib": "^2.146.0",
"cdk-ecr-deployment": "^3.0.67",
"jest": "^29.7.0",
"js-yaml": "^4.1.0",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/node": "^20.11.25",
"aws-cdk": "^2.146.0",
"cdk-nag": "^2.28.144",
"constructs": "^10.3.0",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"ts-replace-all": "^1.0.0",
"typescript": "^5.4.2"
}

ERROR Details

Applications: deploying... [1/1]
Applications: creating CloudFormation changeset...
9:10:17 PM | CREATE_FAILED | AWS::Lambda::Function | CustomCDKECRDeploy...3666512MiB28EAD8E4
Resource handler returned message: "Uploaded file must be a non-empty zip (Service: Lambda, Status Code: 400, Request ID: 9fc46249-9abf-4e4b-84bc-6849ba071f52)" (RequestT
oken: f4846778-f1e8-ac7f-cfe4-5ed84092ed8e, HandlerErrorCode: InvalidRequest)

    new Function (/home/ubuntu/environment/workshopfiles/one-observability-demo/PetAdoptions/cdk/pet_stack/node_modules/aws-cdk-lib/aws-lambda/lib/function.js:1:11553)
    \_ SingletonFunction.ensureLambda (/home/ubuntu/environment/workshopfiles/one-observability-demo/PetAdoptions/cdk/pet_stack/node_modules/aws-cdk-lib/aws-lambda/lib/singlelowing resource(s) failed to create: [PetSiteServiceAccount6A1851C9, petadoptionshistoryapplicationPetSiteServiceAccountA79DAB67, CustomCDKECRDeploymentbd07c930edb

ton-lambda.js:1:2886)
_ new SingletonFunction (/home/ubuntu/environment/workshopfiles/one-observability-demo/PetAdoptions/cdk/pet_stack/node_modules/aws-cdk-lib/aws-lambda/lib/singleton-lambd PM | ROLLBACK_IN_PROGRESS | AWS::CloudFormation::Stack | Applications
a.js:1:866)
_ new ECRDeployment (/home/ubuntu/environment/workshopfiles/one-observability-demo/PetAdoptions/cdk/pet_stack/node_modules/cdk-ecr-deployment/src/index.ts:140:20)
_ new ContainerImageBuilder (/home/ubuntu/environment/workshopfiles/one-observability-demo/PetAdoptions/cdk/pet_stack/lib/common/container-image-builder.ts:42:9)
_ new Applications (/home/ubuntu/environment/workshopfiles/one-observability-demo/PetAdoptions/cdk/pet_stack/lib/applications.ts:96:47)
_ Object. (/home/ubuntu/environment/workshopfiles/one-observability-demo/PetAdoptions/cdk/pet_stack/app/pet_stack.ts:19:22)

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

1 participant