Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLOSED] Invalid zip when installing extension #5390

Open
core-ai-bot opened this issue Aug 30, 2021 · 7 comments
Open

[CLOSED] Invalid zip when installing extension #5390

core-ai-bot opened this issue Aug 30, 2021 · 7 comments

Comments

@core-ai-bot
Copy link
Member

Issue by MiguelCastillo
Friday Nov 08, 2013 at 01:56 GMT
Originally opened as adobe/brackets#5897


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

@core-ai-bot
Copy link
Member Author

Comment by MiguelCastillo
Friday Nov 08, 2013 at 14:29 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by ingorichter
Friday Nov 08, 2013 at 19:00 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by MiguelCastillo
Friday Nov 08, 2013 at 19:05 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by MiguelCastillo
Saturday Nov 09, 2013 at 03:19 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by njx
Saturday Nov 16, 2013 at 01:00 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Saturday Nov 16, 2013 at 01:21 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by dangoor
Wednesday Dec 04, 2013 at 14:04 GMT


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

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

No branches or pull requests

1 participant