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 :
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
perry
January 28, 2022, 6:48pm
2
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.
audrey
February 4, 2022, 4:46am
8
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!
1 Like
audrey
February 9, 2022, 3:08pm
12
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!
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
1 Like
audrey
February 9, 2022, 7:33pm
14
Thanks so much @remyrichard974
Weâll circle back once the bug has been fixed!
2 Likes
Okay, Thank you for your help
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
audrey
May 12, 2022, 2:52pm
20
Awesome, very glad to hear it! And thank you for sharing your solution with us @steve.s.paul22 !