7.3. Troubleshooting Ansible Visual Studio Code extension errors
Use this topic to troubleshoot issues with Ansible VS Code.
7.3.1. Cannot view the generated code recommendations using the Ansible VS Code extension リンクのコピーリンクがクリップボードにコピーされました!
The following scenarios are possible:
You receive a
403 errormessage.To resolve this error, ensure that:
- Your organization administrator has configured Red Hat Ansible Lightspeed for your organization.
You meet one of the following requirements:
- Your organization has a trial or paid subscription to both the Red Hat Ansible Automation Platform and IBM watsonx Code Assistant.
- Your organization has a trial or paid subscription to the Red Hat Ansible Automation Platform, and you have a Red Hat Ansible Lightspeed trial account.
You have not configured the required Ansible VS code extension settings.
-
To resolve this error, ensure that you have enabled the Lightspeed:Enabled and
settings. For more information, see Configure the Ansible VS Code extension.
-
To resolve this error, ensure that you have enabled the Lightspeed:Enabled and
You receive a
Failure on completion requestserror when you make inference requests in VS Code.If you are part of an organization that has a trial or paid subscription to both Ansible Automation Platform and IBM watsonx Code Assistant, but your organization administrator has not configured an IBM watsonx Code Assistant model for your organization, you will encounter a
Failure on completion requestserror when you make inference requests in VS Code.You receive an
Ansible Lightspeed encountered an error. Try again after some time.error message when you make single-task or multitask requests.This error occurs when you use a remote SSH extension with VS Code to request single or multitask recommendations in playbooks. However, the task recommendations are generated when using a role. This error occurs in workspaces that contain a large number of roles.
Your VS Code Workspace settings override user settings.
If your Workspace settings are configured, they can override our user settings even if you have configured the Ansible VS Code extension correctly. The Workspace settings can disable your VS Code extension settings, and therefore you cannot access the Ansible Lightspeed service.
To resolve this error, ensure that there are no Workspace settings configured in VS Code. For more information, see Workspace settings in the VS Code documentation.
You entered a multitask prompt, but code recommendations were not generated.
To resolve this error, log out of VS Code and log in again using your Red Hat account.
You clicked a different location or switched to a different window; therefore, the populated code recommendations disappeared.
The Red Hat Ansible Lightspeed service could take multiple seconds per task to populate the code recommendations. If you are using a multitask prompt, the Red Hat Ansible Lightspeed service takes a bit longer to populate the results. Do not move your cursor or press any key while the code recommendation is being generated. If you change the cursor location or press any key, the Ansible VS Code extension cancels the request and the Red Hat Ansible Lightspeed service does not process your request. In this scenario, you must get the cursor back to its original position and repopulate the results.
7.3.2. Cannot request code recommendations by using the Ansible VS Code extension リンクのコピーリンクがクリップボードにコピーされました!
The following error message is displayed: Your trial to the generative AI model has expired. Refer to your IBM Cloud Account to re-enable access to the IBM watsonx Code Assistant.
To resolve this error, refer to your IBM Cloud account and select an upgrade option.
You might encounter errors when connecting with to the Ansible VS code extension through a proxy. Connections to the outbound domain https://c.ai.ansible.redhat.com fail and a network error message is displayed.
To resolve this issue, you must add the URL https://c.ai.ansible.redhat.com/ in VS Code proxy settings. If you are using Red Hat Single Sign-On (RH-SSO) to authenticate users, then you must also grant access to https://sso.redhat.com in VS code proxy settings.
To modify the proxy settings in VS code, perform the following tasks:
- Open Visual Studio Code.
- Navigate to File > Preferences > Settings.
-
Select
in the sidebar. In the Http: Proxy field, add the following URLs to the proxy:
-
https://c.ai.ansible.redhat.com/ -
https://sso.redhat.com, if you are using RH-SSO to authenticate users.
-
- In the http: Proxy Support drop down list, select Override.
Search for and select the following configuration keys:
- Electron Fetch
- System Certificates V2 if you are using your own Certificate Authority (CA).
For information about how to set up proxy support in VS Code, see Proxy server support in VS Code documentation and Proxy settings and fallback in The Chromium Project documentation.
7.3.4. Cannot connect to Ansible VS code extension due to network issues リンクのコピーリンクがクリップボードにコピーされました!
If you encounter network issues, use the Network Proxy Test extension to test the connection:
- Install the VS code extension Network Proxy Test.
Use the Network Proxy Test: Test Connection action to target the server and the endpoint using the parameter
/check/status end-point.For example:
https://c.ai.ansible.redhat.com/check/status/to test the connection to Red Hat Ansible Lightspeed cloud service.