30x / shipyardctl

command line interface for Shipyard API
Apache License 2.0
0 stars 3 forks source link

Created bundle cannot be unzipped #44

Closed whitlockjc closed 7 years ago

whitlockjc commented 7 years ago

Using unzip to unzip the created bundle, you run into errors like this:

unzip my-app.zip
Archive:  my-app.zip
error [my-app.zip]:  missing 128 bytes in zipfile
  (attempting to process anyway)
error [my-app.zip]:  attempt to seek before beginning of zipfile
  (please check that you have transferred or created the zipfile in the
  appropriate BINARY mode and that you have compiled UnZip properly)
  (attempting to re-compensate)
   creating: apiproxy/
file #2:  bad zipfile offset (local header sig):  55
  (attempting to re-compensate)
error [my-app.zip]:  attempt to seek before beginning of zipfile
  (please check that you have transferred or created the zipfile in the
  appropriate BINARY mode and that you have compiled UnZip properly)
error [my-app.zip]:  attempt to seek before beginning of zipfile
  (please check that you have transferred or created the zipfile in the
  appropriate BINARY mode and that you have compiled UnZip properly)
file #4:  bad zipfile offset (local header sig):  435
file #5:  bad zipfile offset (local header sig):  498
file #6:  bad zipfile offset (local header sig):  840
file #7:  bad zipfile offset (local header sig):  903
file #8:  bad zipfile offset (local header sig):  1206

I'm sure this is more an issue with https://github.com/30x/zipper but since a client found it using shipyardctl create bundle, it made sense to start here.

noahdietz commented 7 years ago

@AdamMagaluk i don't remember running into this when we first tested/merged it, do you?

I just tried it myself and it does in fact behave as reported above...

AdamMagaluk commented 7 years ago

Same, i'm having the same issue. Looking into tomorrow.

AdamMagaluk commented 7 years ago

Found the issue. It is actually two issues.

When a refactored my test script into a package I messed up rewriting the "Offset of start of central directory, relative to start of archive" in the End of central directory record (EOCD).

When that was fixed I was able to upload the zips to Edge and unzip them with the Mac Finder but using unzip I was still getting file #2: bad zipfile offset (local header sig): 55 errors.

This is caused by not updating the "Relative offset of local file header" in each Central directory file header.

Will have a PR shortly.