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

Handle broken zip created with adm-zip in a nicer way #1938

Closed
diox opened this issue Mar 28, 2018 · 3 comments
Closed

Handle broken zip created with adm-zip in a nicer way #1938

diox opened this issue Mar 28, 2018 · 3 comments

Comments

@diox
Copy link
Member

diox commented Mar 28, 2018

adm-zip is a popular node package to generate zip files. Somehow, at least one developer using it end up with a weird zip that the linter can't handle. I've attached the zip file in question to this issue.

The error being thrown is

Error: invalid code lengths set
    at Zlib._handle.onerror (zlib.js:370:17)

The linter process terminates when hitting that, and that causes a Validation was unable to complete successfully due to an unexpected error. message on the server.

We should handle that in a nicer way - I don't suggest managing to proceed with validation as the zipfile is weird (various linux tools I had also have issues with it, though nothing as bad as the linter) - but at least return a true linter error.

reyronald added a commit to refined-bitbucket/refined-bitbucket that referenced this issue Apr 2, 2018
Fix the `package` npm script to use the `archiver` npm package instead
of `admin-zip` so that it produces a valid Zip file.

Closes #193

mozilla/addons#672
mozilla/addons-linter#1938
reyronald added a commit to refined-bitbucket/refined-bitbucket that referenced this issue Apr 3, 2018
Fix the `package` npm script to use the `archiver` npm package instead
of `admin-zip` so that it produces a valid Zip file.

Closes #193

mozilla/addons#672
mozilla/addons-linter#1938
@EnTeQuAk EnTeQuAk assigned EnTeQuAk and unassigned EnTeQuAk Apr 6, 2018
@EnTeQuAk EnTeQuAk added this to the 2018.07.05 milestone Jun 8, 2018
@EnTeQuAk EnTeQuAk removed this from the 2018.07.05 milestone Jul 4, 2018
@muffinresearch
Copy link
Contributor

@diox should this be an upstream bug in yauzl?

@diox
Copy link
Member Author

diox commented Jul 29, 2019

I'm not sure, I'm not familiar enough with the linter and yazl to figure out if that's expected behavior (meaning we should be doing something on our end to catch this) or not. Ultimately is too low priority for us to spend a lot of time on it IMHO, but a contributor would be welcome to do it.

@stale
Copy link

stale bot commented Jan 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. If you think this bug should stay open, please comment on the issue with further details. Thank you for your contributions.

@stale stale bot added the state:stale label Jan 25, 2020
@stale stale bot closed this as completed Feb 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants