Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Invalid zip when installing extension #5897

Closed
MiguelCastillo opened this issue Nov 8, 2013 · 7 comments
Closed

Invalid zip when installing extension #5897

MiguelCastillo opened this issue Nov 8, 2013 · 7 comments
Assignees
Milestone

Comments

@MiguelCastillo
Copy link
Contributor

I am trying to install one of my extension via the extension manager, and I get the "not a valid zip" error message. I was trying to debug brackets, but running the latest code keeps on closing my chrome instance; I am running brackets 33, which apparently needs an updated shell to run latest code.

This is the URL I am trying to install.
https://github.com/MiguelCastillo/Brackets-Tern

Same thing happens when I install from the registry. Any help would be great!

-mc

@MiguelCastillo
Copy link
Contributor Author

If this helps, I was able to get some information about the error.

The error happens in package-validator.js:extractAndValidateFiles. unzipper.on("error"... is called with the message below.

[node-log 9:26:28 AM] decompress: [Error: Unsupported file type "SymbolicLink"] NodeDebugUtils.js:117
[node-log 9:26:28 AM] validate callback: null { errors:
[ [ 'INVALID_ZIP_FILE',
'/var/folders/76/79415zbs2cd3gl630nf_jy8h0000gp/T/brackets113108-5552-1lwxu5p' ] ] } NodeDebugUtils.js:117

@ingorichter
Copy link
Contributor

@MiguelCastillo How did you create the zip file? One of my extensions is having issues too.

@MiguelCastillo
Copy link
Contributor Author

I always do the "Download Zip" from my github repo and push that... So, whatever github zip creation process does is out of my control. So, I load up the zip into the plugin registry and I also load using the url link; both have the same problem.

@MiguelCastillo
Copy link
Contributor Author

So, I finally found the cause of the issue. DecompressZip chokes when processing files with type "SymbolicLink". Once I identified which ones were symbolic links, I deleted them from my repo and things are working again.

Tips for debugging:

  1. Open up "extensibility/node/node_modules/decompress_zip/lib/decompress_zip.js"
  2. Go to line 81 and add a console.out to see all the files that are going to be decompressed. This is what my statement looked like:
    .then(function (files) {
    console.log("files", files, options);
    var promises = [];
  3. Look at Chrome Debug console and search for "SymbolicLink". You should be able to find the offending files. :)

Happy debugging!

BTW, I am not sure if there is a clean way to handle symlinks besides deleting them... Maybe there is an option we can pass into DecompressZip to ignore certain file types?

-Miguel

@njx
Copy link

njx commented Nov 16, 2013

Nominating for sprint 35, on the assumption that symlinks might be common in some node use cases (since I think some node modules create things link symlinks into a bin folder?). I don't really know if it's that common though.

@redmunds
Copy link
Contributor

I hit this again today trying to install this extension from url: https://github.com/jbalsas/brackets-apify

@dangoor
Copy link
Contributor

dangoor commented Dec 4, 2013

This is now fixed on master, thanks to Miguel's pull request.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants