aws-cdk: Deployment crashing while zipping assets

  • I’m submitting a …

    • 🪲 bug report
  • What is the current behavior? After upgrading to CDK 0.36.0, deployment fails without an error message while creating an asset zip file for my lambda. Running deploy in verbose mode, i can see the last debug message printed: Preparing zip asset from directory: cdk.out/asset.357a0d25d1...

  • Please tell us about your environment:

    • CDK CLI Version: 0.36.0
    • Module Version: 0.36.0
    • OS: Antergos (Arch Linux)
    • Language: Typescript
  • Other information After looking through the corresponding source code (here) it seems like the process is crashing completely, as the finally statement (removing the staging directory in /tmp) is’nt run, the directory still exists. I’ve made sure there is enough disk space in /tmp and it is writable.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 53 (28 by maintainers)

Commits related to this issue

Most upvoted comments

@jogold I can provide you with the content of the folder on which I always can reproduce this issue (this is node_modules for my project, I also verified that issue remains after I unzip content).

https://drive.google.com/open?id=1LPF5cJX9jZAEPscgp4vJlytJTq0dmZVo

As for the code - I used this one: (based on aws-cdk/lib/archive.js:36)

zipDirectory('/path/to/layer',  '/tmp/1.zip')
  .then(() => console.log('Done'));

The ‘Done’ is never printed for that folder, works fine with other

Some more observations:

  • I tried to remove some folder and it seems that when there are about 7200 files the process works fine (originally there are 10500 files)
  • I’m using Ubuntu 18.04.1 LTS, I have a feeling that it can be a platform-related issue

Can you add this in zipDirectory?

output.on('error', (err) => console.log(err));
output.on('warning', (err) => console.log(err));

Both don’t get called