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

Issues With Installation of Win-CA Extension #53

Closed
mavsravikiran opened this issue May 3, 2024 · 7 comments
Closed

Issues With Installation of Win-CA Extension #53

mavsravikiran opened this issue May 3, 2024 · 7 comments

Comments

@mavsravikiran
Copy link

mavsravikiran commented May 3, 2024

Summary

Issues Facing While Installation of Extension

  • I am trying to download the win-ca.vsix file from the below urls to my local project
- https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ukoloff/vsextensions/win-ca/3.1.0/vspackage
- https://marketplace.visualstudio.com/items?itemName=ukoloff.win-ca
- https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ukoloff/vsextensions/win-ca/latest/vspackage
  • I had Refer the url https://code.visualstudio.com/docs/editor/extension-marketplace#_install-from-a-vsix and used the below command
code --install-extension ukoloff.win-ca-3.1.0.vsix
  • I am facing below error message for different versions like 3.5.1, 3.5.0, 3.4.5, 3.3.0, 3.1.0 using the above command still facing below issue
a [Error]: Corrupt ZIP: end of central directory record signature not found
    at E (C:\Program Files\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:18:13335)
    at C:\Program Files\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:18:14772
    at C:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\yauzl\index.js:37:7
    at C:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\yauzl\index.js:187:5
    at C:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\yauzl\index.js:631:5
    at C:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\fd-slicer\index.js:32:7
    at FSReqCallback.wrapper [as oncomplete] (node:fs:686:5) {
  type: 'CorruptZip',
  cause: Error: end of central directory record signature not found
      at C:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\yauzl\index.js:187:14
      at C:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\yauzl\index.js:631:5
      at C:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\fd-slicer\index.js:32:7
      at FSReqCallback.wrapper [as oncomplete] (node:fs:686:5)
}
Failed Installing Extensions: file:///c%3A/Temp/ukoloff.win-ca-3.1.0.vsix
  • Even When i run the command code --install-extension ukoloff.win-ca and facing the below error message
PS C:\Windows\system32> code --install-extension ukoloff.win-ca
Installing extensions...
read ECONNRESET
Failed Installing Extensions: ukoloff.win-ca
  • Please let me know if any necessary information is required 👍

@ukoloff / @benoitf / @mavaddat / @stevenaw / @addaleax - Need help/solution with a fix is much appreciated 👍

@mavsravikiran
Copy link
Author

@ukoloff / @benoitf / @stevenaw / @addaleax / @mavaddat -- Please kindly take a look and help me on this issue

@stevenaw
Copy link
Contributor

stevenaw commented May 4, 2024

@mavsravikiran
Many of the people you have tagged are one-time contributors to the project who may not have worked with it in a while. As an open source project, we also all do this in our spare time, the quantity of which may vary daily or weekly.

I would recommend a bit of patience. I'm sure that those familiar with the issue will reply once they're able

@mavaddat
Copy link
Contributor

mavaddat commented May 4, 2024

a [Error]: Corrupt ZIP: end of central directory record signature not found

The issue appears to be that the VSIX file you downloaded is not a valid ZIP file.

I would investigate whether this is true by attempting to open the downloaded VSIX using an archiving application like 7-Zip and check if it has the expected structure.

  • If it does not have that structure, I would try using a different browser or using PowerShell or curl to download the VSIX file. Repeat the steps above to check if the download is valid.

  • If it does have the expected structure, then try reinstalling Visual Studio Code or installing another extension using the same technique. If this does not work, do a fully clean reinstall of VS Code.

    • If the issue persists with other extensions, your problem is in how VS Code is functioning — not this extension, per se. In this case, I would seek assistance on StackOverflow rather than on GitHub issues.

@benoitf
Copy link
Contributor

benoitf commented May 4, 2024

vsix link need to be grabbed with compressed flag when downloaded from the marketplace

curl --compressed https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ukoloff/vsextensions/win-ca/3.1.0/vspackage will produce a valid zip

while curl https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ukoloff/vsextensions/win-ca/3.1.0/vspackage won't

@mavsravikiran
Copy link
Author

mavsravikiran commented May 6, 2024

