Deploying via zip file using REST API issues

The error we see internally is:

too many zip entries

How many files are in the zipfile?

There are 40 files in our current build - are you getting the same error for our previous attempts?

Also, It would be nice to see these errors exposed in the build logs :slight_smile:

1 Like

Hi @michaela,

Do you have your 40 files in a folder inside the zip file or are these files all in the root of the zip file?

Regarding exposing those errors, I’ve added this thread to the enhancement request to improve this and we’ll update here if and when we get that implemented.

1 Like

Hi @Dennis,
there are some in the root of the zip file and nested folders and files, up to three levels deep; usually 1-4 files per folder - no deeply nested zip bomb shenanigans or the like…

Thanks for forwarding my request!

1 Like

Yes, I’m getting this same issue and it seems impossible to debug without seeing the error logs. I’ve probably tried uploading a zip folder 20 different ways at this point and am not sure how to proceed :confused: (also not using anything fancy to zip my folder)

All I see in the deploy logs is:

but it never does anything after that. This user seems to be confused about this too… Here’s my site id in case you’re able to take a look: 93ab841c-95e1-4b7d-bd59-2c31d03cb891

Can’t say exactly what’s wrong with your zipfile, but it causes this error:

Error extracting zip: Is a directory @ rb_sysopen - /tmp/d20200302-10-xkfrkd/

I guess I’d try zipping it differently to see if you can find a way that works better, without any additional details.

Thanks for your message!
… So this is strange. I’m just using Windows 7’s native Send to Zip menu command. It’s the only way I know how to make a zip file on windows… the one I’ve used for at least a decade without issue.

I’ll try to make a .zip file using 7zip.

I’ve tried 7zip to make a .zip file but seeing the same message as before:

image

I’ve tried 7zip to make a .zip file but seeing the same message as before :confused:

Personally, I’m not convinced the way I’m zipping it is actually the problem. After all, I’m using standard zip tools available on Windows. Nothing fancy. So I’m wondering if I’m doing something wrong in Postman - here’s my setup:


So here I’ve uploaded the zip file as a binary file (as recommended by your documentation).

If I upload with the header Content-Type set to application/x-www-form-urlencoded

Then I get:

image

BUT, if I set the Content-Type to application/zip as recommended by your documentation:

Then I get

image

image

Which one of these is right? Neither?

Nitro deploys enabled. Buckle up!

means that this build had a new feature enabled. This indicates the build used a new optimization for how files are uploaded when a deploy is finished.

This feature is enabled for all Netlify sites at this time. It is a new feature and this log entry is there to help us know when it is in use.

Thanks for that clarification @jnisenbom

Unfortunately, I’m still no further along with the Netlify API than I was yesterday. Either I’m doing something really wrong or the ZIP upload endpoint does not work. I’ve tried uploading ZIP files produced by:

I have tried uploading these via:

  • your API
    • via Zip upload
    • via file digest
  • your dashboard

I have done this with:

  • Content-Type set to application/x-www-form-urlencoded
  • Content-Type set to application/zip
  • binary stream
  • trying different filenames

But nothing actually publishes. I’m not given any errors to debug the issues. No time frames within which I can expect these sites to actually publish…or if they are to at all. Almost no feedback about what’s going on. Naturally, this is very frustrating. It’s a bit unexpected, though, considering all of the praise I’ve read on Netlify. Hopefully it’s just something wrong I’m doing. Would be glad to be shown what that is.

I figured it out! What I had been doing, in the pursuit of a simple test, was zipping a single index.html file and uploading that. Instead, what Netlify needs is to first put index.html in a folder, then zip that folder, and finally upload that zipped folder. But because Netlify’s deploy logs do not communicate this error, I went on forcing over 50 variations of the same issue.

I don’t know how common this error is but I wish I hadn’t wasted over 4 hours with it. Especially confusing is to see the this message:
image
which makes me think - oh, the service is work… but then nothing ever happens.

So please consider adding better error logging and testing for this particular upload mishap (where a zipped file rather than a zipped folder is uploaded). Perhaps a warning in the documentation too.

1 Like

Awesome to hear that you’re up and running with the REST API- I know you’ve been wrestling with it for several days now.

We also super appreciate your suggestions and reporting your trial and error process for others who may find this post in the future. I think you’re right that this UI could better reflect the “zipped a file instead of a folder” failure mode- we can’t make any promises about timeline, but I’m going to go ahead and file an issue and we’ll report back here if/when it is resolved. Thanks.

1 Like

When do you add index.html into the folder what name you give to the folder? I stuck at the same place as you before, not able to see the result of the uploaded zip file.

Hi, @sanampatel. It doesn’t matter because you make a zip file of the contents of the directory (and any subdirectories), not the directory itself. Because of this, the directory isn’t ever a part of the zip file.

Hi, I’m facing the exact same issue here.
Deploy failed while extracting zip: Zip end of central directory signature not found
The zip file I create has no problems. unzip -t <file> says No errors detected in compressed data of <file> and if I drag and drop it in the browser UI it deploys just fine.

Hi, @marz. Would you be willing to share that file with us so we can attempt to reproduce the error?

Yes. How do I send you guys the file?

your best bet is probably to upload it to some form of storage somewhere, or share it via dropbox, google docs, etc.

Well, I can’t yet send personal messages to users so I have no way of privately contacting the staff. I am willing to share the zip file with Netlify but not with the whole internet by posting a link to the file here for everyone to see.