Deploy failed while extracting zip - Netlify API - ZIP

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 :

	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 :

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

After few seconds i have this :

3

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

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.

1 Like

Hi Perry,

I confirm, it still not working and nothing new

Hey @remyrichard974,

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

1 Like

Hello hrishikesh,

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

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

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. :laughing:

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

1 Like

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! :pray:

2 Likes

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

Thank you :slight_smile:

1 Like

Thanks so much @remyrichard974 :netliheart:

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

2 Likes

Okay, Thank you for your help :slight_smile:

1 Like

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

Hey @steve.s.paul22,

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

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”

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

1 Like

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