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

(assets): Uploaded file must be a non-empty zip #15798

Closed
patrick-tresp opened this issue Jul 28, 2021 · 10 comments
Closed

(assets): Uploaded file must be a non-empty zip #15798

patrick-tresp opened this issue Jul 28, 2021 · 10 comments
Assignees
Labels
@aws-cdk/assets Related to the @aws-cdk/assets package bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@patrick-tresp
Copy link

patrick-tresp commented Jul 28, 2021

We are facing the issue, that we can not deploy any environment ( production, staging, development, test ) with cdk deploy anymore.

The error that raised:

Resource handler returned message: "Uploaded file must be a non-empty zip (Service: Lambda, Status Code: 400, Request ID: 11cbd3f4-e5a4-4b7d-a10a-15da3
58f4b64, Extended Request ID: null)" (RequestToken: a6d89298-48b5-44ce-215a-14bd022bca02, HandlerErrorCode: InvalidRequest)

We can see that cdk.out folder is filled with aseets.[assets-id] folders, but no zip folders are created.

Also interesting is the fact, that if we create a fresh account on aws, bootstrap it and deploy there, everything works as expected for exact one time. Any deployment afterwards ( of course with little changes to force an update ) fails with error above.

This happens on local macOS machine as well as previous working github actions with ubuntu/latest OS.

Reproduction Steps

run cdk deploy STACKNAME --profile [aws-profile]

Note: [aws-profile] is set in ' ~/.aws/credentials`

What did you expect to happen?

Assets are beeing created in cdk.out folder and zipped for an upload to S3 Bucket to execute Cloudformation deployment.

What actually happened?

No zip files are created in cdk.out folder.

Environment

  • CDK CLI Version : aws-cli/2.2.21 Python/3.8.8 Darwin/20.5.0 exe/x86_64 prompt/off
  • Framework Version:
  • Node.js Version: v14.17.3
  • OS : MacOs 11.4
  • Language (Version): TypeScript (3.9.7)

Other


This is 🐛 Bug Report

@patrick-tresp patrick-tresp added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 28, 2021
@github-actions github-actions bot added the @aws-cdk/aws-lambda Related to AWS Lambda label Jul 28, 2021
@mattcui
Copy link

mattcui commented Jul 28, 2021

I met the similar problem with my golang based lambda function, but I can see the built main file in the asset folder, like cdk.out/asset.08e3e0605a610fe153bcd368387d926e0e5ef54458413fb7232b708045dcaf63/main (note that it's not a .zip file), and I can see the zipped main file in s3 stage bucket.

@patrick-tresp
Copy link
Author

@mattcui did you find any solution on that?
it seems like it brings our whole infrastructure to a sudden stop.

@mattcui
Copy link

mattcui commented Jul 28, 2021

@patrick-tresp not yet, I have been struggling for 2 days, no any progress so far.

@nija-at nija-at changed the title @aws-cdk/aws-lambda: Uploaded file must be a non-empty zip (assets): Uploaded file must be a non-empty zip Jul 28, 2021
@nija-at nija-at removed the @aws-cdk/aws-lambda Related to AWS Lambda label Jul 28, 2021
@nija-at nija-at removed their assignment Jul 28, 2021
@github-actions github-actions bot added the @aws-cdk/assets Related to the @aws-cdk/assets package label Jul 28, 2021
@mattcui
Copy link

mattcui commented Jul 29, 2021

@patrick-tresp Today, I retried the deployment, it's successful this time, looked that something was fixed perhaps from server-side. You could have a try.

@patrick-tresp
Copy link
Author

patrick-tresp commented Jul 29, 2021

Hey @mattcui , thanks for the notice.
Unfortunately it still runs into same issue BUT a fresh provisioned account does NOT run into this error.

Will run several deployments now to verify and move resources to that account. :(

@patrick-tresp
Copy link
Author

Well after moving all stacks and ressource to the other account, deployment fails also here after a couple passing deployments…

What is going on here…

@patrick-tresp
Copy link
Author

Hey @mattcui ,

try this out: empty your s3 bucket from toolkit cdktoolkit-stagingbucket-xxxxx.
After emptying this, we could deploy again without running into this error.

We also added this to your github action file with

aws s3 rm s3://cdktoolkit-stagingbucket-xxxxx --recursive

Hope that helps you as well.

Cheers,
Patrick

@mattcui
Copy link

mattcui commented Aug 6, 2021

@patrick-tresp Thanks, we haven't had this problem for days, I am not sure what caused the problem, and why it disappeared.

@patrick-tresp
Copy link
Author

AWS Magic …

@github-actions
Copy link

github-actions bot commented Aug 6, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/assets Related to the @aws-cdk/assets package bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

4 participants