Giter VIP home page Giter VIP logo

Comments (7)

benoitf avatar benoitf commented on June 12, 2024 1

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

from win-ca.

mavaddat avatar mavaddat commented on June 12, 2024 1

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.

from win-ca.

mavsravikiran avatar mavsravikiran commented on June 12, 2024

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

from win-ca.

stevenaw avatar stevenaw commented on June 12, 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

from win-ca.

mavaddat avatar mavaddat commented on June 12, 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.

from win-ca.

mavsravikiran avatar mavsravikiran commented on June 12, 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 👍

from win-ca.

mavsravikiran avatar mavsravikiran commented on June 12, 2024

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

from win-ca.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.