Thanks @benoitf / @mavaddat / @stevenaw 👍 for the quick response

  • Actually i am using the marketplace url https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ukoloff/vsextensions/win-ca/3.1.0/vspackage for downloading to my local application and try to install the extension
  • Below is the Sample Code Block which i am using ansible for installation
- name: Windows - Download win-ca extension using url
  get_url:
    url: "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ukoloff/vsextensions/win-ca/3.1.0/vspackage"
    dest: "/mnt/c/temp/ukoloff.win-ca-3.1.0.vsix"
    force: false
    mode: "0440"
  when: "'ukoloff.win-ca' not in result.stdout_lines"

- name: Windows - Install extension in download folder C:\Users\userid\Downloads\ukoloff.win-ca-3.5.1.vsix
  command: "{{ powershell_path }} 'code --install-extension C:\\Temp\\ukoloff.win-ca-3.1.0.vsix'"
  • Getting the below error message
a [Error]: Corrupt ZIP: end of central directory record signature not found
    at E (C:\Program Files\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:18:13335)
    at C:\Program Files\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:18:14772
    at C:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\yauzl\index.js:37:7
    at C:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\yauzl\index.js:187:5
    at C:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\yauzl\index.js:631:5
    at C:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\fd-slicer\index.js:32:7
    at FSReqCallback.wrapper [as oncomplete] (node:fs:686:5) {
  type: 'CorruptZip',
  cause: Error: end of central directory record signature not found
      at C:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\yauzl\index.js:187:14
      at C:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\yauzl\index.js:631:5
      at C:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\fd-slicer\index.js:32:7
      at FSReqCallback.wrapper [as oncomplete] (node:fs:686:5)
}
Failed Installing Extensions: file:///c%3A/Temp/ukoloff.win-ca-3.1.0.vsix
  • Need a workaround and help how it can be implemented in my application 👍

@mavaddat
Copy link
Contributor

mavaddat commented May 8, 2024

I can suggest some Ansible-specific debugging techniques that might help in this situation:

  1. Use the Ansible Debug Module: The Ansible debug module can be used to print statements during execution. This can be useful for debugging variables or expressions without necessarily halting the playbook. You can add a debug task right after the get_url task to print the result of the download task. This can help you understand if the file was downloaded correctly.

  2. Check the Downloaded File: You can add a task to check if the downloaded file exists and is not empty. This can help confirm whether the get_url task is working as expected.

  3. Try Using a Different Module for Download: If get_url continues to have issues, you might want to try using a different module or method to download the file. For example, you could use the uri module or even a command or shell module to run a curl or wget command. Here's how you might modify the playbook:

    - name: Windows - Download win-ca extension using curl with --compressed
      command:
         cmd: "curl --compressed -o /mnt/c/temp/ukoloff.win-ca-3.1.0.vsix https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ukoloff/vsextensions/win-ca/3.1.0/vspackage"
      when: "'ukoloff.win-ca' not in result.stdout_lines"

    This will run the curl command with the --compressed flag to download the VSIX file. If the file is being served compressed, this should result in a valid ZIP file being downloaded.

  4. Enable Ansible's Retry and Verbose Options: When running the playbook, you can use the -vvv option for a verbose output, which might give you more insight into what's happening. If a task fails, Ansible can retry the task if you provide a retries parameter.

  5. Check Ansible get_url Module Documentation: Review the official Ansible documentation for the get_url module. There might be additional parameters or features that could help in this situation.

  6. Seek Help from the Ansible Community: If all else fails, consider asking for help on Ansible-related forums or communities. Be sure to provide them with all the details, including the Ansible version, the exact playbook you're running, and the full error message you're seeing.

Remember, the error message indicates that the downloaded VSIX file is not a valid ZIP file. So the issue might be with the file being downloaded, rather than Ansible itself. It's possible that the URL is incorrect, the file at the URL is not a valid VSIX file, or there's an issue with the network connection causing the file to be downloaded incompletely or incorrectly. These are all things you can check and test independently of Ansible.

@mavsravikiran
Copy link
Author

Thanks @mavaddat for the quick response and your solution has helped me, it was worked successfully 💯

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

4 participants