# Deploy failed while extracting zip - Netlify API - ZIP

**URL:** <https://answers.netlify.com/t/deploy-failed-while-extracting-zip-netlify-api-zip/50897>\
**Category:** Support\
**Tags:** netlify-api, deployment\
**Created:** [January 27, 2022, 10:25pm UTC](https://answers.netlify.com/t/deploy-failed-while-extracting-zip-netlify-api-zip/50897 "2022-01-27T22:25:24Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![remyrichard974](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/remyrichard974/32/23695_2.png) [@remyrichard974](https://answers.netlify.com/u/remyrichard974)\
**Post date:** [January 27, 2022, 10:25pm UTC](https://answers.netlify.com/t/deploy-failed-while-extracting-zip-netlify-api-zip/50897/1 "2022-01-27T22:25:24Z")

</div>

Hello everyone !

I have a problem with my deployment. I would like to deploy a website using zip file with an api in javascript

This is my javascript code :

```auto
	const zipper = require('zip-local');
	
	zipper.sync.zip(`${__dirname}/static/`).compress().save(`${__dirname}/builds/lastest_export.zip`);
	
	const url = `https://api.netlify.com/api/v1/sites/${process.env.NETLIFY_ID}/deploys`
	const file = fs.createReadStream(`${__dirname}/builds/lastest_export.zip`)
	axios.post(url, file, {
		headers: {
			'Content-Type': 'application/zip',
			'Authorization': 'Bearer ' + process.env.NETLIFY_TOKEN 
		}
	}).then((result) => {
		// Some Code
	})

```

When my js code is executed i have in Netlify a new deploy named “Production - Uploaded” and in the deploy log i have :

```auto
10:44:56 PM: Creating deploy upload records
10:44:56 PM: Unpacking archive
10:45:18 PM: Unpacking archive
10:46:05 PM: Unpacking archive
10:47:25 PM: Unpacking archive

```

This is the POST result datas : [Post result - Pastebin.com](https://pastebin.com/PHxqDGjc)

After few seconds i have this :

![3](https://global.discourse-cdn.com/netlify/original/3X/a/b/ab0b04cb7c13bb87b1fbe6e303a32fc6e8288bc8.png)

and nothing more in the Deploy Log.

In my zip file i have 6 html files and 3 folders. The size of my zip file is : 4 530kb

Thank you for your help

---

<div class="post-metadata">

**Author:** ![perry](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/perry/32/16_2.png) [@perry](https://answers.netlify.com/u/perry)\
**Post date:** [January 28, 2022, 6:48pm UTC](https://answers.netlify.com/t/deploy-failed-while-extracting-zip-netlify-api-zip/50897/2 "2022-01-28T18:48:33Z")

</div>

hi there, sorry this is happening!

we have been doing some work on this part of the app lately and how zipping works may have been affected.

can you confirm that it is still not working, or did something improve or change? thanks.

---

<div class="post-metadata">

**Author:** ![remyrichard974](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/remyrichard974/32/23695_2.png) [@remyrichard974](https://answers.netlify.com/u/remyrichard974)\
**Post date:** [January 29, 2022, 6:26am UTC](https://answers.netlify.com/t/deploy-failed-while-extracting-zip-netlify-api-zip/50897/3 "2022-01-29T06:26:47Z")

</div>

Hi Perry,

I confirm, it still not working and nothing new

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [January 30, 2022, 5:01pm UTC](https://answers.netlify.com/t/deploy-failed-while-extracting-zip-netlify-api-zip/50897/4 "2022-01-30T17:01:20Z")

</div>

Hey @remyrichard974,

Would you be able to share the zip file that you’re sending over?

---

<div class="post-metadata">

**Author:** ![remyrichard974](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/remyrichard974/32/23695_2.png) [@remyrichard974](https://answers.netlify.com/u/remyrichard974)\
**Post date:** [February 2, 2022, 9:25pm UTC](https://answers.netlify.com/t/deploy-failed-while-extracting-zip-netlify-api-zip/50897/7 "2022-02-02T21:25:31Z")

</div>

Hello hrishikesh,

Yes no problem, this is the download link for the zip file : [https://we.tl/t-Gt1nlcLJ7N](https://we.tl/t-Gt1nlcLJ7N)

About the zip file, I tried to publish it manualy and it worked.

---

<div class="post-metadata">

**Author:** ![audrey](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/audrey/32/24328_2.png) [@audrey](https://answers.netlify.com/u/audrey)\
**Post date:** [February 4, 2022, 4:46am UTC](https://answers.netlify.com/t/deploy-failed-while-extracting-zip-netlify-api-zip/50897/8 "2022-02-04T04:46:33Z")

</div>

Thanks for sharing the zip file, @remyrichard974 !

We were able to repro the issue and found in our logs that the deploy failed while extracting zip due to too many zip entries. Your zip file contained over 90 files and not 6. 😆

We believe this is a bug and will file a bug report. We’ll update you on what we find!

---

<div class="post-metadata">

**Author:** ![audrey](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/audrey/32/24328_2.png) [@audrey](https://answers.netlify.com/u/audrey)\
**Post date:** [February 9, 2022, 3:08pm UTC](https://answers.netlify.com/t/deploy-failed-while-extracting-zip-netlify-api-zip/50897/12 "2022-02-09T15:08:58Z")

</div>

Hey @remyrichard974 ,

Would you be able to share another WeTransfer link for the zip file? Your last one expired and we didn’t back it up. Let us know, and thank you! 🙏

---

<div class="post-metadata">

**Author:** ![remyrichard974](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/remyrichard974/32/23695_2.png) [@remyrichard974](https://answers.netlify.com/u/remyrichard974)\
**Post date:** [February 9, 2022, 7:16pm UTC](https://answers.netlify.com/t/deploy-failed-while-extracting-zip-netlify-api-zip/50897/13 "2022-02-09T19:16:45Z")

</div>

Hello, Sorry i didn’t get the notification for your answer

Yeah the file contains 6 files and 3 folders in the root of the zip, sorry, I should have specified ^^

Yeah sure : [https://we.tl/t-scdHoh3lDy](https://we.tl/t-scdHoh3lDy)

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![audrey](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/audrey/32/24328_2.png) [@audrey](https://answers.netlify.com/u/audrey)\
**Post date:** [February 9, 2022, 7:33pm UTC](https://answers.netlify.com/t/deploy-failed-while-extracting-zip-netlify-api-zip/50897/14 "2022-02-09T19:33:11Z")

</div>

Thanks so much @remyrichard974:netliheart:

We’ll circle back once the bug has been fixed!

---

<div class="post-metadata">

**Author:** ![remyrichard974](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/remyrichard974/32/23695_2.png) [@remyrichard974](https://answers.netlify.com/u/remyrichard974)\
**Post date:** [February 9, 2022, 7:44pm UTC](https://answers.netlify.com/t/deploy-failed-while-extracting-zip-netlify-api-zip/50897/15 "2022-02-09T19:44:42Z")

</div>

Okay, Thank you for your help 🙂

---

<div class="post-metadata">

**Author:** ![steve.s.paul22](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/steve.s.paul22/32/23695_2.png) [@steve.s.paul22](https://answers.netlify.com/u/steve.s.paul22)\
**Post date:** [May 9, 2022, 10:56pm UTC](https://answers.netlify.com/t/deploy-failed-while-extracting-zip-netlify-api-zip/50897/16 "2022-05-09T22:56:06Z")

</div>

Hi, has the bug been fixed…i tried doing the same and got the same error

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [May 11, 2022, 4:15pm UTC](https://answers.netlify.com/t/deploy-failed-while-extracting-zip-netlify-api-zip/50897/17 "2022-05-11T16:15:21Z")

</div>

Hey @steve.s.paul22,

This has since been fixed. Could you share more details about your case?

---

<div class="post-metadata">

**Author:** ![steve.s.paul22](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/steve.s.paul22/32/23695_2.png) [@steve.s.paul22](https://answers.netlify.com/u/steve.s.paul22)\
**Post date:** [May 11, 2022, 6:13pm UTC](https://answers.netlify.com/t/deploy-failed-while-extracting-zip-netlify-api-zip/50897/18 "2022-05-11T18:13:04Z")

</div>

yeah so i tried both options of first creating a site and then deploying via zip and doing uploaing zip & and creating site together in one rewuest. both options result in build failing when it unzips. Do keep in mind my zips have atleast 10+ files inside them…  
then i tired the file digest method, creating and uploading the file digest with hashes work but uploading the file itself with a PUT request say “record not found”

---

<div class="post-metadata">

**Author:** ![steve.s.paul22](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/steve.s.paul22/32/23695_2.png) [@steve.s.paul22](https://answers.netlify.com/u/steve.s.paul22)\
**Post date:** [May 12, 2022, 4:38am UTC](https://answers.netlify.com/t/deploy-failed-while-extracting-zip-netlify-api-zip/50897/19 "2022-05-12T04:38:11Z")

</div>

Actually i got the file digest method to work i was reading the file data wrong. i just had to do open(file\_name, ‘rb’). Im assuming that caused the issue with the zip as well anyways…its working now

---

<div class="post-metadata">

**Author:** ![audrey](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/audrey/32/24328_2.png) [@audrey](https://answers.netlify.com/u/audrey)\
**Post date:** [May 12, 2022, 2:52pm UTC](https://answers.netlify.com/t/deploy-failed-while-extracting-zip-netlify-api-zip/50897/20 "2022-05-12T14:52:58Z")

</div>

Awesome, very glad to hear it! And thank you for sharing your solution with us @steve.s.paul22 !
