joelspadin-garmin / vscode-private-extension-manager

Private extension manager for Visual Studio Code
103 stars 22 forks source link

File corruption issues with 1.3.0 and Artifactory (6.17.0) #28

Closed PeterMcteague closed 4 years ago

PeterMcteague commented 4 years ago

Hello.

First and foremost, thanks for your work on this extension. I've recently set it up at work with our artifactory 6.17.0 server, and for the most part it is working ideally.

However whenever we use the extension to install extensions from our artifactory npm repository that are greater in size than ~2MB the extensions come down corrupted. This does not occur when pulling packages from the server using "npm pack {extensionName} - that method produces a full tar.gz with a working package. It is possible this is caused by our older artifactory version, or the pacote library you are using but I thought I'd post here in case it isn't, or in case there's any info you can provide which might point me in the right direction.

The extensions I am experiencing this with are the official Microsoft Powershell 2019.11.0.vsix and ms-python.python-2020.2.64397.vsix files, packed in a folder containing their extracted readme's, images etc, and a package.json including name, publisher, version, preview, description, displayName, author, license, icon, bugs, repository, categories, keywords and engines all pulled from the original extensions json file, with the addition of the files key containing a list of files to be uploaded, and a publishConfig with a "registry" key pointing to "https:{our artifactory address}/api/npm/npm-local". npm, extension and vscode keywords have also been added to aid in search querying, and I've packed many extensions this way to our npm server, as per the readme found for this extension.

It works flawlessly for packages containing vsix files under ~2MB however as soon as it goes over, upon pressing install in the private extension manager menu, the packages are added to %appdata%/code/user/globalStorage/garmin.private-extension-manager/packages/{our artifactory npm-local api address without slashes in the url}/[extensionName] but with the vsix files at a greatly reduced size, and a notification appearing reading ""Error running command privateExtensions.extension.install: Corrupt ZIP: end of central directory record signature not found. This is likely caused by the extension that contributes privateExtensions.extension.install".

joelspadin-garmin commented 4 years ago

I'm pretty sure the npm CLI internally uses pacote, so if npm pack works, I'd expect pacote to work too. Could you try downloading your package using the pacote CLI with pacote extract to see if that has the same issue? There have been several changes to pacote since I last released Private Extension Manager, so it's possible I just need to update it.

PeterMcteague commented 4 years ago

Sure thing, I'll give that a go. Might take a short while for me to test due to the setup we've got.

PeterMcteague commented 4 years ago

The problem seemed to lie in our Artifactory version or configuration rather than Pacote. We set up another server with a more up to date version (7.7.3) and the error was no longer present.

joelspadin-garmin commented 4 years ago

Great! Glad you got it figured out.