Skip to content

Commit

Permalink
GITBOOK-8453: VS Code ext: Troubleshooting information for failing CL…
Browse files Browse the repository at this point in the history
…I download and first round improvements
  • Loading branch information
awileysnyk authored and gitbook-bot committed Nov 20, 2024
1 parent 7a67053 commit 6ce1129
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 24 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,60 @@
Snyk plugins are not supported on any operating system that has reached End Of Life (EOL) with the distributor. 
{% endhint %}

## Failing CLI download

The Snyk extension for Visual Studio Code downloads the CLI so the extension can operate. When the extension cannot download the required version of the CLI from the configured release channel, one of the following may be the reason:

1. Network connectivity issues
2. Misconfigured release channel settings
3. Temporary unavailability of the requested CLI version

Follow these steps to resolve the issue:

1. Check your internet connection and proxy settings.
2. Verify the release channel configuration in the extension settings.
3. Try switching to a different [release channel](../../../snyk-cli/releases-and-channels-for-the-snyk-cli.md) (for example, from **stable** to **preview**).
4. Restart Visual Studio Code and attempt to [reinstall the extension](./#how-to-install-and-set-up-the-extension).
5. If the problem persists, check for any known issues or updates on the [Snyk GitHub VS Code](https://github.com/snyk/vscode-extension/releases) repository

## Logs

The logs for VSCode can be found in the output channels for the Snyk Extension and Snyk Language Server. Both are needed for troubleshooting.
You can find the logs for VS Code in the output channels for the Snyk extension and Snyk Language Server. Both are needed for troubleshooting.

To enable debug log level, start VS Code from the terminal like this:
To enable the debug log level, start VS Code from the terminal like this:

`cd your-repo SNYK_LOG_LEVEL=debug code .`

Alternatively, you can add `-d` to additional parameters in the Snyk Settings.
Alternatively, you can add `-d` to additional parameters in the Snyk settings.

You can obtain additional logs by navigating to **Help** > **Toggle Developer Tools**, and opening the **Console** tab for additional output.
You can obtain additional logs by navigating to **Help** > **Toggle Developer Tools** and selecting the **Output** tab to see additional output. From the list displayed, select the **Snyk Language Server** channel and then the **Snyk Security** channel to see the debugging information.

<figure><img src="../../../.gitbook/assets/image (484).png" alt="Additional outout"><figcaption><p>Additional outout</p></figcaption></figure>
The Snyk Security channel has information on the extension itself. The Snyk Language Language Server channel receives the Language Server logs, displaying everything that is going on inside the Language Server and the CLI when you are using the extension.

<figure><img src="../../../.gitbook/assets/image (485).png" alt="Selected confiuration, Snyk Security - Code, Open Source Dependencies, IaC Configurations"><figcaption><p><code>Selected confiuration, Snyk Security - Code, Open Source Dependencies, IaC Configurations</code></p></figcaption></figure>
<figure><img src="../../../.gitbook/assets/IDE_VS-Code-logs-additional-information.png" alt=""><figcaption><p>Obtain additional output</p></figcaption></figure>

## Command not found (getActiveUser, LoginCommand, and so on)

This indicates that the required binaries are not available. To start the extension and use it, the following are required:
This indicates that the required binaries are not available. To start the extension and use it, ensure that the following are available and executable:

* Snyk Language Server (snyk-ls) available and executable
* Snyk CLI available and executable
* Snyk Language Server (snyk-ls)
* Snyk CLI

These are usually downloaded automatically by the extension. If this is not possible, the language server cannot be started, and thus not provide the indicated commands to VS Code.
These are usually downloaded automatically by the extension. If downloading automatically is not possible, the Language Server will not start, and thus, it will not provide the commands being used to VS Code.

## To fix <a href="#to-fix" id="to-fix"></a>
To resolve this problem, try the following:

* Check to see if automatic download is activated and if it works.
* Proxy/SSL problems could be a reason why the download does not finish.
* Missing write permissions in the configured path could be another reason why automatic download does not work
* Before reaching out for help, check:
* secure debug logs (`-d` in `additional parameters` ) and
* configuration
* manual CLI run logs and information on the network:
* do they have a proxy?
* do they use a mitm proxy that intercepts ssl connections?
* if yes, have they made the custom certificate authority available to the OS?
* If automatic management of dependencies is not enabled,
* download the Language Server and the CLI manually
* make them executable, and
* provide the path to the binary in the snyk settings in the corresponding fields.
* Proxy/SSL problems could be the reason why the download does not finish.
* Missing write permissions in the configured path could be another reason why automatic download does not work.
* Before reaching out for help, check the following:
* Secure debug logs (`-d` in `additional parameters` )
* Configuration
* Manual CLI run logs and information on the network:
* Is there a proxy?
* Is this an MITM proxy that intercepts SSL connections?
* If yes, is the custom certificate authority available to the OS?
* If automatic management of dependencies is not enabled, do the following:
* Download the Language Server and the CLI manually.
* Make them executable.
* Provide the path to the binary in the Snyk settings in the corresponding fields.

0 comments on commit 6ce1129

Please sign in to comment.